inductance.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 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 INDUCTANCE_H
00012 #define INDUCTANCE_H
00013 
00014 #include "reactive.h"
00015 
00020 class Inductance : 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                 Inductance( double capacitance, double delta );
00030                 virtual ~Inductance();
00031         
00032                 virtual Type type() const { return Element_Inductance; }
00037                 void setMethod( Method m );
00038                 virtual void time_step();
00039                 virtual void add_initial_dc();
00040                 void setInductance( double i );
00041                 virtual void add_map();
00042         
00043         protected:
00044                 virtual void updateCurrents();
00045                 virtual bool updateStatus();
00046         
00047         private:
00048                 double m_inductance; // Inductance
00049                 Method m_method; // Method of integration
00050                 
00051                 double r_eq_old;
00052                 double v_eq_old;
00053 };
00054 
00055 #endif

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