9 #include <dpsim-models/MathUtils.h>
10 #include <dpsim-models/Signal/Exciter.h>
14 Signal::Exciter::Exciter(
const String &name, CPS::Logger::Level logLevel)
16 mVm(mAttributes->create<Real>(
"Vm", 0)),
17 mVh(mAttributes->create<Real>(
"Vh", 0)),
18 mVis(mAttributes->create<Real>(
"Vis", 0)),
19 mVse(mAttributes->create<Real>(
"Vse", 0)),
20 mVr(mAttributes->create<Real>(
"Vr", 0)),
21 mEf(mAttributes->create<Real>(
"Ef", 0)) {}
24 Real Kf, Real Tr, Real maxVr, Real minVr) {
35 SPDLOG_LOGGER_INFO(mSLog,
36 "Exciter parameters: \n"
44 "\nMaximum regulator Voltage: {:e}"
45 "\nMinimum regulator Voltage: {:e}\n",
46 mTa, mKa, mTe, mKe, mTf, mKf, mTr, mMaxVr, mMinVr);
51 SPDLOG_LOGGER_INFO(mSLog,
52 "Initially set excitation system initial values: \n"
53 "Vh_init: {:e}\nEf_init: {:e}\n",
61 **mVse = **mEf * (0.33 * exp(0.1 * abs(**mEf)));
64 **mVis = -mKf / mTf * **mEf;
67 **mVr = mKe * **mEf + **mVse;
70 else if (**mVr < mMinVr)
73 mVref = **mVr / mKa + **mVm;
74 SPDLOG_LOGGER_INFO(mSLog,
75 "Actually applied excitation system initial values:"
82 mVref, **mVm, **mEf, **mVse, **mVr, **mVis);
87 **mVh = sqrt(pow(mVd, 2.) + pow(mVq, 2.));
98 **mVm = Math::StateSpaceEuler(mVm_prev, -1 / mTr, 1 / mTr, dt, **mVh);
102 **mVse = mEf_prev * (0.33 * exp(0.1 * abs(mEf_prev)));
103 **mVis = Math::StateSpaceEuler(mVis_prev, -1 / mTf, -mKf / mTf / mTf, dt,
108 Math::StateSpaceEuler(mVr_prev, -1 / mTa, mKa / mTa, dt,
109 mVref - **mVm - mVis_prev - mKf / mTf * mEf_prev);
112 else if (**mVr < mMinVr)
116 **mEf = Math::StateSpaceEuler(mEf_prev, -mKe / mTe, 1. / mTe, dt,
void setParameters(Real Ta, Real Ka, Real Te, Real Ke, Real Tf, Real Kf, Real Tr, Real maxVr=1.0, Real minVr=-0.9)
Initializes exciter parameters.
Real step(Real mVd, Real mVq, Real dt)
Performs an step to update field voltage value.
void initialize(Real Vh_init, Real Vf_init)
Initializes exciter variables.