sogno-platform/dpsim

Refactor VBR models

Opened this issue · 0 comments

  • Reuse the order-specific auxiliar constants in the domain specific VBR models

    • Example 4th order:
    • Instantiate and calculate the order-specific auxiliar constants already in Base_ReducedOrderSynchronGenerator
    • Same goes for 3rd and 6th order
    • Stick for 3rd/4th order model to nomenclature for auxiliar constants introduced in 6th order model, i.e. use _t as subscript e.g. mAd_t
  • Specify and reuse the order-specific resistance matrix constants in the domain specific VBR models

    • Example 4th order
    • Instantiate and calculate the order-specific resistance matrix constants already in Base_ReducedOrderSynchronGenerator
    • Same goes for 3rd and 6th order
  • Remove Ef from auxiliar constants

  • Rename Cq to Dq

  • Reconsider zero component in EMT_Ph3 models

  • Use resistance matrix constants A and B in EMT_Ph3_SynchronGenerator4OrderVBR

  • Simplify the DP-DQ interface to obtain armature voltage (and armature current), which currently looks as follows

    // convert armature voltage into dq reference frame
    Matrix parkTransform = get_parkTransformMatrix();
    MatrixComp Vabc_ = mIntfVoltage(0, 0) * mShiftVector * Complex(cos(mNomOmega * mSimTime), sin(mNomOmega * mSimTime));
    Matrix Vabc = Matrix(3,1);
    Vabc << Vabc_(0,0).real(), Vabc_(1,0).real(), Vabc_(2,0).real();
    mVdq = parkTransform * Vabc / mBase_V_RMS;

    Instead of applying DP-EMT and EMT-DQ transformation, directly apply DP-DQ transformation, as e.g. done for the voltage behind the reactance
    mEvbr = (mKvbr * mEh_vbr * mBase_V_RMS)(0,0);

    using
    mKvbr = Matrix::Zero(1,2);
    mKvbr(0,0) = Complex(cos(mThetaMech - mBase_OmMech * mSimTime), sin(mThetaMech - mBase_OmMech * mSimTime));
    mKvbr(0,1) = -Complex(cos(mThetaMech - mBase_OmMech * mSimTime - PI/2.), sin(mThetaMech - mBase_OmMech * mSimTime - PI/2.));

  • Harmonize implementation of DQ-DP and DQ-SP interface implementation

    dqToComplexA <<
    cos(mThetaMech - mBase_OmMech * mSimTime), -sin(mThetaMech - mBase_OmMech * mSimTime),
    sin(mThetaMech - mBase_OmMech * mSimTime), cos(mThetaMech - mBase_OmMech * mSimTime);

  • Simplify definition of VBR resistance matrix in DP_Ph1 models according to equivalent derivation

    resistanceMatrix(0,0) = mR_const_1ph.real() + mKa_1ph.real() + mKb_1ph.real();
    resistanceMatrix(0,1) = -mR_const_1ph.imag() - mKa_1ph.imag() + mKb_1ph.imag();
    resistanceMatrix(1,0) = mR_const_1ph.imag() + mKa_1ph.imag() + mKb_1ph.imag();
    resistanceMatrix(1,1) = mR_const_1ph.real() + mKa_1ph.real() - mKb_1ph.real();

  • Rename DP_Ph1_SynchronGeneratorVBR and SP_Ph1_SynchronGeneratorVBR to be consistent with EMT_Ph3_ReducedOrderSynchronGeneratorVBR

  • Make SGModel of type String. Then you can use '6a' and '6b' instead of 6 and 7, which can become confusing in particular if we have models 6c, 6d etc. in the future

  • We can add another case distinction during calculation of constants in Base::ReducedOrderSynchronGenerator, since mAd_t and mBd_t are only used within the fourth-order model.

    mAd_t = mTimeStep * Zd_t / (2 * mTq0_t + mTimeStep);
    mBd_t = (2 * mTq0_t - mTimeStep) / (2 * mTq0_t + mTimeStep);