DPsim
Loading...
Searching...
No Matches
DP_Ph1_SVC.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
10
11using namespace CPS;
12
14 : SVC(uid, name, true, logLevel) {}
15
17 Logger::Level logLevel)
18 : CompositePowerComp<Complex>(uid, name, true, true, logLevel),
19 mUseSubcomponents(useSubcomponents),
20 mVpcc(mAttributes->create<Real>("Vpcc", 0)),
21 mVmeasPrev(mAttributes->create<Real>("Vmeas", 0)) {
24 **mIntfVoltage = MatrixComp::Zero(1, 1);
25 **mIntfCurrent = MatrixComp::Zero(1, 1);
26
27 mDeltaV = mAttributes->create<Real>("DeltaV", 0);
28 mBPrev = mAttributes->create<Real>("B");
29 mViolationCounter = mAttributes->create<Real>("ViolationCounter", 0);
30}
31
33
36 return;
38 return;
39 mSubCompCreated = true;
40
41 // Inductor/capacitor values depend on omega computed from the simulation
42 // frequency in initializeParentFromNodesAndTerminals(). They are created
43 // here (topology) and parametrized there (values).
44
45 // Inductor with Switch
47 std::make_shared<DP::Ph1::Inductor>(**mName + "_ind", mLogLevel);
51
53 std::make_shared<DP::Ph1::Switch>(**mName + "_Lswitch", mLogLevel);
54 mSubInductorSwitch->setParameters(mSwitchROpen, mSwitchRClosed, false);
55 mSubInductorSwitch->connect({mVirtualNodes[0], mTerminals[0]->node()});
59
60 // Capacitor with Switch
62 std::make_shared<DP::Ph1::Capacitor>(**mName + "_cap", mLogLevel);
66
68 std::make_shared<DP::Ph1::Switch>(**mName + "_Cswitch", mLogLevel);
69 mSubCapacitorSwitch->setParameters(mSwitchROpen, mSwitchRClosed, false);
70 mSubCapacitorSwitch->connect({mVirtualNodes[1], mTerminals[0]->node()});
74}
75
77 // initial state is both switches are open
78 Real omega = 2. * PI * frequency;
79 // init L and C with small/high values (both have high impedance)
80 Real LInit = 1e6 / omega;
81 Real CInit = 1e-6 / omega;
82 mLPrev = LInit;
83 mCPrev = CInit;
84
85 // impedances of both branches
86 Complex LImpedance = {mSwitchROpen, omega * LInit};
87 Complex CImpedance = {mSwitchROpen, -1 / (omega * CInit)};
88 Complex impedance = LImpedance * CImpedance / (LImpedance + CImpedance);
89
90 (**mIntfVoltage)(0, 0) = initialSingleVoltage(0);
91 (**mIntfCurrent)(0, 0) = (**mIntfVoltage)(0, 0) / impedance;
92
93 **mBPrev = 0;
94 mPrevVoltage = (**mIntfVoltage)(0, 0).real();
96
97 if (mMechMode) {
98 SPDLOG_LOGGER_INFO(mSLog, "Using Mechanical Model");
99 }
100
101 SPDLOG_LOGGER_INFO(mSLog,
102 "\n --- Parameters ---"
103 "\n Controller: T = {} K = {}"
104 "\n Reference Voltage {} [kV]"
105 "\n Qmax = {} [var] -> BN = {} [S]"
106 "\n Bmax = {} Bmin = {} [p.u.]"
107 "\n Initial B: {}",
109
110 // set voltages at virtual nodes
111 Complex VLSwitch =
112 (**mIntfVoltage)(0, 0) - LImpedance * (**mIntfCurrent)(0, 0);
113 mVirtualNodes[0]->setInitialVoltage(VLSwitch);
114 Complex VCSwitch =
115 (**mIntfVoltage)(0, 0) - CImpedance * (**mIntfCurrent)(0, 0);
116 mVirtualNodes[1]->setInitialVoltage(VCSwitch);
117
118 if (mUseSubcomponents) {
119 mSubInductor->setParameters(LInit);
120 mSubCapacitor->setParameters(CInit);
121 } else {
122 mDirectInductance = LInit;
123 mDirectCapacitance = CInit;
124 }
125
126 SPDLOG_LOGGER_INFO(mSLog,
127 "\n--- Initialization from powerflow ---"
128 "\nImpedance: {}"
129 "\nVoltage across: {:s}"
130 "\nCurrent: {:s}"
131 "\nTerminal 0 voltage: {:s}"
132 "\n--- Initialization from powerflow finished ---",
133 impedance, Logger::phasorToString((**mIntfVoltage)(0, 0)),
136}
137
139 Attribute<Matrix>::Ptr leftVector) {
141 return;
142 mDirectTimeStep = timeStep;
143 mDirectInductorAdmittance = MatrixComp::Zero(mNumFreqs, 1);
144 mDirectInductorPrevCurrentFactor = MatrixComp::Zero(mNumFreqs, 1);
145 mDirectInductorCurrent = MatrixComp::Zero(mNumFreqs, 1);
146 mDirectInductorVoltage = MatrixComp::Zero(mNumFreqs, 1);
147 mDirectInductorHistory = MatrixComp::Zero(mNumFreqs, 1);
148 mDirectCapacitorAdmittance = MatrixComp::Zero(mNumFreqs, 1);
149 mDirectCapacitorPrevVoltageFactor = MatrixComp::Zero(mNumFreqs, 1);
150 mDirectCapacitorCurrent = MatrixComp::Zero(mNumFreqs, 1);
151 mDirectCapacitorVoltage = MatrixComp::Zero(mNumFreqs, 1);
152 mDirectCapacitorHistory = MatrixComp::Zero(mNumFreqs, 1);
153 for (UInt freq = 0; freq < mNumFreqs; ++freq) {
154 const Real harmonicOmega = 2. * PI * mFrequencies(freq, 0);
155 mDirectInductorVoltage(freq, 0) = mVirtualNodes[0]->initialSingleVoltage();
156 mDirectCapacitorVoltage(freq, 0) = mVirtualNodes[1]->initialSingleVoltage();
157 mDirectInductorCurrent(freq, 0) =
158 harmonicOmega != 0. ? mDirectInductorVoltage(freq, 0) /
159 Complex(0., harmonicOmega * mDirectInductance)
160 : Complex(0., 0.);
161 mDirectCapacitorCurrent(freq, 0) =
162 Complex(0., harmonicOmega * mDirectCapacitance) *
164 }
166 // Match the state transition performed by DP::Inductor::mnaCompInitialize
167 // and DP::Capacitor::mnaCompInitialize. Those components convert the
168 // sinusoidal steady-state initial currents into their trapezoidal companion
169 // state before the first pre-step; retaining only the physical phasor here
170 // produces a different first history source in direct mode.
171 for (UInt freq = 0; freq < mNumFreqs; ++freq) {
172 mDirectInductorHistory(freq, 0) =
175 mDirectInductorCurrent(freq, 0);
176 mDirectInductorCurrent(freq, 0) =
178 mDirectInductorHistory(freq, 0);
179
180 mDirectCapacitorHistory(freq, 0) =
181 -mDirectCapacitorCurrent(freq, 0) -
184 mDirectCapacitorCurrent(freq, 0) =
187 }
188}
189
192 return;
193 for (UInt freq = 0; freq < mNumFreqs; ++freq) {
194 const Real harmonicOmega = 2. * PI * mFrequencies(freq, 0);
195 const Real b = mDirectTimeStep * harmonicOmega / 2.;
196 const Real a = mDirectTimeStep / (2. * mDirectInductance);
198 Complex(a / (1. + b * b), -a * b / (1. + b * b));
200 Complex((1. - b * b) / (1. + b * b), -2. * b / (1. + b * b));
201 const Real capG = 2. * mDirectCapacitance / mDirectTimeStep;
202 const Real capB = harmonicOmega * mDirectCapacitance;
203 mDirectCapacitorAdmittance(freq, 0) = Complex(capG, capB);
204 mDirectCapacitorPrevVoltageFactor(freq, 0) = Complex(capG, -capB);
205 }
206}
207
209 SparseMatrixRow &systemMatrix) {
211 return;
212 for (UInt freq = 0; freq < mNumFreqs; ++freq) {
214 mDirectInductorAdmittance(freq, 0), systemMatrix,
216 false, true, mSLog, mNumFreqs, freq);
218 mDirectCapacitorAdmittance(freq, 0), systemMatrix,
220 false, true, mSLog, mNumFreqs, freq);
221 const Real gInductor =
223 const Real gCapacitor =
226 Complex(gInductor, 0.), systemMatrix, matrixNodeIndex(0),
228 mNumFreqs, freq);
230 Complex(gCapacitor, 0.), systemMatrix, matrixNodeIndex(0),
232 mNumFreqs, freq);
233 }
234}
235
238 return;
239 for (UInt freq = 0; freq < mNumFreqs; ++freq) {
240 mDirectInductorHistory(freq, 0) =
243 mDirectInductorCurrent(freq, 0);
244 mDirectCapacitorHistory(freq, 0) =
245 -mDirectCapacitorCurrent(freq, 0) -
249 -mDirectInductorHistory(freq, 0), mNumFreqs, freq);
251 -mDirectCapacitorHistory(freq, 0), mNumFreqs, freq);
252 }
253}
254
255// #### MNA functions ####
256
258 AttributeBase::List &prevStepDependencies,
259 AttributeBase::List &attributeDependencies,
260 AttributeBase::List &modifiedAttributes) {
261 modifiedAttributes.push_back(mRightVector);
262}
263
264void DP::Ph1::SVC::mnaParentPreStep(Real time, Int timeStepCount) {
267
268 if (time > 0.1 && !mDisconnect) {
269 if (mMechMode) {
271 } else {
273 }
274 checkProtection(time);
275 }
276 if (!mUseSubcomponents) {
279 }
280}
281
283 AttributeBase::List &prevStepDependencies,
284 AttributeBase::List &attributeDependencies,
285 AttributeBase::List &modifiedAttributes,
286 Attribute<Matrix>::Ptr &leftVector) {
287 attributeDependencies.push_back(leftVector);
288 modifiedAttributes.push_back(mIntfVoltage);
289 modifiedAttributes.push_back(mIntfCurrent);
290}
291
292void DP::Ph1::SVC::mnaParentPostStep(Real time, Int timeStepCount,
293 Attribute<Matrix>::Ptr &leftVector) {
294 mnaCompUpdateVoltage(**leftVector);
295 mnaCompUpdateCurrent(**leftVector);
296
297 mDeltaT = time - mPrevTimeStep;
298 mPrevTimeStep = time;
299 mValueChange = false;
300}
301
304 mNumFreqs, 0)
305 .real();
306 (**mIntfVoltage)(0, 0) =
308 if (!mUseSubcomponents) {
310 leftVector, virtualNode(0)->matrixNodeIndex());
312 leftVector, virtualNode(1)->matrixNodeIndex());
313 }
314}
315
317 if (!mUseSubcomponents) {
324 (**mIntfCurrent)(0, 0) =
326 return;
327 }
328 (**mIntfCurrent)(0, 0) = 0;
329 (**mIntfCurrent)(0, 0) += mSubInductor->intfCurrent()(0, 0);
330 (**mIntfCurrent)(0, 0) += mSubCapacitor->intfCurrent()(0, 0);
331}
332
334 // check states for violation of protection values
335 // get inverse protection curve value (time delay value)
336
337 Real Vpu = **mVmeasPrev / mNomVolt;
338 if (Vpu > 1.4) {
340 if (mProtCount1 > 0.1) {
341 mDisconnect = true;
342 }
343 } else {
344 mProtCount1 = 0;
345 }
346 if (Vpu > 1.25) {
348 if (mProtCount2 > 1) {
349 mDisconnect = true;
350 }
351 } else {
352 mProtCount2 = 0;
353 }
354 if (Vpu > 1.15) {
356 if (mProtCount3 > 5) {
357 mDisconnect = true;
358 }
359 } else {
360 mProtCount3 = 0;
361 }
362
363 if (mDisconnect) {
364 SPDLOG_LOGGER_INFO(mSLog, "Disconnect SVC because of overvoltage at {}",
365 time);
366 if (mUseSubcomponents) {
367 mSubCapacitorSwitch->open();
368 mSubInductorSwitch->open();
369 } else {
371 mDirectInductorClosed = false;
372 }
373 mValueChange = true;
374 }
375}
376
378 // calculate new B value
379 // summarize some constants
380 Real Fac1 = mDeltaT / (2 * mTr);
381 Real Fac2 = mDeltaT * mKr / (2 * mTr);
382
383 Real V = Math::abs((**mIntfVoltage)(0, 0).real());
384
385 // Pt1 with trapez rule for voltage measurement
386 Real Fac3 = mDeltaT / (2 * mTm);
387 Real Vmeas = (1 / (1 + Fac3)) * (V + mPrevVoltage - **mVmeasPrev);
388
389 **mDeltaV = (Vmeas - mRefVolt) / mNomVolt;
390 Real deltaVPrev = (**mVmeasPrev - mRefVolt) / mNomVolt;
391
392 // calc new B with trapezoidal rule
393 Real B = (1 / (1 + Fac1)) *
394 (Fac2 * (**mDeltaV + deltaVPrev) + (1 - Fac1) * **mBPrev);
395
396 // check bounds
397 if (B > mBMax) {
398 B = mBMax;
399 } else if (B < mBMin) {
400 B = mBMin;
401 }
402
403 // set new B if it has a new value and difference is big enough
404 if (B != **mBPrev) {
405 Real omega = 2 * M_PI * mFrequencies(0, 0);
406
407 if (B > 0) {
408 // model inductive behaviour (decrease voltage)
409 Real inductance = 1 / (omega * B * mBN);
410 //check if change in reactance is sufficient to trigger a change
411 if (Math::abs(1 - inductance / mLPrev) > 0.01) {
412 mInductiveMode = true;
414 mSubInductor->updateInductance(inductance, mDeltaT);
415 else
416 mDirectInductance = inductance;
417 mLPrev = inductance;
418
419 mValueChange = true;
420 mBSetCounter = 0;
421 }
422 } else {
423 // model capacitive behaviour (increase voltage)
424 Real capacitance = B * mBN / (-omega);
425 //check if change in reactance is sufficient to trigger a change
426 if (Math::abs(1 - capacitance / mCPrev) > 0.01) {
427 mInductiveMode = false;
429 mSubCapacitor->updateCapacitance(capacitance, mDeltaT);
430 else
431 mDirectCapacitance = capacitance;
432 mCPrev = capacitance;
433
434 mValueChange = true;
435 mBSetCounter = 0;
436 }
437 }
438
439 // update inductance model
441 } else {
443 }
444
445 // save values
446 **mBPrev = B;
447 mPrevVoltage = V;
448 **mVmeasPrev = Vmeas;
449}
450
451// model SVC with a mechanical component and discrete
453 // current voltage
454 Real V = Math::abs((**mIntfVoltage)(0, 0).real());
455 Real omega = 2 * M_PI * mFrequencies(0, 0);
456
457 // Pt1 with trapez rule for voltage measurement
458 Real Fac3 = mDeltaT / (2 * mTm);
459 Real Vmeas = (1 / (1 + Fac3)) * (V + mPrevVoltage - **mVmeasPrev);
460
461 // V diff in pu
462 Real deltaV = (mRefVolt - Vmeas) / mRefVolt;
463
464 if (Math::abs(deltaV) > mDeadband) {
466 // change suszeptance one step
467 if (deltaV > 0 && (mTapPos > mMinPos)) {
468 // undervoltage
469
470 mTapPos = mTapPos - 1;
472 **mViolationCounter = 0;
473 SPDLOG_LOGGER_INFO(mSLog,
474 "Time: {}"
475 "\nDecreasing Tap. Reason: Undervoltage"
476 "\nNew Tap Position: {}",
477 time, mTapPos);
478 } else if (deltaV < 0 && (mTapPos < mMaxPos)) {
479 // overvoltage
480 mTapPos = mTapPos + 1;
482 **mViolationCounter = 0;
483 SPDLOG_LOGGER_INFO(mSLog,
484 "Time: {}"
485 "\nIncreasing Tap. Reason: Overvoltag"
486 "\nNew Tap Position: {}",
487 time, mTapPos);
488 }
489
490 if (**mViolationCounter == 0) {
491 // new value for suszeptance
492 if (mTapPos > 0) {
493 // inductor is active
494 mInductiveMode = true;
495 Real inductance = 1 / ((mTapPos / mMaxPos) * mBN * omega);
496 SPDLOG_LOGGER_INFO(mSLog, "New inductance: {}", inductance);
498 mSubInductor->updateInductance(inductance, mDeltaT);
499 else
500 mDirectInductance = inductance;
501 mValueChange = true;
503 } else if (mTapPos < 0) {
504 // capacitor is active
505 mInductiveMode = false;
506 Real capacitance = ((mTapPos / mMinPos) * mBN) / omega;
507 SPDLOG_LOGGER_INFO(mSLog, "New capacitance: {}", capacitance);
509 mSubCapacitor->updateCapacitance(capacitance, mDeltaT);
510 else
511 mDirectCapacitance = capacitance;
512 mValueChange = true;
514
515 } else if (mTapPos = 0) {
516 // open both
517 SPDLOG_LOGGER_INFO(mSLog,
518 "Time: {}"
519 "Tap Position: 0. Open both elements",
520 time);
521 if (mUseSubcomponents) {
522 mSubInductorSwitch->open();
523 mSubCapacitorSwitch->open();
524 } else {
525 mDirectInductorClosed = false;
527 mValueChange = true;
528 }
529 }
530 }
531 } else {
532 // increase counter
534 }
535 } else {
536 // reset counter
537 **mViolationCounter = 0;
538 }
539
540 // save states
541 mPrevVoltage = V;
542 **mVmeasPrev = Vmeas;
543}
544
546 if (!mUseSubcomponents) {
547 const Bool newInductorClosed = mInductiveMode;
548 const Bool newCapacitorClosed = !mInductiveMode;
549 if (mDirectInductorClosed != newInductorClosed ||
550 mDirectCapacitorClosed != newCapacitorClosed)
551 mValueChange = true;
552 mDirectInductorClosed = newInductorClosed;
553 mDirectCapacitorClosed = newCapacitorClosed;
554 return;
555 }
556 // set switches according to current mode of svc
557 if (mInductiveMode) {
558 if (!mSubInductorSwitch->mnaIsClosed()) {
559 SPDLOG_LOGGER_INFO(mSLog, "Inductive Mode: Closed Inductor Switch");
560 mSubInductorSwitch->close();
561 }
562 if (mSubCapacitorSwitch->mnaIsClosed()) {
563 mSubCapacitorSwitch->open();
564 SPDLOG_LOGGER_INFO(mSLog, "Inductive Mode: Opened Capacitor Switch");
565 }
566 } else {
567 if (mSubInductorSwitch->mnaIsClosed()) {
568 mSubInductorSwitch->open();
569 SPDLOG_LOGGER_INFO(mSLog, "Capacitive Mode: Openend Inductor Switch");
570 }
571 if (!mSubCapacitorSwitch->mnaIsClosed()) {
572 mSubCapacitorSwitch->close();
573 SPDLOG_LOGGER_INFO(mSLog, "Capacitive Mode: Closed Capcitor Switch");
574 }
575 }
576}
std::vector< Ptr > List
Definition Attribute.h:123
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:249
Attribute< Real >::Ptr mDeltaV
Real mTr
Time Constant.
Attribute< Real >::Ptr mBPrev
Real mBMax
Maximium susceptance [p.u.].
Real mBN
rated B [S]
Attribute< Real >::Ptr mViolationCounter
Real mNomVolt
Nominal Voltage.
Real mBMin
Minimium susceptance [p.u.].
Real mRefVolt
Reference Voltage.
Real mQN
maximum Q
void addMNASubComponent(typename SimPowerComp< Complex >::Ptr subc, MNA_SUBCOMP_TASK_ORDER preStepOrder, MNA_SUBCOMP_TASK_ORDER postStepOrder, Bool contributeToRightVector)
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void initializeParentFromNodesAndTerminals(Real frequency) override
Initializes states from power flow data (parent-specific part).
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations (parent-specific)
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system results.
Bool mDirectCapacitorClosed
Definition DP_Ph1_SVC.h:67
MatrixComp mDirectInductorAdmittance
Definition DP_Ph1_SVC.h:71
const Attribute< Real >::Ptr mVpcc
Definition DP_Ph1_SVC.h:84
void createSubComponents() override
Constructs subcomponents; idempotent.
std::shared_ptr< DP::Ph1::Capacitor > mSubCapacitor
Internal capacitor.
Definition DP_Ph1_SVC.h:40
std::shared_ptr< DP::Ph1::Switch > mSubCapacitorSwitch
Definition DP_Ph1_SVC.h:41
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system results.
MatrixComp mDirectCapacitorCurrent
Definition DP_Ph1_SVC.h:78
MatrixComp mDirectCapacitorAdmittance
Definition DP_Ph1_SVC.h:76
const Attribute< Real >::Ptr mVmeasPrev
Definition DP_Ph1_SVC.h:85
Bool mDirectInductorClosed
Definition DP_Ph1_SVC.h:66
void updateDirectCompanions()
void mechanicalModelUpdateSusceptance(Real time)
void mnaParentInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
void mnaParentApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
MatrixComp mDirectInductorPrevCurrentFactor
Definition DP_Ph1_SVC.h:72
void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override
void checkProtection(Real time)
std::shared_ptr< DP::Ph1::Inductor > mSubInductor
Internal inductor.
Definition DP_Ph1_SVC.h:37
MatrixComp mDirectInductorCurrent
Definition DP_Ph1_SVC.h:73
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
add MNA post step dependencies (parent-specific)
MatrixComp mDirectCapacitorPrevVoltageFactor
Definition DP_Ph1_SVC.h:77
MatrixComp mDirectInductorHistory
Definition DP_Ph1_SVC.h:75
MatrixComp mDirectCapacitorVoltage
Definition DP_Ph1_SVC.h:79
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations (parent-specific)
MatrixComp mDirectInductorVoltage
Definition DP_Ph1_SVC.h:74
std::shared_ptr< DP::Ph1::Switch > mSubInductorSwitch
Definition DP_Ph1_SVC.h:38
SVC(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and log level.
MatrixComp mDirectCapacitorHistory
Definition DP_Ph1_SVC.h:80
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
add MNA pre step dependencies (parent-specific)
const Attribute< String >::Ptr mName
Human readable name.
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
Definition Logger.h:33
static String phasorToString(const Complex &num)
Definition Logger.cpp:57
Attribute< Matrix >::Ptr mRightVector
static void stampAdmittance(Complex admittance, SparseMatrixRow &mat, UInt node1Index, UInt node2Index, Bool isTerminal1NotGrounded, Bool isTerminal2NotGrounded, const Logger::Log &mSLog, Int maxFreq=1, Int freqIdx=0)
static Complex complexFromVectorElement(const Matrix &mat, Matrix::Index row, Int maxFreq=1, Int freqIdx=0)
static void setVectorElement(Matrix &mat, Matrix::Index row, Complex value, Int maxFreq=1, Int freqIdx=0, Matrix::Index colOffset=0)
static Real abs(Complex value)
Definition MathUtils.cpp:71
UInt matrixNodeIndex(UInt nodeIndex)
const Attribute< MatrixVar< Complex > >::Ptr mIntfCurrent
SimTerminal< Complex >::List mTerminals
const Attribute< MatrixVar< Complex > >::Ptr mIntfVoltage
SimNode< Complex >::Ptr virtualNode(UInt index)
SimNode< Complex >::List mVirtualNodes
Bool terminalNotGrounded(UInt index)
Complex initialSingleVoltage(UInt index)
Logger::Level mLogLevel
Component logger control for internal variables.
Logger::Log mSLog
Component logger.
#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:79
std::string String
Definition Definitions.h:63
double Real
Definition Definitions.h:60
int Int
Definition Definitions.h:59
std::complex< Real > Complex
Definition Definitions.h:61
bool Bool
Definition Definitions.h:62
unsigned int UInt
Definition Definitions.h:58
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).
Definition Definitions.h:72