File indexing completed on 2024-04-28 05:43:14

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 CCVS_H
0012 #define CCVS_H
0013 
0014 #include "element.h"
0015 
0016 /**
0017 CNodes n0 and n1 are used for the current control.
0018 CNodes n2 and n3 are used for the voltage output.
0019 Branches b0 and b1 are for control and output
0020 @short Current Controlled Voltage Source
0021 @author David Saxton
0022 */
0023 class CCVS : public Element
0024 {
0025 public:
0026     CCVS(const double gain);
0027     ~CCVS() override;
0028 
0029     Type type() const override
0030     {
0031         return Element_CCVS;
0032     }
0033     void setGain(const double g);
0034 
0035 protected:
0036     void updateCurrents() override;
0037     void add_initial_dc() override;
0038 
0039 private:
0040     double m_g; // Conductance
0041 };
0042 
0043 #endif