File indexing completed on 2024-04-28 05:43:16
0001 /*************************************************************************** 0002 * Copyright (C) 2003-2004 by David Saxton * 0003 * david@bluehaze.org * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 ***************************************************************************/ 0010 0011 #ifndef VCCS_H 0012 #define VCCS_H 0013 0014 #include "element.h" 0015 0016 /** 0017 CNodes n0 and n1 are used for the voltage control. 0018 CNodes n2 and n3 are used for the current output. 0019 @short Voltage Controlled Current Source 0020 @author David Saxton 0021 */ 0022 class VCCS : public Element 0023 { 0024 public: 0025 VCCS(const double gain); 0026 ~VCCS() override; 0027 0028 Type type() const override 0029 { 0030 return Element_VCCS; 0031 } 0032 void setGain(const double g); 0033 0034 protected: 0035 void updateCurrents() override; 0036 void add_initial_dc() override; 0037 0038 private: 0039 double m_g; // Conductance 0040 }; 0041 0042 #endif