resistance.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003-2004 by David Saxton                               *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef RESISTANCE_H
00012 #define RESISTANCE_H
00013 
00014 #include "element.h"
00015 
00020 class Resistance : public Element
00021 {
00022 public:
00023         Resistance( const double resistance );
00024         virtual ~Resistance();
00025         
00026         virtual Type type() const { return Element_Resistance; }
00027         
00028         void setConductance( const double g );
00029         void setResistance( const double r );
00030         
00031         double resistance() { return 1/m_g; }
00032         double conductance() { return m_g; }
00033         virtual void add_map();
00034         
00035 protected:
00036         virtual void updateCurrents();
00037         virtual void add_initial_dc();
00038         
00039 private:
00040         double m_g; // Conductance
00041 };
00042 
00043 #endif

Generated on Tue May 8 17:05:32 2007 for KTechLab by  doxygen 1.5.1