VoltSourceRes.h 1.3 KB
Newer Older
1
2
3
4
5
6
7
8
#ifndef VOLTSOURCERES_H
#define VOLTSOURCERES_H

#include "BaseComponent.h"

namespace DPsim {

	class VoltSourceRes : public BaseComponent {
9
10
11
12
13

		/// Real Voltage source:
		/// The real voltage source is a voltage source in series with a resistance, which is transformed to a current source with
		/// a parallel resistance using the Norton equivalent

14
	protected:
15
16

		//  ### Real Voltage source parameters ###
17
18
		/// Complex voltage [V]
		Complex mVoltage;
19
20

		/// Resistance [ohm]
21
		Real mResistance;
22
23

		/// conductance [S]
24
		Real mConductance;
25

Viviane's avatar
Viviane committed
26
		/// Real part of equivalent current source [A]
27
		Real mCurrentr;
Viviane's avatar
Viviane committed
28
		/// Imaginary part of equivalent current source [A]
29
30
31
32
		Real mCurrenti;

	public:
		VoltSourceRes() { ; };
33
34

		/// define voltage source paramenters
35
		VoltSourceRes(std::string name, int src, int dest, Complex voltage, Real resistance);
36

37
		void init(Real om, Real dt) { }
Markus Mirz's avatar
merge    
Markus Mirz committed
38
		
39
		/// Stamps voltage source resistance to the conductance matrix
40
		void applySystemMatrixStamp(SystemModel& system);
Markus Mirz's avatar
merge    
Markus Mirz committed
41
		
42
		/// Stamps equivalent current source to the current vector 
43
		void applyRightSideVectorStamp(SystemModel& system);
Markus Mirz's avatar
merge    
Markus Mirz committed
44
45
		
		/// Stamps equivalent current source to the current vector
46
		void step(SystemModel& system, Real time);
Markus Mirz's avatar
merge    
Markus Mirz committed
47
		
48
		void postStep(SystemModel& system) { }
49
50

		Complex getCurrent(SystemModel& system);
51
52
53
	};
}
#endif