capacitance.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 CAPACITANCE_H
00012 #define CAPACITANCE_H
00013 
00014 #include "reactive.h"
00015 
00020 class Capacitance : public Reactive
00021 {
00022 public:
00023         enum Method
00024         {
00025                 m_none, // None
00026                 m_euler, // Backward Euler
00027                 m_trap // Trapezoidal (currently unimplemented)
00028         };
00029         Capacitance( const double capacitance, const double delta );
00030         virtual ~Capacitance();
00031         
00032         virtual Type type() const { return Element_Capacitance; }
00037         void setMethod( Method m );
00038         virtual void time_step();
00039         virtual void add_initial_dc();
00040         void setCapacitance( const double c );
00041         virtual void add_map();
00042         
00043 protected:
00044         virtual void updateCurrents();
00045         virtual bool updateStatus();
00046         
00047 private:
00048         double m_cap; // Capacitance
00049         Method m_method; // Method of integration
00050         
00051         double g_eq_old;
00052         double i_eq_old;
00053 };
00054 
00055 #endif

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