|
Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
|
Implementation of Dynamic-phasor arithmetic and abc ↔ dqn domain conversions. More...

Functions | |
| MatrixXcd | dq_add (const MatrixXcd &a, const MatrixXcd &b) |
| Adds two complex matrices element-wise, handling different sizes. | |
| MatrixXcd | dq_subtract (const MatrixXcd &a, const MatrixXcd &b) |
| Subtracts one complex matrix from another element-wise, handling different sizes. | |
| MatrixXcd | dq_multiply (const MatrixXcd &x_coef1_in, const MatrixXcd &y_coef1_in) |
| Three-phase product of two dynamic-phasor series (harmonic convolution). | |
| MatrixXcd | dq_integrate (MatrixXcd &Zpnz_old, MatrixXcd &Xpnz_old, const MatrixXcd &Xpnz, double dt, double w) |
| Dynamic-phasor (DQ0) integrator per harmonic order. | |
| void | convertToPhasor (const MatrixXcd &A, const MatrixXcd &B, const MatrixXcd &C, const MatrixXcd &D, MatrixXcd &Adc, MatrixXcd &Bdc, MatrixXcd &Cdc, MatrixXcd &Ddc) |
| Convert state-space matrices into the phasor/DQ0 domain. | |
| MatrixXcd | truncateHarmonics (const MatrixXcd &X, int nColsToKeep) |
| Truncates harmonic columns beyond nKeep in a coefficient matrix. | |
| Vector3d | dqn2abc_at_time (const MatrixXcd &Xdcpnz_c, double theta) |
| Reconstruct abc instantaneous values from dynamic phasor pnz coefficients at one angle theta. | |
| std::vector< Vector3d > | dqn2abc_groups_at_time (const MatrixXcd &Y, double theta) |
| Convert all 3-row output groups of Y to abc at a single electrical angle. | |
| ABCResult | simulate_dqn2abc (const MatrixXcd &Xdcpnz_c, double freq_hz, double t0, double t1, double Ts) |
| Simulate abc waveform reconstruction over a time interval from dynamic phasor coefficients. | |
Implementation of Dynamic-phasor arithmetic and abc ↔ dqn domain conversions.
| void convertToPhasor | ( | const MatrixXcd & | A, |
| const MatrixXcd & | B, | ||
| const MatrixXcd & | C, | ||
| const MatrixXcd & | D, | ||
| MatrixXcd & | Adc, | ||
| MatrixXcd & | Bdc, | ||
| MatrixXcd & | Cdc, | ||
| MatrixXcd & | Ddc | ||
| ) |
Convert state-space matrices into the phasor/DQ0 domain.
Converts abc-stacked state-space matrices to phasor/sequence domain.
References j.
Referenced by DQsym::DSSS().
| MatrixXcd dq_add | ( | const MatrixXcd & | a, |
| const MatrixXcd & | b | ||
| ) |
Adds two complex matrices element-wise, handling different sizes.
Element-wise addition of two dynamic-phasor coefficient matrices.
This function computes the sum of two matrices, a and b. If the matrices have different dimensions, the result matrix is sized to encompass both, effectively zero-padding the smaller matrix before addition.
| a | The first matrix operand. |
| b | The second matrix operand. |
a and b. Referenced by example_DQsym_math_operations().
| MatrixXcd dq_integrate | ( | MatrixXcd & | Zpnz_old, |
| MatrixXcd & | Xpnz_old, | ||
| const MatrixXcd & | Xpnz, | ||
| double | dt, | ||
| double | w | ||
| ) |
Dynamic-phasor (DQ0) integrator per harmonic order.
Integrates a dynamic-phasor signal over one time step.
Referenced by example_DQsym_math_operations().
| MatrixXcd dq_multiply | ( | const MatrixXcd & | x_coef1_in, |
| const MatrixXcd & | y_coef1_in | ||
| ) |
Three-phase product of two dynamic-phasor series (harmonic convolution).
Multiplies two dynamic-phasor coefficient matrices (convolution in harmonic domain).
C++ translation aligned with MATLAB: Zdcpnz_c = SICO_DPs_3ph(x_coef1, y_coef1, N)
Input convention:
Output:
Referenced by example_DQsym_math_operations(), and MMC::simulateInputStep().
| MatrixXcd dq_subtract | ( | const MatrixXcd & | a, |
| const MatrixXcd & | b | ||
| ) |
Subtracts one complex matrix from another element-wise, handling different sizes.
Element-wise subtraction of two dynamic-phasor coefficient matrices.
This function computes the difference of two matrices, a - b. If the matrices have different dimensions, the result matrix is sized to encompass both, effectively zero-padding the smaller matrix before subtraction.
| a | The matrix to subtract from (minuend). |
| b | The matrix to subtract (subtrahend). |
a - b. Referenced by example_DQsym_math_operations().
| Vector3d dqn2abc_at_time | ( | const MatrixXcd & | Xdcpnz_c, |
| double | theta | ||
| ) |
Reconstruct abc instantaneous values from dynamic phasor pnz coefficients at one angle theta.
Reconstructs abc phase values from a 3×H dqn block at one angle.
Input format:
| Xdcpnz_c | 3 x Nh complex coefficient matrix |
| theta | electrical angle [rad] |
Referenced by dqn2abc_groups_at_time(), and simulate_dqn2abc().
| std::vector< Vector3d > dqn2abc_groups_at_time | ( | const MatrixXcd & | Y, |
| double | theta | ||
| ) |
Convert all 3-row output groups of Y to abc at a single electrical angle.
Reconstructs abc values for all 3-row output groups at one angle.
Y is expected to have rows grouped as:
Each 3-row group is interpreted as a 3xH dynamic-phasor sequence matrix and converted to one instantaneous abc vector at the supplied angle theta.
| Y | A matrix with row count equal to 3 * number_of_groups. |
| theta | Electrical angle [rad] at this one instant in time. |
References dqn2abc_at_time().
Referenced by example_DQsym_DSSS2(), example_DQsym_RLC(), and DQsym::run().
| ABCResult simulate_dqn2abc | ( | const MatrixXcd & | Xdcpnz_c, |
| double | freq_hz, | ||
| double | t0, | ||
| double | t1, | ||
| double | Ts | ||
| ) |
Simulate abc waveform reconstruction over a time interval from dynamic phasor coefficients.
Simulates abc waveform reconstruction over a time interval.
| Xdcpnz_c | 3 x Nh complex coefficient matrix |
| freq_hz | base electrical frequency [Hz] |
| t0 | start time [s] |
| t1 | end time [s] |
| Ts | sample time [s] |
References dqn2abc_at_time(), ABCResult::t, and ABCResult::Xabc.
Referenced by example_DQsym_math_operations().
| MatrixXcd truncateHarmonics | ( | const MatrixXcd & | X, |
| int | nColsToKeep | ||
| ) |
Truncates harmonic columns beyond nKeep in a coefficient matrix.
| X | Input coefficient matrix (3 rows × H columns). |
| nColsToKeep | Number of harmonic columns to retain. |
Referenced by MMC::simulateInputStep().