|
Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
|
Dynamic-phasor arithmetic and abc ↔ dqn domain conversions. More...
#include "../../Constants.h"

Go to the source code of this file.
Classes | |
| struct | ABCResult |
| Time-domain abc waveform reconstructed from dqn coefficients. More... | |
Functions | |
| MatrixXcd | dq_add (const MatrixXcd &a, const MatrixXcd &b) |
| Element-wise addition of two dynamic-phasor coefficient matrices. | |
| MatrixXcd | dq_subtract (const MatrixXcd &a, const MatrixXcd &b) |
| Element-wise subtraction of two dynamic-phasor coefficient matrices. | |
| MatrixXcd | dq_integrate (MatrixXcd &Zpnz_old, MatrixXcd &Xpnz_old, const MatrixXcd &Xpnz, double dt, double w) |
| Integrates a dynamic-phasor signal over one time step. | |
| MatrixXcd | dq_multiply (const MatrixXcd &x_coef1_in, const MatrixXcd &y_coef1_in) |
| Multiplies two dynamic-phasor coefficient matrices (convolution in harmonic domain). | |
| void | convertToPhasor (const MatrixXcd &A, const MatrixXcd &B, const MatrixXcd &C, const MatrixXcd &D, MatrixXcd &Adc, MatrixXcd &Bdc, MatrixXcd &Cdc, MatrixXcd &Ddc) |
| Converts abc-stacked state-space matrices to phasor/sequence 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) |
| Reconstructs abc phase values from a 3×H dqn block at one angle. | |
| std::vector< Vector3d > | dqn2abc_groups_at_time (const MatrixXcd &Y, double theta) |
| Reconstructs abc values for all 3-row output groups at one angle. | |
| ABCResult | simulate_dqn2abc (const MatrixXcd &Xdcpnz_c, double freq_hz, double t0, double t1, double Ts) |
| Simulates abc waveform reconstruction over a time interval. | |
Dynamic-phasor arithmetic and abc ↔ dqn domain conversions.
Provides element-wise phasor operations, harmonic truncation, and reconstruction of three-phase abc waveforms from dqn coefficient blocks used by the DQsym solver.
|
extern |
Converts abc-stacked state-space matrices to phasor/sequence domain.
| A | Continuous-time state matrix (abc layout). |
| B | Continuous-time input matrix (abc layout). |
| C | Continuous-time output matrix (abc layout). |
| D | Continuous-time feed-through matrix (abc layout). |
| Adc | Output: phasor-domain state matrix. |
| Bdc | Output: phasor-domain input matrix. |
| Cdc | Output: phasor-domain output matrix. |
| Ddc | Output: phasor-domain feed-through matrix. |
Converts abc-stacked state-space matrices to phasor/sequence domain.
References j.
Referenced by DQsym::DSSS().
|
extern |
Element-wise addition of two dynamic-phasor coefficient matrices.
| a | First operand. |
| b | Second operand. |
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().
|
extern |
Integrates a dynamic-phasor signal over one time step.
| Zpnz_old | Previous integrated state (updated in place). |
| Xpnz_old | Previous input sample (updated in place). |
| Xpnz | Current input sample. |
| dt | Time step (s). |
| w | Angular frequency (rad/s). |
Integrates a dynamic-phasor signal over one time step.
Referenced by example_DQsym_math_operations().
|
extern |
Multiplies two dynamic-phasor coefficient matrices (convolution in harmonic domain).
| x_coef1_in | First operand coefficients. |
| y_coef1_in | Second operand coefficients. |
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().
|
extern |
Element-wise subtraction of two dynamic-phasor coefficient matrices.
| a | Minuend. |
| b | Subtrahend. |
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().
|
extern |
Reconstructs abc phase values from a 3×H dqn block at one angle.
| Xdcpnz_c | dqn coefficient block (3 rows). |
| theta | Electrical angle (rad) at which to evaluate. |
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().
|
extern |
Reconstructs abc values for all 3-row output groups at one angle.
| Y | Output coefficient matrix with rows grouped in triplets. |
| theta | Electrical angle (rad) at which to evaluate. |
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().
|
extern |
Simulates abc waveform reconstruction over a time interval.
| Xdcpnz_c | dqn coefficient block (3 rows × H columns). |
| freq_hz | Fundamental frequency in Hz. |
| t0 | Start time (s). |
| t1 | End time (s). |
| Ts | Sample period (s). |
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().
|
extern |
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().