Class TSolutionObj
Unit
Declaration
type TSolutionObj = class(TObject)
Description
Hierarchy
- TObject
- TSolutionObj
Overview
Fields
Methods
constructor Create(dssContext: TDSSContext; const solutionname: String); |
|
destructor Destroy; OVERRIDE; |
|
function Converged: Boolean; |
|
procedure SetGeneratordQdV; |
|
function SolveZeroLoadSnapShot: Integer; |
|
procedure DoPFLOWsolution; |
|
procedure Solve; |
|
procedure SnapShotInit; |
|
function SolveSnap: Integer; |
|
function SolveDirect: Integer; |
|
function SolveYDirect: Integer; |
|
function SolveCircuit: Integer; |
|
procedure CheckControls; |
|
procedure SampleControlDevices; |
|
procedure DoControlActions; |
|
procedure Sample_DoControlActions; |
|
procedure Check_Fault_Status; |
|
procedure SetGeneratorDispRef; |
|
procedure SetVoltageBases; |
|
procedure SaveVoltages; |
|
procedure UpdateVBus; |
|
procedure RestoreNodeVfromVbus; |
|
function VDiff(i, j: Integer): Complex; |
|
procedure DumpProperties(F: TFileStream; Complete: Boolean; Leaf: Boolean = False); |
|
procedure WriteConvergenceReport(const Fname: String); |
|
procedure Update_dblHour; |
|
procedure Increment_time; |
|
procedure UpdateLoopTime; |
|
procedure AddInAuxCurrents(SolveType: Integer); |
|
function SolveSystem(V: pNodeVArray): Integer; |
|
procedure GetPCInjCurr; |
|
procedure GetSourceInjCurrents; |
|
procedure ZeroInjCurr; |
|
procedure Upload2IncMatrix; |
|
procedure Calc_Inc_Matrix; |
|
procedure Calc_Inc_Matrix_Org; |
|
function get_IncMatrix_Row(Col: Integer): Integer; |
|
function get_IncMatrix_Col(Row: Integer): Integer; |
|
function CheckLocationIdx(Idx: Integer): Integer; |
|
function get_PDE_Bus1_Location(myPDE: String): Integer; |
|
procedure AddLines2IncMatrix; |
|
procedure AddXfmr2IncMatrix; |
|
procedure AddSeriesCap2IncMatrix; |
|
procedure AddSeriesReac2IncMatrix; |
Properties
property Mode: TSolveMode READ dynavars.SolutionMode WRITE Set_Mode; |
|
property Frequency: Double READ FFrequency WRITE Set_Frequency; |
|
property Year: Integer READ FYear WRITE Set_Year; |
|
property Time_Solve: Double READ Solve_Time_Elapsed; |
|
property Time_TotalSolve: Double READ Total_Solve_Time_Elapsed; |
|
property Time_Step: Double READ Step_Time_Elapsed; |
|
property Total_Time: Double READ Total_Time_Elapsed WRITE Set_Total_Time; |
Description
Fields
DSS: TDSSContext; |
|
Algorithm: Integer; |
|
AuxCurrents: pComplexArray; |
|
NORMALSOLVE or NEWTONSOLVE |
ControlActionsDone: Boolean; |
|
For injections like AutoAdd |
ControlIteration: Integer; |
|
ControlMode: Integer; |
|
ConvergenceTolerance: Double; |
|
EVENTDRIVEN, TIMEDRIVEN |
ConvergedFlag: Boolean; |
|
DefaultControlMode: Integer; |
|
DefaultLoadModel: Integer; |
|
EVENTDRIVEN, TIMEDRIVEN |
DoAllHarmonics: Boolean; |
|
1=POWERFLOW 2=ADMITTANCE |
DynamicsAllowed: Boolean; |
|
DynaVars: TDynamicsRec; |
|
ErrorSaved: pDoubleArray; |
|
FrequencyChanged: Boolean; |
|
FirstIteration: Boolean; – unused |
Fyear: Integer; |
|
Flag set to true if something has altered the frequency |
Harmonic: Double; |
|
HarmonicList: pDoubleArray; |
|
HarmonicListSize: Integer; |
|
hYsystem: NativeUint; |
|
hYseries: NativeUint; |
|
Handle for main (system) Y matrix |
hY: NativeUint; |
|
Handle for series Y matrix |
IntervalHrs: Double; |
|
either hYsystem or hYseries |
IsDynamicModel: Boolean; |
|
Solution interval since last solution, hrs. |
IsHarmonicModel: Boolean; |
|
Iteration: Integer; |
|
LoadModel: Integer; |
|
LastSolutionWasDirect: Boolean; |
|
1=POWERFLOW 2=ADMITTANCE |
LoadsNeedUpdating: Boolean; |
|
MaxControlIterations: Integer; |
|
MaxError: Double; |
|
MaxIterations: Integer; |
|
MinIterations: Integer; |
|
MostIterationsDone: Integer; |
|
NodeVbase: pDoubleArray; |
|
NumberOfTimes: Integer; |
|
PreserveNodeVoltages: Boolean; |
|
Number of times to solve |
RandomType: Integer; |
|
SampleTheMeters: Boolean; |
|
0 = none; 1 = gaussian; 2 = UNIFORM |
SeriesYInvalid: Boolean; |
|
Flag to allow sampling of EnergyMeters |
SolutionCount: Integer; |
|
SolutionInitialized: Boolean; |
|
Counter incremented for each solution |
SystemYChanged: Boolean; |
|
UseAuxCurrents: Boolean; |
|
VmagSaved: pDoubleArray; |
|
VoltageBaseChanged: Boolean; |
|
ProgressCount: Integer; |
|
SolverOptions: Uint64; |
|
used in SolutionAlgs |
NodeV: pNodeVArray; |
|
KLUSolveX options Voltage and Current Arrays |
Currents: pNodeVArray; |
|
Main System Voltage Array allows NodeVˆ[0]=0 |
IncMat: Tsparse_matrix; |
|
Main System Currents Array ****************************************************************************** |
Laplacian: Tsparse_matrix; |
|
Incidence sparse matrix |
SolveStartTime: Int64; |
|
Laplacian sparse matrix ****************************Timing variables********************************** |
SolveEndtime: Int64; |
|
GStartTime: Int64; |
|
Gendtime: Int64; |
|
LoopEndtime: Int64; |
|
Total_Time_Elapsed: Double; |
|
Solve_Time_Elapsed: Double; |
|
Total_Solve_Time_Elapsed: Double; |
|
Step_Time_Elapsed: Double; |
|
ActiveIncCell: array[0..2] of Integer; |
|
****************************************************************************** ActiveCell of the Incidence Matrix: [0] = row [1] = col [2] = value |
Inc_Mat_Cols: array of String; |
|
Inc_Mat_levels: array of Integer; |
|
temp_counter: Integer; |
|
Active_Cols: array of Integer; |
|
Active_Cols_Idx: array of Integer; |
|
Methods
constructor Create(dssContext: TDSSContext; const solutionname: String); |
|
destructor Destroy; OVERRIDE; |
|
function Converged: Boolean; |
|
procedure SetGeneratordQdV; |
|
function SolveZeroLoadSnapShot: Integer; |
|
procedure DoPFLOWsolution; |
|
procedure Solve; |
|
procedure SnapShotInit; |
|
Main Solution dispatch |
function SolveSnap: Integer; |
|
function SolveDirect: Integer; |
|
solve for now once |
function SolveYDirect: Integer; |
|
solve for now once, direct solution |
function SolveCircuit: Integer; |
|
Similar to SolveDirect; used for initialization |
procedure CheckControls; |
|
SolveSnap sans control iteration |
procedure SampleControlDevices; |
|
Snapshot checks with matrix rebuild |
procedure DoControlActions; |
|
procedure Sample_DoControlActions; |
|
procedure Check_Fault_Status; |
|
Sample and Do |
procedure SetGeneratorDispRef; |
|
procedure SetVoltageBases; |
|
procedure SaveVoltages; |
|
procedure UpdateVBus; |
|
procedure RestoreNodeVfromVbus; |
|
updates voltages for each bus from NodeV |
function VDiff(i, j: Integer): Complex; |
|
opposite of updatebus |
procedure DumpProperties(F: TFileStream; Complete: Boolean; Leaf: Boolean = False); |
|
Difference between two node voltages |
procedure WriteConvergenceReport(const Fname: String); |
|
procedure Update_dblHour; |
|
procedure Increment_time; |
|
procedure UpdateLoopTime; |
|
procedure AddInAuxCurrents(SolveType: Integer); |
|
function SolveSystem(V: pNodeVArray): Integer; |
|
procedure GetPCInjCurr; |
|
procedure GetSourceInjCurrents; |
|
procedure ZeroInjCurr; |
|
procedure Upload2IncMatrix; |
|
procedure Calc_Inc_Matrix; |
|
procedure Calc_Inc_Matrix_Org; |
|
Calculates the incidence matrix for the Circuit |
function get_IncMatrix_Row(Col: Integer): Integer; |
|
Calculates the incidence matrix hierarchically organized for the Circuit |
function get_IncMatrix_Col(Row: Integer): Integer; |
|
Gets the index of the Row connected to the specified Column |
function CheckLocationIdx(Idx: Integer): Integer; |
|
Gets the index of the Column connected to the specified Row |
function get_PDE_Bus1_Location(myPDE: String): Integer; |
|
Evaluates the area covered by the tearing point to see if there is a better one |
procedure AddLines2IncMatrix; |
|
Gets the index of myPDE -> bus1 within the Inc matrix |
procedure AddXfmr2IncMatrix; |
|
Adds the Lines to the Incidence matrix arrays |
procedure AddSeriesCap2IncMatrix; |
|
Adds the Xfmrs to the Incidence matrix arrays |
procedure AddSeriesReac2IncMatrix; |
|
Adds capacitors in series to the Incidence matrix arrays |
Properties
property Mode: TSolveMode READ dynavars.SolutionMode WRITE Set_Mode; |
|
property Frequency: Double READ FFrequency WRITE Set_Frequency; |
|
property Year: Integer READ FYear WRITE Set_Year; |
|
property Time_Solve: Double READ Solve_Time_Elapsed; |
|
property Time_TotalSolve: Double READ Total_Solve_Time_Elapsed; |
|
property Time_Step: Double READ Step_Time_Elapsed; |
|
property Total_Time: Double READ Total_Time_Elapsed WRITE Set_Total_Time; |
|
Solve + sample |
Generated by PasDoc 0.16.0.