DPsim
Loading...
Searching...
No Matches
DP_Ph3_SynchronGeneratorVBR_Deprecated.cpp
Go to the documentation of this file.
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#include <dpsim-models/DP/DP_Ph3_SynchronGeneratorVBR.h>
10
11using namespace CPS;
12
14 String name, Real nomPower, Real nomVolt, Real nomFreq, Int poleNumber,
15 Real nomFieldCur, Real Rs, Real Ll, Real Lmd, Real Lmd0, Real Lmq,
16 Real Lmq0, Real Rfd, Real Llfd, Real Rkd, Real Llkd, Real Rkq1, Real Llkq1,
17 Real Rkq2, Real Llkq2, Real inertia, Logger::Level logLevel)
19 : SynchronGeneratorBase(name, nomPower, nomVolt, nomFreq, poleNumber,
20 nomFieldCur, Rs, Ll, Lmd, Lmd0, Lmq, Lmq0, Rfd,
21 Llfd, Rkd, Llkd, Rkq1, Llkq1, Rkq2, Llkq2, inertia,
22 logLevel) {
29}
30
32 Real Ke, Real Tf, Real Kf,
33 Real Tr, Real Lad, Real Rfd) {
34 mExciter = Exciter(Ta, Ka, Te, Ke, Tf, Kf, Tr, Lad, Rfd);
35 mExciter.initialize(1, 1);
36
37 mHasExciter = true;
38}
39
41 Real Fa, Real Fb, Real Fc,
42 Real K, Real Tsr, Real Tsm,
43 Real Tm_init, Real PmRef) {
44 mTurbineGovernor = TurbineGovernor(Ta, Tb, Tc, Fa, Fb, Fc, K, Tsr, Tsm);
45 mTurbineGovernor.initialize(PmRef, Tm_init);
47}
48
50 Real om, Real dt, Real initActivePower, Real initReactivePower,
51 Real initTerminalVolt, Real initVoltAngle, Real initMechPower) {
52
53 mSystemOmega = om;
54 mSystemTimeStep = dt;
55
56 mResistanceMat = Matrix::Zero(3, 3);
57 mResistanceMat << **mRs, 0, 0, 0, **mRs, 0, 0, 0, **mRs;
58
59 //Dynamic mutual inductances
60 mDLmd = 1. / (1. / mLmd + 1. / mLlfd + 1. / mLlkd);
61
62 if (mNumDampingWindings == 2) {
63 mDLmq = 1. / (1. / mLmq + 1. / mLlkq1 + 1. / mLlkq2);
64 } else {
65 mDLmq = 1. / (1. / mLmq + 1. / mLlkq1);
66 K1a = Matrix::Zero(2, 1);
67 K1 = Matrix::Zero(2, 1);
68 }
69
70 mLa = (mDLmq + mDLmd) / 3.;
71 mLb = (mDLmd - mDLmq) / 3.;
72
73 LD0 << (**mLl + mLa), -mLa / 2, -mLa / 2, -mLa / 2, **mLl + mLa, -mLa / 2,
74 -mLa / 2, -mLa / 2, **mLl + mLa;
75
76 // steady state per unit initial value
77 initStatesInPerUnit(initActivePower, initReactivePower, initTerminalVolt,
78 initVoltAngle, initMechPower);
79
81 mThetaMech = mThetaMech + PI / 2;
84 mIq = -mIq;
85 mId = -mId;
86
88
89 if (mNumDampingWindings == 2) {
90 mPsimq = mDLmq * (mPsikq1 / mLlkq1 + mPsikq2 / mLlkq2 + mIq);
91 } else {
92 mPsimq = mDLmq * (mPsikq1 / mLlkq1 + mIq);
93 }
94
95 mPsimd = mDLmd * (mPsifd / mLlfd + mPsikd / mLlkd + mId);
96
97 mDqStatorCurrents << mIq, mId;
98
99 mPsikq1kq2 << mPsikq1, mPsikq2;
100 mPsifdkd << mPsifd, mPsikd;
101
103
105
106 K_DP << K, Matrix::Zero(3, 3), Matrix::Zero(3, 3), K;
107
108 mVabc = dq0ToAbcTransform(mThetaMech, mVd, mVq, mV0);
109 mIabc = dq0ToAbcTransform(mThetaMech, mId, mIq, mI0);
110
112
114}
115
117 Matrix &rightVector,
118 Matrix &leftVector, Real time) {
119 stepInPerUnit(mSystemOmega, mSystemTimeStep, time, mNumericalMethod);
120
121 // Update current source accordingly
122 if (terminalNotGrounded(0)) {
125 }
126 if (terminalNotGrounded(1)) {
129 }
130 if (matrixNodeIndex(2) >= 0) {
133 }
134
135 //Update Equivalent Resistance
136 Int systemSize = systemMatrix.rows();
138 mConductanceMat(0, 0));
140 mConductanceMat(0, 1));
142 mConductanceMat(0, 2));
144 mConductanceMat(1, 0));
146 mConductanceMat(1, 1));
148 mConductanceMat(1, 2));
150 mConductanceMat(2, 0));
152 mConductanceMat(2, 1));
154 mConductanceMat(2, 2));
155
156 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(0) + systemSize,
158 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(0) + systemSize,
160 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(0) + systemSize,
162 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1) + systemSize,
164 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1) + systemSize,
166 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1) + systemSize,
168 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(2) + systemSize,
170 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(2) + systemSize,
172 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(2) + systemSize,
174
176 matrixNodeIndex(0) + systemSize,
177 mConductanceMat(0, 3));
179 matrixNodeIndex(1) + systemSize,
180 mConductanceMat(0, 4));
182 matrixNodeIndex(2) + systemSize,
183 mConductanceMat(0, 5));
185 matrixNodeIndex(0) + systemSize,
186 mConductanceMat(1, 3));
188 matrixNodeIndex(1) + systemSize,
189 mConductanceMat(1, 4));
191 matrixNodeIndex(2) + systemSize,
192 mConductanceMat(1, 5));
194 matrixNodeIndex(0) + systemSize,
195 mConductanceMat(2, 3));
197 matrixNodeIndex(1) + systemSize,
198 mConductanceMat(2, 4));
200 matrixNodeIndex(2) + systemSize,
201 mConductanceMat(2, 5));
202
203 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(0) + systemSize,
204 matrixNodeIndex(0) + systemSize,
205 mConductanceMat(3, 3));
206 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(0) + systemSize,
207 matrixNodeIndex(1) + systemSize,
208 mConductanceMat(3, 4));
209 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(0) + systemSize,
210 matrixNodeIndex(2) + systemSize,
211 mConductanceMat(3, 5));
212 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1) + systemSize,
213 matrixNodeIndex(0) + systemSize,
214 mConductanceMat(4, 3));
215 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1) + systemSize,
216 matrixNodeIndex(1) + systemSize,
217 mConductanceMat(4, 4));
218 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(1) + systemSize,
219 matrixNodeIndex(2) + systemSize,
220 mConductanceMat(4, 5));
221 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(2) + systemSize,
222 matrixNodeIndex(0) + systemSize,
223 mConductanceMat(5, 3));
224 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(2) + systemSize,
225 matrixNodeIndex(1) + systemSize,
226 mConductanceMat(5, 4));
227 Math::addToMatrixElement(systemMatrix, matrixNodeIndex(2) + systemSize,
228 matrixNodeIndex(2) + systemSize,
229 mConductanceMat(5, 5));
230
231 // TODO find solution without SystemModel
232 // system.updateLuFactored();
233
234 if (mLogLevel != Logger::Level::off) {
235 Matrix logValues(statorCurrents().rows() + dqStatorCurrents().rows() + 3,
236 1);
237 logValues << statorCurrents() * mBase_I, dqStatorCurrents(),
239 SPDLOG_LOGGER_DEBUG(mLog, time, logValues);
240 }
241}
242
244 NumericalMethod numMethod) {
245
246 // Calculate mechanical variables with euler
247 if (mHasTurbineGovernor == true) {
248 ** = -mTurbineGovernor.step(**mOmMech, 1, 300e6 / 555e6, dt);
249 }
250
251 **mElecTorque = (mPsimd * mIq - mPsimq * mId);
252 **mOmMech =
253 **mOmMech + dt * (1. / (2. * mH) * (**mElecTorque - **mMechTorque));
254 mThetaMech = mThetaMech + dt * ((**mOmMech - 1) * mBase_OmMech);
256
257 mPsikq1kq2 << mPsikq1, mPsikq2;
258 mPsifdkd << mPsifd, mPsikd;
259
260 CalculateLandR(time, dt * mBase_OmElec);
261
263
265 K_DP << K, Matrix::Zero(3, 3), Matrix::Zero(3, 3), K;
266
267 R_eq_DP = Var1 + K_DP;
269
270 mConductanceMat = (R_eq_DP * mBase_Z).inverse();
271 mISourceEq = R_eq_DP.inverse() * E_eq_DP * mBase_I;
272}
273
275 Matrix &leftVector,
276 Real time) {
277 Real dt = mSystemTimeStep;
278
279 if (terminalNotGrounded(0)) {
280 mVaRe =
281 Math::complexFromVectorElement(leftVector, matrixNodeIndex(0)).real();
282 mVaIm =
283 Math::complexFromVectorElement(leftVector, matrixNodeIndex(0)).imag();
284 } else {
285 mVaRe = 0;
286 mVaIm = 0;
287 }
288 if (terminalNotGrounded(1)) {
289 mVbRe =
290 Math::complexFromVectorElement(leftVector, matrixNodeIndex(1)).real();
291 mVbIm =
292 Math::complexFromVectorElement(leftVector, matrixNodeIndex(1)).imag();
293 } else {
294 mVbRe = 0;
295 mVbIm = 0;
296 }
297 if (matrixNodeIndex(2) >= 0) {
298 mVcRe =
299 Math::complexFromVectorElement(leftVector, matrixNodeIndex(2)).real();
300 mVcIm =
301 Math::complexFromVectorElement(leftVector, matrixNodeIndex(2)).imag();
302 } else {
303 mVcRe = 0;
304 mVcIm = 0;
305 }
306
309
311 mVcIm)(0);
313 mVcIm)(1);
315 mVcIm)(2);
316
317 if (mHasExciter == true) {
318 mVfd = mExciter.step(mVd, mVq, 1, dt);
319 }
320
321 mIabc = R_eq_DP.inverse() * (mVabc - E_eq_DP);
322
323 mIaRe = mIabc(0);
324 mIbRe = mIabc(1);
325 mIcRe = mIabc(2);
326 mIaIm = mIabc(3);
327 mIbIm = mIabc(4);
328 mIcIm = mIabc(5);
329 mIq_hist = mIq;
330 mId_hist = mId;
332 mIcIm)(0);
334 mIcIm)(1);
336 mIcIm)(2);
337
338 // Calculate rotor flux likanges
339 if (mNumDampingWindings == 2) {
340
341 mDqStatorCurrents << mIq, mId;
342
343 mPsikq1kq2 = E1 * mIq + E2 * mPsikq1kq2 + E1 * mIq_hist;
344 mPsifdkd = F1 * mId + F2 * mPsifdkd + F1 * mId_hist + F3 * mVfd;
345
346 mPsikq1 = mPsikq1kq2(0);
347 mPsikq2 = mPsikq1kq2(1);
348 mPsifd = mPsifdkd(0);
349 mPsikd = mPsifdkd(1);
350
351 } else {
352
353 mDqStatorCurrents << mIq, mId;
354
355 mPsikq1 = E1_1d * mIq + E2_1d * mPsikq1 + E1_1d * mIq_hist;
356 mPsifdkd = F1 * mId + F2 * mPsifdkd + F1 * mId_hist + F3 * mVfd;
357
358 mPsifd = mPsifdkd(0);
359 mPsikd = mPsifdkd(1);
360 }
361
362 // Calculate dynamic flux likages
363 if (mNumDampingWindings == 2) {
364 mPsimq = mDLmq * (mPsikq1 / mLlkq1 + mPsikq2 / mLlkq2 + mIq);
365 } else {
366 mPsimq = mDLmq * (mPsikq1 / mLlkq1 + mIq);
367 }
368
369 mPsimd = mDLmd * (mPsifd / mLlfd + mPsikd / mLlkd + mId);
370
372}
373
375
376 if (mNumDampingWindings == 2) {
377 c21_omega = -**mOmMech * mDLmq / mLlkq1;
378 c22_omega = -**mOmMech * mDLmq / mLlkq2;
381
383 K1b << c15, 0;
384 K1 = K1a * E1 + K1b;
385 } else {
386 c21_omega = -**mOmMech * mDLmq / mLlkq1;
389
390 K1a << c11, c21_omega;
391 K1b << c15, 0;
392 K1 = K1a * E1_1d + K1b;
393 }
394
396 K2b << 0, c25;
397 K2 = K2a * F1 + K2b;
398
399 K << K1, K2, Matrix::Zero(2, 1), 0, 0, 0;
400
401 mKrs_teta << 2. / 3. * cos(mThetaMech2),
402 2. / 3. * cos(mThetaMech2 - 2. * M_PI / 3.),
403 2. / 3. * cos(mThetaMech2 + 2. * M_PI / 3.), 2. / 3. * sin(mThetaMech2),
404 2. / 3. * sin(mThetaMech2 - 2. * M_PI / 3.),
405 2. / 3. * sin(mThetaMech2 + 2. * M_PI / 3.), 1. / 3., 1. / 3., 1. / 3.;
406
407 // mKrs_teta_inv = mKrs_teta.inverse();
408 mKrs_teta_inv << cos(mThetaMech2), sin(mThetaMech2), 1.,
409 cos(mThetaMech2 - 2. * M_PI / 3.), sin(mThetaMech2 - 2. * M_PI / 3.), 1,
410 cos(mThetaMech2 + 2. * M_PI / 3.), sin(mThetaMech2 + 2. * M_PI / 3.), 1.;
411
413
414 if (mNumDampingWindings == 2) {
415 //h_qdr = K1a*E2*mPsikq1kq2 + K1a*E1*mIq + K2a*F2*mPsifdkd + K2a*F1*mId + (K2a*F3 + C26)*mVfd;
416 h_qdr =
417 K1a * E2 * mPsikq1kq2 + K2a * F2 * mPsifdkd + (K2a * F3 + C26) * mVfd;
418 } else {
419 h_qdr = K1a * E2_1d * mPsikq1 + K1a * E1_1d * mIq + K2a * F2 * mPsifdkd +
420 K2a * F1 * mId + (K2a * F3 + C26) * mVfd;
421 }
422
423 Matrix Knew = Matrix::Zero(3, 3);
424 Knew << K1a * E1, K2a * F1, Matrix::Zero(2, 1), 0, 0, 0;
425 Knew = mKrs_teta_inv * Knew * mKrs_teta;
426
427 Matrix KDPnew = Matrix::Zero(6, 6);
428 KDPnew << Knew, Matrix::Zero(3, 3), Matrix::Zero(3, 3), Knew;
429
430 E_r_vbr_DP2 = KDPnew * mIabc;
431}
432
434 b11 = (mRkq1 / mLlkq1) * (mDLmq / mLlkq1 - 1);
435 b13 = mRkq1 * mDLmq / mLlkq1;
436 b31 = (mRfd / mLlfd) * (mDLmd / mLlfd - 1);
437 b32 = mRfd * mDLmd / (mLlfd * mLlkd);
438 b33 = mRfd * mDLmd / mLlfd;
439 b41 = mRkd * mDLmd / (mLlfd * mLlkd);
440 b42 = (mRkd / mLlkd) * (mDLmd / mLlkd - 1);
441 b43 = mRkd * mDLmd / mLlkd;
442
443 c23 = mDLmd * mRfd / (mLlfd * mLlfd) * (mDLmd / mLlfd - 1) +
444 mDLmd * mDLmd * mRkd / (mLlkd * mLlkd * mLlfd);
445 c24 = mDLmd * mRkd / (mLlkd * mLlkd) * (mDLmd / mLlkd - 1) +
446 mDLmd * mDLmd * mRfd / (mLlfd * mLlfd * mLlkd);
447 c25 = (mRfd / (mLlfd * mLlfd) + mRkd / (mLlkd * mLlkd)) * mDLmd * mDLmd;
448 c26 = mDLmd / mLlfd;
449
450 if (mNumDampingWindings == 2) {
451 b12 = mRkq1 * mDLmq / (mLlkq1 * mLlkq2);
452 b21 = mRkq2 * mDLmq / (mLlkq1 * mLlkq2);
453 b22 = (mRkq2 / mLlkq2) * (mDLmq / mLlkq2 - 1);
454 b23 = mRkq2 * mDLmq / mLlkq2;
455 c11 = mDLmq * mRkq1 / (mLlkq1 * mLlkq1) * (mDLmq / mLlkq1 - 1) +
456 mDLmq * mDLmq * mRkq2 / (mLlkq2 * mLlkq2 * mLlkq1);
457 c12 = mDLmq * mRkq2 / (mLlkq2 * mLlkq2) * (mDLmq / mLlkq2 - 1) +
458 mDLmq * mDLmq * mRkq1 / (mLlkq1 * mLlkq1 * mLlkq2);
459 c15 =
460 (mRkq1 / (mLlkq1 * mLlkq1) + mRkq2 / (mLlkq2 * mLlkq2)) * mDLmq * mDLmq;
461
462 Ea << 2 - dt * b11, -dt * b12, -dt * b21, 2 - dt * b22;
463 E1b << dt * b13, dt * b23;
464 E1 = Ea.inverse() * E1b;
465
466 E2b << 2 + dt * b11, dt * b12, dt * b21, 2 + dt * b22;
467 E2 = Ea.inverse() * E2b;
468 } else {
469 c11 = mDLmq * mRkq1 / (mLlkq1 * mLlkq1) * (mDLmq / mLlkq1 - 1);
470 c15 = (mRkq1 / (mLlkq1 * mLlkq1)) * mDLmq * mDLmq;
471
472 E1_1d = (1 / (2 - dt * b11)) * dt * b13;
473 E2_1d = (1 / (2 - dt * b11)) * (2 + dt * b11);
474 }
475
476 Fa << 2 - dt * b31, -dt * b32, -dt * b41, 2 - dt * b42;
477 F1b << dt * b33, dt * b43;
478 F1 = Fa.inverse() * F1b;
479
480 F2b << 2 + dt * b31, dt * b32, dt * b41, 2 + dt * b42;
481
482 F2 = Fa.inverse() * F2b;
483
484 F3b << 2 * dt, 0;
485 F3 = Fa.inverse() * F3b;
486
487 C26 << 0, c26;
488}
489
491 Matrix L1_Re(3, 3);
492 Matrix L1_Im(3, 3);
493 Matrix Re_R(3, 3);
494 Matrix Im_R(3, 3);
495 Matrix Re_L(3, 3);
496 Matrix Im_L(3, 3);
497 Matrix Re_R2(3, 3);
498 Matrix Im_R2(3, 3);
499 Matrix Re_L2(3, 3);
500 Matrix Im_L2(3, 3);
501
502 Real b_Re = cos(2 * **mOmMech * mBase_OmMech * time);
503 Real b_Im = sin(2 * **mOmMech * mBase_OmMech * time);
504 Real c_Re = cos(2 * mThetaMech2 - 2 * 1 * mBase_OmMech * time - 2 * mTheta0);
505 Real c_Im = sin(2 * mThetaMech2 - 2 * 1 * mBase_OmMech * time - 2 * mTheta0);
506
507 Real a = 2 * (mTheta0);
508
509 L1_Re << cos(a), cos(-2. * PI / 3 + a), cos(2. * PI / 3 + a),
510 cos(-2 * PI / 3 + a), cos(-4 * PI / 3 + a), cos(a), cos(2 * PI / 3 + a),
511 cos(a), cos(4 * PI / 3 + a);
512 L1_Re = mLb * L1_Re;
513 L1_Im << sin(a), sin(-2. * PI / 3 + a), sin(2. * PI / 3 + a),
514 sin(-2 * PI / 3 + a), sin(-4 * PI / 3 + a), sin(a), sin(2 * PI / 3 + a),
515 sin(a), sin(4 * PI / 3 + a);
516 L1_Im = mLb * L1_Im;
517
518 Re_R =
519 mResistanceMat + (2 * **mOmMech + 1) / 2. * (L1_Re * b_Im + L1_Im * b_Re);
520 Im_R = LD0 - (2 * **mOmMech + 1) / 2. * (L1_Re * b_Re - L1_Im * b_Im);
521 Re_L = LD0 - 1. / 2. * (L1_Re * b_Re - L1_Im * b_Im);
522 Im_L = -1. / 2. * (L1_Re * b_Im + L1_Im * b_Re);
523 Re_R2 = 1. / 2. * (2 * **mOmMech - 1) * (L1_Im * c_Re + L1_Re * c_Im);
524 Im_R2 = -1. / 2. * (2 * **mOmMech - 1) * (L1_Re * c_Re - L1_Im * c_Im);
525 Re_L2 = -1. / 2. * (L1_Re * c_Re - L1_Im * c_Im);
526 Im_L2 = -1. / 2. * (L1_Im * c_Re + L1_Re * c_Im);
527
528 R_EQ << Re_R + Re_R2, -Im_R + Im_R2, Im_R + Im_R2, Re_R - Re_R2;
529 L_EQ << Re_L + Re_L2, -Im_L + Im_L2, Im_L + Im_L2, Re_L - Re_L2;
530
531 A = -L_EQ.inverse() * R_EQ;
532 B = L_EQ.inverse();
533 Var1 = B.inverse() * ((2 / dt) * Matrix::Identity(6, 6) - A);
534 Var2 = -B.inverse() * ((2 / dt) * Matrix::Identity(6, 6) + A);
535}
536
538 Real bRe, Real cRe,
539 Real aIm, Real bIm,
540 Real cIm) {
541 // Balanced case
542 Complex alpha(cos(2. / 3. * PI), sin(2. / 3. * PI));
543 Complex thetaCompInv(cos(-theta), sin(-theta));
544 MatrixComp AbcToPnz(3, 3);
545 AbcToPnz << 1, 1, 1, 1, alpha, pow(alpha, 2), 1, pow(alpha, 2), alpha;
546 AbcToPnz = (1. / 3.) * AbcToPnz;
547
548 MatrixComp abcVector(3, 1);
549 abcVector << Complex(aRe, aIm), Complex(bRe, bIm), Complex(cRe, cIm);
550
551 MatrixComp pnzVector(3, 1);
552 pnzVector = AbcToPnz * abcVector * thetaCompInv;
553
554 Matrix dq0Vector(3, 1);
555 dq0Vector << pnzVector(1, 0).real(), -pnzVector(1, 0).imag(), 0;
556
557 return dq0Vector;
558}
559
561 Real q, Real zero) {
562 // Balanced case
563 Complex alpha(cos(2. / 3. * PI), sin(2. / 3. * PI));
564 Complex thetaComp(cos(theta), sin(theta));
565 MatrixComp PnzToAbc(3, 3);
566 PnzToAbc << 1, 1, 1, 1, pow(alpha, 2), alpha, 1, alpha, pow(alpha, 2);
567
568 MatrixComp pnzVector(3, 1);
569 pnzVector << 0, Complex(q, -d), Complex(0, 0);
570
571 MatrixComp abcCompVector(3, 1);
572 abcCompVector = PnzToAbc * pnzVector * thetaComp;
573
574 Matrix abcVector(6, 1);
575 abcVector << abcCompVector(0, 0).real(), abcCompVector(1, 0).real(),
576 abcCompVector(2, 0).real(), abcCompVector(0, 0).imag(),
577 abcCompVector(1, 0).imag(), abcCompVector(2, 0).imag();
578
579 return abcVector;
580}
Real mSystemOmega
Simulation angular system speed.
Real mRkq1
q-axis damper resistance 1 Rkq1 [Ohm]
Real mLmd
d-axis mutual inductance Lmd [H]
Real mBase_I
base stator current peak
Bool mHasExciter
Determines if Exciter is activated.
const Attribute< Real >::Ptr mMechTorque
mechanical torque
Real mLmq
q-axis mutual inductance Lmq [H]
std::shared_ptr< Base::Exciter > mExciter
Signal component modelling voltage regulator and exciter.
Real mLlfd
field leakage inductance Llfd [H]
Real mLlkd
d-axis damper leakage inductance Llkd [H]
Real mBase_Z
base stator impedance
const Attribute< Real >::Ptr mRs
stator resistance Rs [Ohm]
Matrix mResistanceMat
resistance matrix
std::shared_ptr< Signal::TurbineGovernor > mTurbineGovernor
Signal component modelling governor control and steam turbine (legacy)
Real mLlkq1
q-axis damper leakage inductance 1 Llkq1 [H]
Real mRkd
d-axis damper resistance Rkd [Ohm]
Real mRfd
field resistance Rfd [Ohm]
Real mBase_OmElec
base electrical angular frequency
const Attribute< Real >::Ptr mLl
leakage inductance Ll [H]
Real mBase_OmMech
base mechanical angular frequency
Real mRkq2
q-axis damper resistance 2 Rkq2 [Ohm]
Int mNumDampingWindings
Number of damping windings in q.
Real mBase_V
base stator voltage (phase-to-ground peak)
const Attribute< Real >::Ptr mOmMech
rotor speed omega_r
Bool mHasTurbineGovernor
Determines if legacy TurbineGovernor is activated.
Real mLlkq2
q-axis damper leakage inductance 2 Llkq2 [H]
const Attribute< Real >::Ptr mElecTorque
electrical torque
void mnaCompPostStep(Matrix &rightVector, Matrix &leftVector, Real time)
Retrieves calculated voltage from simulation for next step.
Real mVaIm
Interface voltage phase a _ Imaginary part.
Matrix R_EQ
Equivalent stator resistance matrix.
Real mVbIm
Interface voltage phase b _ Imaginary part.
Real mPsimd
Magnetizing flux linkage in d axis.
Real mIbIm
Interface current phase b _ Imaginary part.
Matrix LD0
Constant part of equivalent stator inductance.
Real mIbRe
Interface current phase b _ Real part.
Real mIcIm
Interface current phase c _ Imaginary part.
Matrix R_eq_DP
Equivalent VBR resistance matrix.
Matrix E_eq_DP
Equivalent VBR voltage source vector.
void mnaStep(Matrix &systemMatrix, Matrix &rightVector, Matrix &leftVector, Real time)
Matrix mKrs_teta_inv
Inverse Park Transformation Matrix.
Real mIaRe
Interface current phase a _ Real part.
Real mVbRe
Interface voltage phase b _ Real part.
Real mVaRe
Interface voltage phase a _ Real part.
Matrix mConductanceMat
Equivalent Stator Conductance Matrix.
Real mVcRe
Interface voltage phase c _ Real part.
void stepInPerUnit(Real om, Real dt, Real time, NumericalMethod numMethod)
Real mIcRe
Interface current phase c _ Real part.
Real mIaIm
Interface current phase a _ Imaginary part.
Real mIq_hist
stator current in q axis (last time step)
Matrix dq0ToAbcTransform(Real theta, Real d, Real q, Real zero)
dq to abc
Matrix abcToDq0Transform(Real theta, Real aRe, Real bRe, Real cRe, Real aIm, Real bIm, Real cIm)
abc to dq
void addGovernor(Real Ta, Real Tb, Real Tc, Real Fa, Real Fb, Real Fc, Real K, Real Tsr, Real Tsm, Real Tm_init, Real PmRef)
Function to initialize Governor and Turbine.
void initialize(Matrix frequencies) override
Initialize components with correct network frequencies.
void addExciter(Real Ta, Real Ka, Real Te, Real Ke, Real Tf, Real Kf, Real Tr, Real Lad, Real Rfd)
Function to initialize Exciter.
Real mPsimq
Magnetizing flux linkage in q axis.
Matrix mISourceEq
Equivalent Stator Current Source.
Real mVcIm
Interface voltage phase c _ Imaginary part.
SynchronGeneratorVBR(String name, Real nomPower, Real nomVolt, Real nomFreq, Int poleNumber, Real nomFieldCur, Real Rs, Real Ll, Real Lmd, Real Lmd0, Real Lmq, Real Lmq0, Real Rfd, Real Llfd, Real Rkd, Real Llkd, Real Rkq1, Real Llkq1, Real Rkq2, Real Llkq2, Real inertia, Logger::Level logLevel=Logger::Level::off)
FIXME: SynchronGeneratorBase does not exist!
Matrix L_EQ
Equivalent stator inductance matrix.
Real mId_hist
stator current in d axis (last time step)
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
Definition Logger.h:33
static Complex complexFromVectorElement(const Matrix &mat, Matrix::Index row, Int maxFreq=1, Int freqIdx=0)
Definition MathUtils.cpp:94
static void addToVectorElement(Matrix &mat, Matrix::Index row, Complex value, Int maxFreq=1, Int freqIdx=0)
Definition MathUtils.cpp:83
static void addToMatrixElement(SparseMatrixRow &mat, Matrix::Index row, Matrix::Index column, Complex value, Int maxFreq=1, Int freqIdx=0)
UInt matrixNodeIndex(UInt nodeIndex)
Bool terminalNotGrounded(UInt index)
Logger::Level mLogLevel
Component logger control for internal variables.
#define PI
Definition Definitions.h:43
#define M_PI
Definition Definitions.h:41
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:81
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
int Int
Definition Definitions.h:61
std::complex< Real > Complex
Definition Definitions.h:63
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.
Definition Definitions.h:84
NumericalMethod