Class TSolutionObj

Unit

Declaration

type TSolutionObj = class(TObject)

Description

Hierarchy

Overview

Fields

Public DSS: TDSSContext;
Public Algorithm: Integer;
Public AuxCurrents: pComplexArray;
Public ControlActionsDone: Boolean;
Public ControlIteration: Integer;
Public ControlMode: Integer;
Public ConvergenceTolerance: Double;
Public ConvergedFlag: Boolean;
Public DefaultControlMode: Integer;
Public DefaultLoadModel: Integer;
Public DoAllHarmonics: Boolean;
Public DynamicsAllowed: Boolean;
Public DynaVars: TDynamicsRec;
Public ErrorSaved: pDoubleArray;
Public FrequencyChanged: Boolean;
Public Fyear: Integer;
Public Harmonic: Double;
Public HarmonicList: pDoubleArray;
Public HarmonicListSize: Integer;
Public hYsystem: NativeUint;
Public hYseries: NativeUint;
Public hY: NativeUint;
Public IntervalHrs: Double;
Public IsDynamicModel: Boolean;
Public IsHarmonicModel: Boolean;
Public Iteration: Integer;
Public LoadModel: Integer;
Public LastSolutionWasDirect: Boolean;
Public LoadsNeedUpdating: Boolean;
Public MaxControlIterations: Integer;
Public MaxError: Double;
Public MaxIterations: Integer;
Public MinIterations: Integer;
Public MostIterationsDone: Integer;
Public NodeVbase: pDoubleArray;
Public NumberOfTimes: Integer;
Public PreserveNodeVoltages: Boolean;
Public RandomType: Integer;
Public SampleTheMeters: Boolean;
Public SeriesYInvalid: Boolean;
Public SolutionCount: Integer;
Public SolutionInitialized: Boolean;
Public SystemYChanged: Boolean;
Public UseAuxCurrents: Boolean;
Public VmagSaved: pDoubleArray;
Public VoltageBaseChanged: Boolean;
Public ProgressCount: Integer;
Public SolverOptions: Uint64;
Public NodeV: pNodeVArray;
Public Currents: pNodeVArray;
Public IncMat: Tsparse_matrix;
Public Laplacian: Tsparse_matrix;
Public SolveStartTime: Int64;
Public SolveEndtime: Int64;
Public GStartTime: Int64;
Public Gendtime: Int64;
Public LoopEndtime: Int64;
Public Total_Time_Elapsed: Double;
Public Solve_Time_Elapsed: Double;
Public Total_Solve_Time_Elapsed: Double;
Public Step_Time_Elapsed: Double;
Public ActiveIncCell: array[0..2] of Integer;
Public Inc_Mat_Rows: array of String;
Public Inc_Mat_Cols: array of String;
Public Inc_Mat_levels: array of Integer;
Public temp_counter: Integer;
Public Active_Cols: array of Integer;
Public Active_Cols_Idx: array of Integer;

Methods

Public constructor Create(dssContext: TDSSContext; const solutionname: String);
Public destructor Destroy; OVERRIDE;
Public function Converged: Boolean;
Public procedure SetGeneratordQdV;
Public function SolveZeroLoadSnapShot: Integer;
Public procedure DoPFLOWsolution;
Public procedure Solve;
Public procedure SnapShotInit;
Public function SolveSnap: Integer;
Public function SolveDirect: Integer;
Public function SolveYDirect: Integer;
Public function SolveCircuit: Integer;
Public procedure CheckControls;
Public procedure SampleControlDevices;
Public procedure DoControlActions;
Public procedure Sample_DoControlActions;
Public procedure Check_Fault_Status;
Public procedure SetGeneratorDispRef;
Public procedure SetVoltageBases;
Public procedure SaveVoltages;
Public procedure UpdateVBus;
Public procedure RestoreNodeVfromVbus;
Public function VDiff(i, j: Integer): Complex;
Public procedure DumpProperties(F: TFileStream; Complete: Boolean; Leaf: Boolean = False);
Public procedure WriteConvergenceReport(const Fname: String);
Public procedure Update_dblHour;
Public procedure Increment_time;
Public procedure UpdateLoopTime;
Public procedure AddInAuxCurrents(SolveType: Integer);
Public function SolveSystem(V: pNodeVArray): Integer;
Public procedure GetPCInjCurr;
Public procedure GetSourceInjCurrents;
Public procedure ZeroInjCurr;
Public procedure Upload2IncMatrix;
Public procedure Calc_Inc_Matrix;
Public procedure Calc_Inc_Matrix_Org;
Public function get_IncMatrix_Row(Col: Integer): Integer;
Public function get_IncMatrix_Col(Row: Integer): Integer;
Public function CheckLocationIdx(Idx: Integer): Integer;
Public function get_PDE_Bus1_Location(myPDE: String): Integer;
Public procedure AddLines2IncMatrix;
Public procedure AddXfmr2IncMatrix;
Public procedure AddSeriesCap2IncMatrix;
Public procedure AddSeriesReac2IncMatrix;

Properties

Public property Mode: TSolveMode READ dynavars.SolutionMode WRITE Set_Mode;
Public property Frequency: Double READ FFrequency WRITE Set_Frequency;
Public property Year: Integer READ FYear WRITE Set_Year;
Public property Time_Solve: Double READ Solve_Time_Elapsed;
Public property Time_TotalSolve: Double READ Total_Solve_Time_Elapsed;
Public property Time_Step: Double READ Step_Time_Elapsed;
Public property Total_Time: Double READ Total_Time_Elapsed WRITE Set_Total_Time;

Description

Fields

Public DSS: TDSSContext;
 
Public Algorithm: Integer;
 
Public AuxCurrents: pComplexArray;

NORMALSOLVE or NEWTONSOLVE

Public ControlActionsDone: Boolean;

For injections like AutoAdd

Public ControlIteration: Integer;
 
Public ControlMode: Integer;
 
Public ConvergenceTolerance: Double;

EVENTDRIVEN, TIMEDRIVEN

Public ConvergedFlag: Boolean;
 
Public DefaultControlMode: Integer;
 
Public DefaultLoadModel: Integer;

EVENTDRIVEN, TIMEDRIVEN

Public DoAllHarmonics: Boolean;

1=POWERFLOW 2=ADMITTANCE

Public DynamicsAllowed: Boolean;
 
Public DynaVars: TDynamicsRec;
 
Public ErrorSaved: pDoubleArray;
 
Public FrequencyChanged: Boolean;

FirstIteration: Boolean; – unused

Public Fyear: Integer;

Flag set to true if something has altered the frequency

Public Harmonic: Double;
 
Public HarmonicList: pDoubleArray;
 
Public HarmonicListSize: Integer;
 
Public hYsystem: NativeUint;
 
Public hYseries: NativeUint;

Handle for main (system) Y matrix

Public hY: NativeUint;

Handle for series Y matrix

Public IntervalHrs: Double;

either hYsystem or hYseries

Public IsDynamicModel: Boolean;

Solution interval since last solution, hrs.

Public IsHarmonicModel: Boolean;
 
Public Iteration: Integer;
 
Public LoadModel: Integer;
 
Public LastSolutionWasDirect: Boolean;

1=POWERFLOW 2=ADMITTANCE

Public LoadsNeedUpdating: Boolean;
 
Public MaxControlIterations: Integer;
 
Public MaxError: Double;
 
Public MaxIterations: Integer;
 
Public MinIterations: Integer;
 
Public MostIterationsDone: Integer;
 
Public NodeVbase: pDoubleArray;
 
Public NumberOfTimes: Integer;
 
Public PreserveNodeVoltages: Boolean;

Number of times to solve

Public RandomType: Integer;
 
Public SampleTheMeters: Boolean;

0 = none; 1 = gaussian; 2 = UNIFORM

Public SeriesYInvalid: Boolean;

Flag to allow sampling of EnergyMeters

Public SolutionCount: Integer;
 
Public SolutionInitialized: Boolean;

Counter incremented for each solution

Public SystemYChanged: Boolean;
 
Public UseAuxCurrents: Boolean;
 
Public VmagSaved: pDoubleArray;
 
Public VoltageBaseChanged: Boolean;
 
Public ProgressCount: Integer;
 
Public SolverOptions: Uint64;

used in SolutionAlgs

Public NodeV: pNodeVArray;

KLUSolveX options Voltage and Current Arrays

Public Currents: pNodeVArray;

Main System Voltage Array allows NodeVˆ[0]=0

Public IncMat: Tsparse_matrix;

Main System Currents Array ******************************************************************************

Public Laplacian: Tsparse_matrix;

Incidence sparse matrix

Public SolveStartTime: Int64;

Laplacian sparse matrix ****************************Timing variables**********************************

Public SolveEndtime: Int64;
 
Public GStartTime: Int64;
 
Public Gendtime: Int64;
 
Public LoopEndtime: Int64;
 
Public Total_Time_Elapsed: Double;
 
Public Solve_Time_Elapsed: Double;
 
Public Total_Solve_Time_Elapsed: Double;
 
Public Step_Time_Elapsed: Double;
 
Public ActiveIncCell: array[0..2] of Integer;

****************************************************************************** ActiveCell of the Incidence Matrix: [0] = row [1] = col [2] = value

Public Inc_Mat_Rows: array of String;

****************************************************************************** IncMatrix Row and column descriptors Rows array (array of strings that tells what is the order of the PDElements) Columns array (array of strigns with the names of the cols of the Inc matrix)' Levels array (array of integers that describes the proximity level for each bus to the circuit's backbone)

Public Inc_Mat_Cols: array of String;
 
Public Inc_Mat_levels: array of Integer;
 
Public temp_counter: Integer;
 
Public Active_Cols: array of Integer;
 
Public Active_Cols_Idx: array of Integer;
 

Methods

Public constructor Create(dssContext: TDSSContext; const solutionname: String);
 
Public destructor Destroy; OVERRIDE;
 
Public function Converged: Boolean;
 
Public procedure SetGeneratordQdV;
 
Public function SolveZeroLoadSnapShot: Integer;
 
Public procedure DoPFLOWsolution;
 
Public procedure Solve;
 
Public procedure SnapShotInit;

Main Solution dispatch

Public function SolveSnap: Integer;
 
Public function SolveDirect: Integer;

solve for now once

Public function SolveYDirect: Integer;

solve for now once, direct solution

Public function SolveCircuit: Integer;

Similar to SolveDirect; used for initialization

Public procedure CheckControls;

SolveSnap sans control iteration

Public procedure SampleControlDevices;

Snapshot checks with matrix rebuild

Public procedure DoControlActions;
 
Public procedure Sample_DoControlActions;
 
Public procedure Check_Fault_Status;

Sample and Do

Public procedure SetGeneratorDispRef;
 
Public procedure SetVoltageBases;
 
Public procedure SaveVoltages;
 
Public procedure UpdateVBus;
 
Public procedure RestoreNodeVfromVbus;

updates voltages for each bus from NodeV

Public function VDiff(i, j: Integer): Complex;

opposite of updatebus

Public procedure DumpProperties(F: TFileStream; Complete: Boolean; Leaf: Boolean = False);

Difference between two node voltages

Public procedure WriteConvergenceReport(const Fname: String);
 
Public procedure Update_dblHour;
 
Public procedure Increment_time;
 
Public procedure UpdateLoopTime;
 
Public procedure AddInAuxCurrents(SolveType: Integer);
 
Public function SolveSystem(V: pNodeVArray): Integer;
 
Public procedure GetPCInjCurr;
 
Public procedure GetSourceInjCurrents;
 
Public procedure ZeroInjCurr;
 
Public procedure Upload2IncMatrix;
 
Public procedure Calc_Inc_Matrix;
 
Public procedure Calc_Inc_Matrix_Org;

Calculates the incidence matrix for the Circuit

Public function get_IncMatrix_Row(Col: Integer): Integer;

Calculates the incidence matrix hierarchically organized for the Circuit

Public function get_IncMatrix_Col(Row: Integer): Integer;

Gets the index of the Row connected to the specified Column

Public function CheckLocationIdx(Idx: Integer): Integer;

Gets the index of the Column connected to the specified Row

Public function get_PDE_Bus1_Location(myPDE: String): Integer;

Evaluates the area covered by the tearing point to see if there is a better one

Public procedure AddLines2IncMatrix;

Gets the index of myPDE -> bus1 within the Inc matrix

Public procedure AddXfmr2IncMatrix;

Adds the Lines to the Incidence matrix arrays

Public procedure AddSeriesCap2IncMatrix;

Adds the Xfmrs to the Incidence matrix arrays

Public procedure AddSeriesReac2IncMatrix;

Adds capacitors in series to the Incidence matrix arrays

Properties

Public property Mode: TSolveMode READ dynavars.SolutionMode WRITE Set_Mode;
 
Public property Frequency: Double READ FFrequency WRITE Set_Frequency;
 
Public property Year: Integer READ FYear WRITE Set_Year;
 
Public property Time_Solve: Double READ Solve_Time_Elapsed;
 
Public property Time_TotalSolve: Double READ Total_Solve_Time_Elapsed;
 
Public property Time_Step: Double READ Step_Time_Elapsed;
 
Public property Total_Time: Double READ Total_Time_Elapsed WRITE Set_Total_Time;

Solve + sample


Generated by PasDoc 0.16.0.