From 32d7485caa561430d8a630b34137d06df8907cee Mon Sep 17 00:00:00 2001 From: Luigi Vanfretti Date: Thu, 14 Mar 2024 18:55:59 -0400 Subject: [PATCH] Updated to support PFRecord propagation and uploading matlab scripts - Fixed propagation for sys model to properly pass the power flow data - Created additional initial guess cases for different dispatch scenarios - Added the matlab psat scripts to generate the power flow data --- Assets/PSAT_powerflow_scripts/d_kundur1.mdl | 3468 +++++++++++++++++ .../d_kundur1_mdl_case0.m | 65 + .../d_kundur1_mdl_case1.m | 65 + .../d_kundur1_mdl_case2.m | 65 + .../d_kundur1_mdl_case3.m | 65 + .../dexample2_pf_script_commandline_base.m | 69 + .../dexample2_pf_script_commandline_case1.m | 84 + .../dexample2_pf_script_commandline_case2.m | 84 + .../dexample2_pf_script_commandline_case3.m | 84 + .../dexample2_print_record_data.m | 86 + Example2/Base/Systems/PFVariants/syspf.mo | 8 +- Example2/PFData/Data/BusData/PF_Bus_0.mo | 2 +- Example2/PFData/Data/BusData/PF_Bus_1.mo | 2 +- Example2/PFData/Data/BusData/PF_Bus_2.mo | 27 + Example2/PFData/Data/BusData/PF_Bus_3.mo | 27 + Example2/PFData/Data/BusData/package.order | 2 + Example2/PFData/Data/LoadData/PF_Loads_0.mo | 2 +- Example2/PFData/Data/LoadData/PF_Loads_1.mo | 2 +- Example2/PFData/Data/LoadData/PF_Loads_2.mo | 9 + Example2/PFData/Data/LoadData/PF_Loads_3.mo | 9 + Example2/PFData/Data/LoadData/package.order | 2 + .../PFData/Data/MachineData/PF_Machines_0.mo | 2 +- .../PFData/Data/MachineData/PF_Machines_1.mo | 2 +- .../PFData/Data/MachineData/PF_Machines_2.mo | 13 + .../PFData/Data/MachineData/PF_Machines_3.mo | 13 + .../PFData/Data/MachineData/package.order | 2 + Example2/PFData/TestPF/Ramping_pf.mo | 84 + Example2/PFData/TestPF/package.mo | 4 + Example2/PFData/TestPF/package.order | 1 + Example2/PFData/package.order | 1 + Example2/package.mo | 4 +- 31 files changed, 4341 insertions(+), 12 deletions(-) create mode 100644 Assets/PSAT_powerflow_scripts/d_kundur1.mdl create mode 100644 Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case0.m create mode 100644 Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case1.m create mode 100644 Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case2.m create mode 100644 Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case3.m create mode 100644 Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_base.m create mode 100644 Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case1.m create mode 100644 Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case2.m create mode 100644 Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case3.m create mode 100644 Assets/PSAT_powerflow_scripts/dexample2_print_record_data.m create mode 100644 Example2/PFData/Data/BusData/PF_Bus_2.mo create mode 100644 Example2/PFData/Data/BusData/PF_Bus_3.mo create mode 100644 Example2/PFData/Data/LoadData/PF_Loads_2.mo create mode 100644 Example2/PFData/Data/LoadData/PF_Loads_3.mo create mode 100644 Example2/PFData/Data/MachineData/PF_Machines_2.mo create mode 100644 Example2/PFData/Data/MachineData/PF_Machines_3.mo create mode 100644 Example2/PFData/TestPF/Ramping_pf.mo create mode 100644 Example2/PFData/TestPF/package.mo create mode 100644 Example2/PFData/TestPF/package.order diff --git a/Assets/PSAT_powerflow_scripts/d_kundur1.mdl b/Assets/PSAT_powerflow_scripts/d_kundur1.mdl new file mode 100644 index 0000000..66ff8f2 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/d_kundur1.mdl @@ -0,0 +1,3468 @@ +# MathWorks OPC Text Package +Model { + Version 23.2 + Description "Simulink model saved in R2023b" +} +__MWOPC_PACKAGE_BEGIN__ R2023b +__MWOPC_PART_BEGIN__ /[Content_Types].xml + + + + + + + + + + + + + + + + + +__MWOPC_PART_BEGIN__ /_rels/.rels + + + + + + + + + + + + +__MWOPC_PART_BEGIN__ /metadata/coreProperties.xml + + + model + 2003-06-21T05:27:15Z + fmilano + luigi + 2024-03-13T19:47:11Z + 1.267 + R2023b + + +__MWOPC_PART_BEGIN__ /metadata/mwcoreProperties.xml + + + application/vnd.mathworks.simulink.model + Simulink Model + R2023b + + +__MWOPC_PART_BEGIN__ /metadata/mwcorePropertiesExtension.xml + + + 53232957-f1b9-4883-9a3c-cfebbc856fc5 + + +__MWOPC_PART_BEGIN__ /metadata/mwcorePropertiesReleaseInfo.xml + + + + 23.2.0.2485118 + R2023b + Update 6 + Dec 28 2023 + 2617075874 + + +__MWOPC_PART_BEGIN__ /simulink/_rels/blockdiagram.xml.rels + + + + + + + + + +__MWOPC_PART_BEGIN__ /simulink/_rels/configSetInfo.xml.rels + + + + + +__MWOPC_PART_BEGIN__ /simulink/bddefaults.xml + + + +

center

+

middle

+
+ + + + + + + +
+ +__MWOPC_PART_BEGIN__ /simulink/blockdiagram.xml + + + +

9ccf1347-1754-4bfc-aa73-3ad1182351b0

+

win64

+ +

%<Auto>

+

%<Auto>

+

1.%<AutoIncrement:267>

+
+ +

none

+
+ +

normal

+ +

$bdroot

+ + $bdroot + + + + +
+
+ +

off

+
+ +

warning

+
+ + +

Ensure deterministic transfer (maximum delay)

+

Ensure data integrity only

+

Ensure deterministic transfer (minimum delay)

+

None

+
+
+ +
+
+ +__MWOPC_PART_BEGIN__ /simulink/configSet0.xml + + + +

[]

+

+ + +

[]

+

+

[]

+

0.0

+

10.0

+

auto

+

on

+

auto

+

auto

+

5

+

auto

+

10*128*eps

+

1000

+

4

+

1

+

auto

+

auto

+

1

+

1e-3

+

on

+

off

+

off

+

ode45

+

auto

+

auto

+

DisableAll

+

UseLocalSettings

+

Nonadaptive

+

Auto

+

off

+

off

+

Fast

+

off

+

off

+

Unconstrained

+

Whenever possible

+

[]

+

off

+

off

+

ode3

+

off

+

2

+

10

+
+ +

[]

+

+

[]

+

1

+

[t, u]

+

xFinal

+

xInitial

+

on

+

1000

+

off

+

off

+

off

+

off

+

Array

+

ModelDataLogs

+

on

+

off

+

on

+

on

+

on

+

off

+

on

+

off

+

streamout

+

on

+

off

+

xout

+

tout

+

yout

+

logsout

+

dsmout

+

RefineOutputTimes

+

[]

+

out

+

1

+

off

+

timeseries

+

out.mat

+

[-inf, inf]

+
+ + + BooleansAsBitfields + PassReuseOutputArgsAs + PassReuseOutputArgsThreshold + ZeroExternalMemoryAtStartup + ZeroInternalMemoryAtStartup + OptimizeModelRefInitCode + NoFixptDivByZeroProtection + UseSpecifiedMinMax + EfficientTunableParamExpr + RemoveLocalVariableInitialization + +

+

[]

+

on

+

on

+

on

+

Tunable

+

off

+

off

+

off

+

off

+

double

+

off

+

off

+

on

+

on

+

on

+

off

+

off

+

on

+

off

+

+

on

+

off

+

uint_T

+

Same as modeled

+

on

+

64

+

Structure reference

+

12

+

128

+

on

+

5

+

off

+

off

+

Native Integer

+

on

+

on

+

on

+

off

+

off

+

on

+

auto

+

-1

+

Inherit from target

+

on

+

on

+

off

+

off

+

off

+

on

+

on

+

off

+

off

+

level2

+

Balanced

+

on

+

off

+

off

+

GradualUnderflow

+

off

+
+ + + UseOnlyExistingSharedCode + +

+

[]

+

error

+

none

+

none

+

none

+

error

+

none

+

UseLocalSettings

+

UseLocalSettings

+

UseLocalSettings

+

warning

+

warning

+

warning

+

none

+

on

+

Classic

+

none

+

off

+

TryResolveAllWithWarning

+

warning

+

warning

+

none

+

error

+

warning

+

warning

+

none

+

warning

+

warning

+

none

+

error

+

none

+

warning

+

none

+

warning

+

none

+

warning

+

warning

+

error

+

error

+

none

+

warning

+

warning

+

none

+

none

+

none

+

none

+

none

+

none

+

error

+

none

+

warning

+

warning

+

warning

+

error

+

none

+

error

+

none

+

warning

+

warning

+

UseLocalSettings

+

on

+

off

+

none

+

error

+

none

+

none

+

warning

+

warning

+

none

+

warning

+

error

+

none

+

warning

+

error

+

warning

+

error

+

none

+

warning

+

ErrorLevel1

+

WarnAndRepair

+

none

+

warning

+

warning

+

error

+

error

+

none

+

warning

+

error

+

warning

+

error

+

warning

+

warning

+

warning

+

warning

+

error

+

warning

+

warning

+

warning

+

warning

+

all

+

warning

+

on

+

warning

+

warning

+

off

+

+

none

+

off

+

error

+

none

+

warning

+

warning

+

UseLocalSettings

+
+ +

[]

+

+

[]

+

8

+

16

+

32

+

32

+

64

+

32

+

64

+

64

+

64

+

64

+

Char

+

Float

+

Zero

+

LittleEndian

+

64

+

on

+

off

+

Intel->x86-64 (Windows64)

+

8

+

16

+

32

+

32

+

64

+

32

+

64

+

32

+

32

+

32

+

Char

+

None

+

on

+

off

+

Undefined

+

Unspecified

+

32

+

32

+

32

+

Specified

+

on

+

on

+

on

+

on

+

EmbeddedCoderHSP

+
+ +

[]

+

+

[]

+

IfOutOfDateOrStructuralChange

+

off

+

error

+

off

+

on

+

None

+

Multi

+

Infer from blocks in model

+

+

on

+

off

+

off

+

off

+

off

+
+ +

[]

+

+

[]

+

+

+

+

+

[]

+

+

+

+

+

+

+

on

+

on

+

on

+

on

+

on

+

off

+

off

+

off

+

on

+

50

+

on

+

on

+

on

+

65536

+

off

+

[]

+

NotSpecified

+

FilterOut

+

off

+

None

+

+

generic

+

C

+

off

+

200

+

1024

+

off

+

+

+

mkl-dnn

+

on

+
+ + + DataTypeReplacement + IncludeHyperlinkInReport + GenerateTraceInfo + HalideCodeGeneration + GenerateTraceReport + GenerateTraceReportSl + GenerateTraceReportSf + GenerateTraceReportEml + PortableWordSizes + GenerateWebview + GenerateCodeMetricsReport + GenerateCodeReplacementReport + GenerateMissedCodeReplacementReport + GenerateErtSFunction + CreateSILPILBlock + CodeProfilingInstrumentation + CodeStackProfiling + EmbeddedCoderDictionary + +

Generic Real-Time Target

+

grt.tlc

+

+

None

+

off

+

off

+

+

off

+

make_rtw

+

on

+

off

+

+

grt_default_tmf

+

+

off

+

on

+

off

+

[]

+

off

+

off

+

off

+

off

+

off

+

on

+

off

+

+

+

+

+

+

+

+

+

+

+

+

Automatically locate an installed toolchain

+

Faster Builds

+

[]

+

off

+

off

+

off

+

None

+

off

+

executionProfile

+

SummaryOnly

+

off

+

off

+

stackProfile

+

off

+

CoderTypedefs

+

off

+

C

+

None

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

[]

+

+

Off

+

1024

+

+

-1

+

discrete

+

200

+

off

+

1024

+

on

+

on

+

on

+

off

+

3.5

+

+

+

0

+

none

+

on

+

20.02.1

+

unspecified

+

None

+ + + + IgnoreCustomStorageClasses + IgnoreTestpoints + BlockCommentType + InsertBlockDesc + InsertPolySpaceComments + SFDataObjDesc + MATLABFcnDesc + SimulinkDataObjDesc + DefineNamingRule + SignalNamingRule + ParamNamingRule + InternalIdentifier + InlinedPrmAccess + CustomSymbolStr + CustomSymbolStrGlobalVar + CustomSymbolStrType + CustomSymbolStrField + CustomSymbolStrFcn + CustomSymbolStrModelFcn + CustomSymbolStrFcnArg + CustomSymbolStrBlkIO + CustomSymbolStrTmpVar + CustomSymbolStrMacro + CustomSymbolStrUtil + CustomSymbolStrEmxType + CustomSymbolStrEmxFcn + CustomUserTokenString + ReqsInCode + +

+

[]

+

+

off

+

on

+

Auto

+

on

+

off

+

31

+

off

+

off

+

off

+

off

+

off

+

off

+

off

+

1

+

8

+

$R$N$M

+

$N$R$M_T

+

$N$M

+

$R$N$M$F

+

$R$N

+

rt$I$N$M

+

rtb_$N$M

+

$N$M

+

$R$N$M

+

$N$C

+

emxArray_$M$N

+

emx$M$N

+

+

+

None

+

+

None

+

+

None

+

+

off

+

off

+

on

+

BlockPathComment

+

off

+

off

+

off

+

+

Shortened

+

Literals

+

off

+

off

+

[]

+

error

+
+ + + IncludeMdlTerminateFcn + SuppressErrorStatus + ERTCustomFileBanners + GenerateSampleERTMain + ExistingSharedCode + GenerateTestInterfaces + ModelStepFunctionPrototypeControlCompliant + GenerateAllocFcn + PurelyIntegerCode + SupportComplex + SupportAbsoluteTime + SupportContinuousTime + SupportNonInlinedSFcns + ParenthesesLevel + ERTMultiwordTypeDef + MultiwordTypeDef + RemoveDisableFunc + RemoveResetFunc + PreserveStateflowLocalDataDimensions + +

+

[]

+

ansi_tfl_tmw.mat

+

+

+

NOT IN USE

+

C99 (ISO)

+

ANSI_C

+

Auto

+

System defined

+

2048

+

256

+

on

+

off

+

+

off

+

off

+

on

+

on

+

off

+

on

+

on

+

off

+

off

+

off

+

off

+

Auto

+

off

+

on

+

rt_

+

on

+

Nonreusable function

+

off

+

on

+

on

+

on

+

on

+

off

+

off

+

off

+

Nominal

+

Nominal

+

Simulink.SoftwareTarget.GRTCustomization

+

off

+

off

+

off

+

off

+

on

+

off

+

on

+

on

+

[]

+

[]

+

1,2,3,4,...

+

Size,Breakpoints,Table

+

Size,Breakpoints,Table

+

Column-major

+

error

+

$R$E

+

$R$E

+

$R_data

+ + None + +

off

+

off

+

off

+

off

+

off

+

on

+

10

+

1000000

+

0

+

ext_comm

+

+

Level1

+

off

+

off

+

off

+

off

+

off

+

Error

+
+
+
+ +

[]

+

Simulink Coverage Configuration Component

+

[]

+

Simulink Coverage

+

off

+

EntireSystem

+

on

+

off

+

/

+

covdata

+

+

dw

+

+

+

off

+

on

+

on

+

on

+

on

+

covCumulativeData

+

off

+

on

+

slcov_output/$ModelName$

+

$ModelName$_cvdata

+

on

+

off

+

+

on

+

on

+

1e-05

+

0.01

+

off

+

0

+

0

+

Masking

+

off

+
+
+

Configuration

+

Solver

+

[ 0, 0, 0, 0 ]

+

-aEnforceIntegerDowncast=1 -aGenerateReport=0 -aIncludeHyperlinkInReport=0 -aLaunchReport=0 -aGenerateTraceInfo=0 -aIgnoreTestpoints=0 -aGenerateTraceInfo=0 -aGenerateTraceInfo=0 -aGenerateTraceInfo=0 -aGenerateTraceInfo=0 -aPrefixModelToSubsysFcnNames=1

+
+
+ +__MWOPC_PART_BEGIN__ /simulink/configSetInfo.xml + + + Configuration + + +__MWOPC_PART_BEGIN__ /simulink/graphicalInterface.xml + + +

0

+

0

+

+

0

+

0

+

0

+

0

+

0

+

0

+

0

+

0

+

Unset

+

0

+

ode45

+

0

+

Simulink

+

0

+

14

+ +

fm_lib/Faults & +Breakers/Fault

+

$bdroot/Fault

+

12

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line1

+

29

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line2

+

30

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line4

+

32

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line5

+

33

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line6

+

34

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line7

+

35

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Line

+

$bdroot/Line9

+

36

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/PV

+

$bdroot/PV1

+

39

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/PV

+

$bdroot/PV2

+

40

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/PV

+

$bdroot/PV4

+

41

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Transf1

+

$bdroot/Trasf1

+

45

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Transf1

+

$bdroot/Trasf2

+

46

+

LIBRARY_BLOCK

+
+ +

fm_lib/Power Flow/Transf1

+

$bdroot/Trasf4

+

48

+

LIBRARY_BLOCK

+
+

1

+
+ +__MWOPC_PART_BEGIN__ /simulink/modelDictionary.xml + + + + + + +__MWOPC_PART_BEGIN__ /simulink/ScheduleCore.xml + + + + + + + + + + false + Default + -2147483648 + + + + +__MWOPC_PART_BEGIN__ /simulink/ScheduleEditor.xml + + + + + Default + graph.Graph + + + + HighNumberFirst + Default + + + + +__MWOPC_PART_BEGIN__ /simulink/systems/_rels/system_root.xml.rels + + + + + + + + +__MWOPC_PART_BEGIN__ /simulink/systems/system_13.xml + + +

[382, 121, 772, 497]

+ + +

[140, 89, 240, 131]

+

-1

+

off

+

psatdomain

+

p1

+

p1

+

__newr0

+
+ +

PMCPort

+

[280, 101, 310, 119]

+

-2

+

on

+

off

+

Right

+
+ +

1

+

14#rconn:1

+

15#rconn:1

+
+ +

Synchronous Machine

+

[164, 45, 264, 60]

+

[0, 0, 0, 0]

+

-1

+
+
+ +__MWOPC_PART_BEGIN__ /simulink/systems/system_17.xml + + +

[382, 121, 772, 497]

+ + +

[140, 89, 240, 131]

+

-1

+

off

+

psatdomain

+

p1

+

p1

+

__newr0

+
+ +

PMCPort

+

[280, 101, 310, 119]

+

-2

+

on

+

off

+

Right

+
+ +

1

+

18#rconn:1

+

19#rconn:1

+
+ +

Synchronous Machine

+

[164, 45, 264, 60]

+

[0, 0, 0, 0]

+

-1

+
+
+ +__MWOPC_PART_BEGIN__ /simulink/systems/system_21.xml + + +

[382, 121, 772, 497]

+ + +

[140, 89, 240, 131]

+

-1

+

off

+

psatdomain

+

p1

+

p1

+

__newr0

+
+ +

PMCPort

+

[280, 101, 310, 119]

+

-2

+

on

+

off

+

Right

+
+ +

1

+

22#rconn:1

+

23#rconn:1

+
+ +

Synchronous Machine

+

[164, 45, 264, 60]

+

[0, 0, 0, 0]

+

-1

+
+
+ +__MWOPC_PART_BEGIN__ /simulink/systems/system_25.xml + + +

[382, 121, 772, 497]

+ + +

[140, 89, 240, 131]

+

-1

+

off

+

psatdomain

+

p1

+

p1

+

__newr0

+
+ +

PMCPort

+

[280, 101, 310, 119]

+

-2

+

on

+

off

+

Right

+
+ +

1

+

26#rconn:1

+

27#rconn:1

+
+ +

Synchronous Machine

+

[164, 45, 264, 60]

+

[0, 0, 0, 0]

+

-1

+
+
+ +__MWOPC_PART_BEGIN__ /simulink/systems/system_root.xml + + +

[309, 308, 1303, 834]

+

on

+

80

+

simulink-default.rpt

+

49

+ +

PSATblock

+

Connection

+ +

[115, 63, 120, 152]

+

-1

+

black

+

top

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 2 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 20 + + + Voltage initial guess [p.u. rad] + [1.03 0.3229] + + + Area number + 1 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[190, 159, 195, 246]

+

-2

+

black

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 2 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 20 + + + Voltage initial guess [p.u. rad] + [1.01 0.1536] + + + Area number + 1 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[930, 64, 935, 151]

+

-3

+

on

+

blue

+

top

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 2 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 20 + + + Voltage initial guess [p.u. rad] + [1.03 -0.1187] + + + Area number + 2 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[870, 164, 875, 251]

+

-4

+

on

+

blue

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 2 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 20 + + + Voltage initial guess [p.u. rad] + [1.01 -0.295] + + + Area number + 2 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[200, 75, 205, 145]

+

-5

+

black

+

top

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 1 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [1.01 0.2112] + + + Area number + 1 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[285, 60, 290, 255]

+

-6

+

black

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 2 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [0.9876 0.03665] + + + Area number + 1 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[380, 83, 385, 237]

+

-7

+

black

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0|__newr1|__newr2|__newr3

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 1 + + + Number of outputs: + 4 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [1 -0.1065] + + + Area number + 1 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[487, 180, 563, 185]

+

-8

+

270

+

on

+

green

+

left

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1|__newl2|__newl3

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 4 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [1.0 -0.3368] + + + Area number + 3 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[660, 78, 665, 242]

+

-9

+

on

+

blue

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0|__newr1|__newr2|__newr3

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 1 + + + Number of outputs: + 4 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [0.9899 -0.555] + + + Area number + 2 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[760, 60, 765, 260]

+

-10

+

on

+

blue

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0|__newl1

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 2 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [0.9938 -0.4119] + + + Area number + 2 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Connection

+ +

[840, 75, 845, 145]

+

-11

+

on

+

blue

+

top

+

Courier New

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Bus + plot([0 1 1 0 0],[0 0 1 1 0]) + Bus block. + fm_inout + + + + Number of inputs: + 1 + + + Number of outputs: + 1 + + + Voltage Rating [kV] + 230 + + + Voltage initial guess [p.u. rad] + [1.013 -0.233900] + + + Area number + 2 + fm_block + + + Region number + 1 + + +
+ +

PSATblock

+

Faults & Breakers

+ +

[513, 205, 537, 245]

+

-12

+

270

+

on

+

right

+

off

+

1.1192

+

fm_lib/Faults & +Breakers/Fault

+

Fault

+ +

__newl0

+

[100 230 60]

+

1

+

1.050

+

0

+

1e-5

+
+
+ +

PSATblock

+

Machines

+ +

[895, 214, 930, 246]

+

-13

+

on

+

off

+

12

+ + Syn + plot(x+1.4,y,0.12*xs+1,0.15*ys-0.6) +color('blue') +plot(1.4+0.45*xg,0.3+0.45*yg) + + This block defines a fourth order synchronous machine. + fm_inout +[x,y] = fm_draw('circle'); +[xg,yg] = fm_draw('G'); +[xs,ys] = fm_draw('sinus'); + + + Power, voltage and frequency ratings [MVA, kV, Hz] + [900 20 60] + + + Machine Dynamic Order + 6 + fm_block + + + + + + + + + + + + + resistance ra and leakage reactance xl [p.u. p.u.] + [0.0025 0.2] + + + d-axis reactances Xd, X'd X"d [p.u.,p.u.,p.u.] + [1.80 0.30 0.25] + + + d-axis open circuit time constants T'd0 and T"d0 [s, s] + [8.00 0.03] + + + q-axis reactances Xq, X'q, X"q [p.u. p.u. p.u.] + [1.70 0.55 0.25] + + + q-axis open circuit time constants T'q0 and T"q0 [s s] + [0.4 0.05] + + + Inertia (M = 2H) and Damping [s, p.u.] + [12.35 0.00] + + + Speed and active power additional signals Kw and Kp [p.u., p.u.] + [0.00 0.00] + + + Percentage of active and reactive powers at bus [p.u. p.u.] + [1.00 1.00] + + + d-axis additional circuit leakage time constant Taa [s] + 0.0 + + + Saturation coefficients S(1.0) and S(1.2) + [0 0] + + + Number of input signals + 0 + + + + + + + + COI number + 1 + + + Connected + on + fm_block + + + +
+ +

PSATblock

+

Machines

+ +

[135, 209, 170, 241]

+

-14

+

off

+

12

+ + Syn + plot(x+1.4,y,0.12*xs+1,0.15*ys-0.6) +color('blue') +plot(1.4+0.45*xg,0.3+0.45*yg) + + This block defines a fourth order synchronous machine. + fm_inout +[x,y] = fm_draw('circle'); +[xg,yg] = fm_draw('G'); +[xs,ys] = fm_draw('sinus'); + + + Power, voltage and frequency ratings [MVA, kV, Hz] + [900 20 60] + + + Machine Dynamic Order + 6 + fm_block + + + + + + + + + + + + + resistance ra and leakage reactance xl [p.u. p.u.] + [0.0025 0.2] + + + d-axis reactances Xd, X'd X"d [p.u.,p.u.,p.u.] + [1.80 0.30 0.25] + + + d-axis open circuit time constants T'd0 and T"d0 [s, s] + [8.00 0.03] + + + q-axis reactances Xq, X'q, X"q [p.u. p.u. p.u.] + [1.70 0.55 0.25] + + + q-axis open circuit time constants T'q0 and T"q0 [s s] + [0.4 0.05] + + + Inertia (M = 2H) and Damping [s, p.u.] + [13.00 0.00] + + + Speed and active power additional signals Kw and Kp [p.u., p.u.] + [0.00 0.00] + + + Percentage of active and reactive powers at bus [p.u. p.u.] + [1.00 1.00] + + + d-axis additional circuit leakage time constant Taa [s] + 0.0 + + + Saturation coefficients S(1.0) and S(1.2) + [0 0] + + + Number of input signals + 0 + + + + + + + + COI number + 1 + + + Connected + on + fm_block + + + +
+ +

PSATblock

+

Machines

+ +

[60, 114, 95, 146]

+

-15

+

off

+

12

+ + Syn + plot(x+1.4,y,0.12*xs+1,0.15*ys-0.6) +color('blue') +plot(1.4+0.45*xg,0.3+0.45*yg) + + This block defines a fourth order synchronous machine. + fm_inout +[x,y] = fm_draw('circle'); +[xg,yg] = fm_draw('G'); +[xs,ys] = fm_draw('sinus'); + + + Power, voltage and frequency ratings [MVA, kV, Hz] + [900 20 60] + + + Machine Dynamic Order + 6 + fm_block + + + + + + + + + + + + + resistance ra and leakage reactance xl [p.u. p.u.] + [0.0025 0.2] + + + d-axis reactances Xd, X'd X"d [p.u.,p.u.,p.u.] + [1.80 0.30 0.25] + + + d-axis open circuit time constants T'd0 and T"d0 [s, s] + [8.00 0.03] + + + q-axis reactances Xq, X'q, X"q [p.u. p.u. p.u.] + [1.70 0.55 0.25] + + + q-axis open circuit time constants T'q0 and T"q0 [s s] + [0.4 0.05] + + + Inertia (M = 2H) and Damping [s, p.u.] + [13.00 0.00] + + + Speed and active power additional signals Kw and Kp [p.u., p.u.] + [0.00 0.00] + + + Percentage of active and reactive powers at bus [p.u. p.u.] + [1.00 1.00] + + + d-axis additional circuit leakage time constant Taa [s] + 0.002 + + + Saturation coefficients S(1.0) and S(1.2) + [0 0] + + + Number of input signals + 0 + + + + + + + + COI number + 1 + + + Connected + on + fm_block + + + +
+ +

PSATblock

+

Machines

+ +

[955, 114, 990, 146]

+

-16

+

on

+

off

+

12

+ + Syn + plot(x+1.4,y,0.12*xs+1,0.15*ys-0.6) +color('blue') +plot(1.4+0.45*xg,0.3+0.45*yg) + + This block defines a fourth order synchronous machine. + fm_inout +[x,y] = fm_draw('circle'); +[xg,yg] = fm_draw('G'); +[xs,ys] = fm_draw('sinus'); + + + Power, voltage and frequency ratings [MVA, kV, Hz] + [900 20 60] + + + Machine Dynamic Order + 6 + fm_block + + + + + + + + + + + + + resistance ra and leakage reactance xl [p.u. p.u.] + [0.0025 0.2] + + + d-axis reactances Xd, X'd X"d [p.u.,p.u.,p.u.] + [1.80 0.30 0.25] + + + d-axis open circuit time constants T'd0 and T"d0 [s, s] + [8.00 0.03] + + + q-axis reactances Xq, X'q, X"q [p.u. p.u. p.u.] + [1.70 0.55 0.25] + + + q-axis open circuit time constants T'q0 and T"q0 [s s] + [0.4 0.05] + + + Inertia (M = 2H) and Damping [s, p.u.] + [12.35 0.00] + + + Speed and active power additional signals Kw and Kp [p.u., p.u.] + [0.00 0.00] + + + Percentage of active and reactive powers at bus [p.u. p.u.] + [1.00 1.00] + + + d-axis additional circuit leakage time constant Taa [s] + 0.0 + + + Saturation coefficients S(1.0) and S(1.2) + [0 0] + + + Number of input signals + 0 + + + + + + + + COI number + 1 + + + Connected + on + fm_block + + + +
+ +

PSATblock

+

Power Flow

+ +

[220, 105, 260, 115]

+

-17

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*25 + + + Reactance [p.u. (H/km)] + 0.001*25 + + + Susceptance [p.u. (F/km)] + 0.00175*25 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[310, 155, 350, 165]

+

-18

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*10 + + + Reactance [p.u. (H/km)] + 0.001*10 + + + Susceptance [p.u. (F/km)] + 0.00175*10 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[425, 135, 465, 145]

+

-19

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*110 + + + Reactance [p.u. (H/km)] + 0.001*110 + + + Susceptance [p.u. (F/km)] + 0.00175*110 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[575, 95, 615, 105]

+

-20

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*110 + + + Reactance [p.u. (H/km)] + 0.001*110 + + + Susceptance [p.u. (F/km)] + 0.00175*110/2 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[575, 135, 615, 145]

+

-21

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*110 + + + Reactance [p.u. (H/km)] + 0.001*110 + + + Susceptance [p.u. (F/km)] + 0.00175*110 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[785, 105, 825, 115]

+

-22

+

on

+

top

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*25 + + + Reactance [p.u. (H/km)] + 0.001*25 + + + Susceptance [p.u. (F/km)] + 0.00175*25 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[690, 155, 730, 165]

+

-23

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*10 + + + Reactance [p.u. (H/km)] + 0.001*10 + + + Susceptance [p.u. (F/km)] + 0.00175*10 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[425, 95, 465, 105]

+

-24

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2]) +color('blue') +plot(0.35*xp,0.2*yp) + This block defines a pi model for a tree phase line. + [xp,yp] = fm_draw('pi'); + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [100 230 60] + + + Length of line [km] (0 for p.u. parameters) + 0 + + + Resistance [p.u. (Ohms/km)] + 0.0001*110 + + + Reactance [p.u. (H/km)] + 0.001*110 + + + Susceptance [p.u. (F/km)] + 0.00175*110/2 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[605, 165, 635, 195]

+

-25

+

on

+

top

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+ + PQ + plot([1 -0.5 -0.5 1],[0 0.866 -0.866 0]) + This block defines a constant power load: + +P = Pcost. +Q = Qcost. + + Power and Voltage Ratings [MVA, kV] + [100 230] + + + Active and Reactive Powers [p.u. p.u.] + [17.67 -2.5] + + + Maximum and Minimum Allowable Voltage [p.u. p.u.] + [1.05 0.95] + + + Allow conversion to impendance for min & max voltage + off + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[410, 165, 440, 195]

+

-26

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+ + PQ + plot([1 -0.5 -0.5 1],[0 0.866 -0.866 0]) + This block defines a constant power load: + +P = Pcost. +Q = Qcost. + + Power and Voltage Ratings [MVA, kV] + [100 230] + + + Active and Reactive Powers [p.u. p.u.] + [9.67 -1] + + + Maximum and Minimum Allowable Voltage [p.u. p.u.] + [1.05 0.95] + + + Allow conversion to impendance for min & max voltage + off + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[60, 68, 95, 102]

+

-27

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newr0

+ + PV + plot(x,y) +color('blue') +plot(0.3*xp-0.35,0.6*yp,[0.1 0.3 0.5],[0.3 -0.3 0.3]) + + This block defines a PV bus for load flow studies: + +P = Pcost. +V = Vdes. + [x,y] = fm_draw('circle'); +[xp,yp] = fm_draw('P'); + + Power and Voltage Ratings [MVA, kV] + [100 20] + + + Active Power [p.u.] + 7 + + + Voltage Magnitude [p.u.] + 1.03 + + + Qmax and Qmin [p.u. p.u.] + [5 -2] + + + Vmax and Vmin [p.u. p.u.] + [1.1 0.9] + + + Loss Participation Factor + 1 + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[130, 163, 165, 197]

+

-28

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newr0

+ + PV + plot(x,y) +color('blue') +plot(0.3*xp-0.35,0.6*yp,[0.1 0.3 0.5],[0.3 -0.3 0.3]) + + This block defines a PV bus for load flow studies: + +P = Pcost. +V = Vdes. + [x,y] = fm_draw('circle'); +[xp,yp] = fm_draw('P'); + + Power and Voltage Ratings [MVA, kV] + [100 20] + + + Active Power [p.u.] + 7 + + + Voltage Magnitude [p.u.] + 1.01 + + + Qmax and Qmin [p.u. p.u.] + [5 -2] + + + Vmax and Vmin [p.u. p.u.] + [1.1 0.9] + + + Loss Participation Factor + 1 + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[895, 168, 930, 202]

+

-29

+

on

+

top

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newr0

+ + PV + plot(x,y) +color('blue') +plot(0.3*xp-0.35,0.6*yp,[0.1 0.3 0.5],[0.3 -0.3 0.3]) + + This block defines a PV bus for load flow studies: + +P = Pcost. +V = Vdes. + [x,y] = fm_draw('circle'); +[xp,yp] = fm_draw('P'); + + Power and Voltage Ratings [MVA, kV] + [100 20] + + + Active Power [p.u.] + 7 + + + Voltage Magnitude [p.u.] + 1.01 + + + Qmax and Qmin [p.u. p.u.] + [5 -2] + + + Vmax and Vmin [p.u. p.u.] + [1.1 0.9] + + + Loss Participation Factor + 1 + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Loads

+ +

[410, 206, 440, 234]

+

-30

+

off

+

psatdomain

+

p1

+

p1

+

__newl0

+ + Pl + plot([-1 -1 1 1 -1],[-1 1 1 -1 -1]) +color('blue') +plot([0 0],[-0.3 0.3],[-0.3 -0.7 -0.3 -0.7],[-0.3 -0.3 0.3 0.3]) +plot([0.3 0.3 0.6 0.7 0.7 0.6 0.3],[-0.3 0.3 0.3 0.2 0.1 0 0]) + This block defines a ZIP load. + + Power, voltage and frequency ratings [MVA, kV, Hz] + [100 230 60] + + + Percentage of resistance, active current and active power [%, %, %] + [0 100 0] + + + Percentage of reactance, reactive current and reactive power [%, %, %] + [0 0 100] + + + Initialize after power flow + on + fm_block + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Loads

+ +

[605, 206, 635, 234]

+

-31

+

on

+

off

+

psatdomain

+

p1

+

p1

+

__newl0

+ + Pl + plot([-1 -1 1 1 -1],[-1 1 1 -1 -1]) +color('blue') +plot([0 0],[-0.3 0.3],[-0.3 -0.7 -0.3 -0.7],[-0.3 -0.3 0.3 0.3]) +plot([0.3 0.3 0.6 0.7 0.7 0.6 0.3],[-0.3 0.3 0.3 0.2 0.1 0 0]) + This block defines a ZIP load. + + Power, voltage and frequency ratings [MVA, kV, Hz] + [100 230 60] + + + Percentage of resistance, active current and active power [%, %, %] + [0 100 0] + + + Percentage of reactance, reactive current and reactive power [%, %, %] + [0 0 100] + + + Initialize after power flow + on + fm_block + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[965, 68, 995, 102]

+

-32

+

on

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newr0

+ + SW + plot([0 1 1 0 0],[0 0 1 1 0]), color('blue'), plot([0 1],[0 1],[0 1],[1 0],[0.5 1 0.5 0 0.5],[0 0.5 1 0.5 0]) + This block defines a V-theta bus: + +V = V_des +theta = theta_des + [x,y] = fm_draw('circle'); +[xt,yt] = fm_draw('theta'); + + + Power and Voltage Ratings [MVA, kV] + [100 20] + + + Voltage Magnitude [p.u.] + 1.03 + + + Reference Phase Angle [rad] + - 0.118682389135614 + + + Qmax and Qmin [p.u. p.u.] + [99 -99] + + + Vmax and Vmin [p.u. p.u.] + [1.1 0.9] + + + Active Power Guess [p.u.] + 7 + + + Loss Participation Factor + 1 + + + Reference bus + on + fm_block + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[140, 97, 180, 123]

+

-33

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0]) +color('green') +plot(-0.1+0.65*x1,0.65*y1) +plot(1.5+0.65*x2,0.65*y2) + This block defines a transformer. + [x,y] = fm_draw('circle'); +[x1,y1] = fm_draw('1'); +[x2,y2] = fm_draw('2'); + + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [900 20 60] + + + Primary and secondary voltage ratio [kV/kV] + 20/230 + + + Resistance [p.u.] + 0.0 + + + Reactance [p.u.] + 0.15 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[225, 192, 265, 218]

+

-34

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0]) +color('green') +plot(-0.1+0.65*x1,0.65*y1) +plot(1.5+0.65*x2,0.65*y2) + This block defines a transformer. + [x,y] = fm_draw('circle'); +[x1,y1] = fm_draw('1'); +[x2,y2] = fm_draw('2'); + + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [900 20 60] + + + Primary and secondary voltage ratio [kV/kV] + 20/230 + + + Resistance [p.u.] + 0.0 + + + Reactance [p.u.] + 0.15 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[790, 198, 830, 222]

+

-35

+

on

+

top

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0]) +color('green') +plot(-0.1+0.65*x1,0.65*y1) +plot(1.5+0.65*x2,0.65*y2) + This block defines a transformer. + [x,y] = fm_draw('circle'); +[x1,y1] = fm_draw('1'); +[x2,y2] = fm_draw('2'); + + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [900 20 60] + + + Primary and secondary voltage ratio [kV/kV] + 20/230 + + + Resistance [p.u.] + 0.0 + + + Reactance [p.u.] + 0.15 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

PSATblock

+

Power Flow

+ +

[865, 98, 905, 122]

+

-36

+

on

+

top

+

off

+

Courier

+

14

+

psatdomain

+

p1

+

p1

+

__newl0

+

__newr0

+ + Line + plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0]) +color('green') +plot(-0.1+0.65*x1,0.65*y1) +plot(1.5+0.65*x2,0.65*y2) + This block defines a transformer. + [x,y] = fm_draw('circle'); +[x1,y1] = fm_draw('1'); +[x2,y2] = fm_draw('2'); + + + Power, Voltage and Frequency Ratings [MVA, kV, Hz] + [900 20 60] + + + Primary and secondary voltage ratio [kV/kV] + 20/230 + + + Resistance [p.u.] + 0.0 + + + Reactance [p.u.] + 0.15 + + + Imax, Pmax and Smax [p.u., p.u., p.u.] + [1.0 0.0 0.0] + + + Connected + on + fm_block + + +
+ +

1

+

31#rconn:1

+

[15, 0]

+

8#lconn:1

+
+ +

2

+

36#rconn:1

+

[35, 0]

+

8#lconn:2

+
+ +

3

+

9#rconn:4

+

43#lconn:1

+
+ +

4

+

7#rconn:4

+

42#lconn:1

+
+ +

5

+

33#lconn:1

+

[-5, 0]

+

8#lconn:4

+
+ +

6

+

32#lconn:1

+

[-25, 0]

+

8#lconn:3

+
+ +

7

+

30#rconn:1

+

7#lconn:1

+
+ +

8

+

7#rconn:3

+

38#lconn:1

+
+ +

9

+

9#rconn:3

+

37#lconn:1

+
+ +

10

+

9#rconn:2

+

33#rconn:1

+
+ +

11

+

9#rconn:1

+

32#rconn:1

+
+ +

12

+

35#lconn:1

+

9#lconn:1

+
+ +

13

+

10#rconn:1

+

35#rconn:1

+
+ +

14

+

47#rconn:1

+

10#lconn:2

+
+ +

15

+

34#rconn:1

+

10#lconn:1

+
+ +

16

+

4#rconn:1

+

47#lconn:1

+
+ +

17

+

13#rconn:1

+

4#lconn:2

+
+ +

18

+

41#rconn:1

+

4#lconn:1

+
+ +

19

+

11#rconn:1

+

34#lconn:1

+
+ +

20

+

48#rconn:1

+

11#lconn:1

+
+ +

21

+

3#rconn:1

+

48#lconn:1

+
+ +

22

+

25#rconn:1

+

3#lconn:2

+
+ +

23

+

44#rconn:1

+

3#lconn:1

+
+ +

24

+

6#rconn:1

+

30#lconn:1

+
+ +

25

+

46#rconn:1

+

6#lconn:2

+
+ +

26

+

2#rconn:1

+

46#lconn:1

+
+ +

27

+

17#rconn:1

+

2#lconn:2

+
+ +

28

+

40#rconn:1

+

2#lconn:1

+
+ +

29

+

29#rconn:1

+

6#lconn:1

+
+ +

30

+

7#rconn:2

+

31#lconn:1

+
+ +

31

+

7#rconn:1

+

36#lconn:1

+
+ +

32

+

5#rconn:1

+

29#lconn:1

+
+ +

33

+

1#rconn:1

+

45#lconn:1

+
+ +

34

+

45#rconn:1

+

5#lconn:1

+
+ +

35

+

21#rconn:1

+

1#lconn:2

+
+ +

36

+

39#rconn:1

+

1#lconn:1

+
+ +

37

+

8#rconn:1

+

12#lconn:1

+
+ +

Two-Area System +Prabha Kundur, "Power System Stability and Control", Example 12.6, page 813

+

[541, 330, 1139, 370]

+

[0, 0, 0, 0]

+

-1

+

16

+

bold

+
+
+ +__MWOPC_PART_BEGIN__ /simulink/windowsInfo.xml + + + + +

1

+

[309.0, 308.0, 994.0, 526.0]

+ +

0

+

Left

+

50

+

50

+

8

+

Unset

+
+ +

1

+
+ +

1

+

1

+

SimulinkTopLevel

+

0

+

[1433.0, 451.0]

+

0.8

+

[-22.155694054307105, 12.938202247191043]

+

[-22.155694054307105, 12.938202247191043, 1194.1666666666665, 375.83333333333326]

+
+ + +

GLUE2:PropertyInspector

+

Property Inspector

+

0

+

+

+

0

+

Right

+

426

+

320

+

Unset

+
+ +

Simulink:Editor:ReferencedFiles

+

Referenced Files

+

0

+

+

{"filterShowRefModels":"true","filterShowRefSubs":"true","filterShowOnlyDirtyFiles":"false"} +

+

0

+

Left

+

426

+

320

+

Unset

+
+
+

AAAA/wAAAAD9AAAAAwAAAAAAAAC9AAAB+PwCAAAABPsAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAAAAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQAAAAAAP////8AAACTAP////sAAABgAFMAaQBtAHUAbABpAG4AawA6AEUAZABpAHQAbwByADoAUgBlAGYAZQByAGUAbgBjAGUAZABGAGkAbABlAHMALwBSAGUAZgBlAHIAZQBuAGMAZQBkACAARgBpAGwAZQBzAAAAAAD/////AAAAxwD///8AAAABAAAAAAAAAAD8AgAAAAH7AAAAVABHAEwAVQBFADIAOgBQAHIAbwBwAGUAcgB0AHkASQBuAHMAcABlAGMAdABvAHIALwBQAHIAbwBwAGUAcgB0AHkAIABJAG4AcwBwAGUAYwB0AG8AcgAAAAAA/////wAAAoAA////AAAAAwAAAAAAAAAA/AEAAAAB+/////8AAAAAAP////8AAAIDAP///wAABdEAAAIRAAAAAQAAAAIAAAABAAAAAvwAAAAA

+ +

f238f7ec-0e19-4953-af5b-109d7203f7b7

+
+

+

+
+ +__MWOPC_PACKAGE_END__ diff --git a/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case0.m b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case0.m new file mode 100644 index 0000000..1a584a2 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case0.m @@ -0,0 +1,65 @@ +Bus.con = [ ... + 1 20 1.03 0.3229 1 1; + 2 20 1.01 0.1536 1 1; + 3 20 1.03 -0.1187 2 1; + 4 20 1.01 -0.295 2 1; + 5 230 1.01 0.2112 1 1; + 6 230 0.9876 0.03665 1 1; + 7 230 1 -0.1065 1 1; + 8 230 1 -0.3368 3 1; + 9 230 0.9899 -0.555 2 1; + 10 230 0.9938 -0.4119 2 1; + 11 230 1.013 -0.2339 2 1; + ]; + +Line.con = [ ... + 5 6 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 6 7 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 11 10 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 9 10 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 1 5 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 2 6 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 4 10 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 3 11 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + ]; + +Fault.con = [ ... + 8 100 230 60 1 1.05 0 1e-05; + ]; + +SW.con = [ ... + 3 100 20 1.03 -0.1186824 99 -99 1.1 0.9 7 1 1 1; + ]; + +PV.con = [ ... + 1 100 20 7 1.03 5 -2 1.1 0.9 1 1; + 2 100 20 7 1.01 5 -2 1.1 0.9 1 1; + 4 100 20 7 1.01 5 -2 1.1 0.9 1 1; + ]; + +PQ.con = [ ... + 9 100 230 17.67 -2.5 1.05 0.95 0; + 7 100 230 9.67 -1 1.05 0.95 0; + ]; + +Pl.con = [ ... + 7 100 230 60 0 100 0 0 0 100 1 1; + 9 100 230 60 0 100 0 0 0 100 1 1; + ]; + +Syn.con = [ ... + 4 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + 2 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0 0 0 1 1; + 1 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0.002 0 0 1 1; + 3 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + ]; + +Bus.names = {... + 'Bus 01'; 'Bus 02'; 'Bus 03'; 'Bus 04'; 'Bus 05'; + 'Bus 06'; 'Bus 07'; 'Bus 08'; 'Bus 09'; 'Bus 10'; + 'Bus 11'}; + diff --git a/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case1.m b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case1.m new file mode 100644 index 0000000..449d308 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case1.m @@ -0,0 +1,65 @@ +Bus.con = [ ... + 1 20 1.03 0.3229 1 1; + 2 20 1.01 0.1536 1 1; + 3 20 1.03 -0.1187 2 1; + 4 20 1.01 -0.295 2 1; + 5 230 1.01 0.2112 1 1; + 6 230 0.9876 0.03665 1 1; + 7 230 1 -0.1065 1 1; + 8 230 1 -0.3368 3 1; + 9 230 0.9899 -0.555 2 1; + 10 230 0.9938 -0.4119 2 1; + 11 230 1.013 -0.2339 2 1; + ]; + +Line.con = [ ... + 5 6 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 6 7 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 11 10 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 9 10 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 1 5 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 2 6 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 4 10 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 3 11 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + ]; + +Fault.con = [ ... + 8 100 230 60 1 1.05 0 1e-05; + ]; + +SW.con = [ ... + 3 100 20 1.03 -0.1186824 99 -99 1.1 0.9 7 1 1 1; + ]; + +PV.con = [ ... + 1 100 20 5 1.03 5 -2 1.1 0.9 1 1; + 2 100 20 5 1.01 5 -2 1.1 0.9 1 1; + 4 100 20 5 1.01 5 -2 1.1 0.9 1 1; + ]; + +PQ.con = [ ... + 9 100 230 10.00 0.0 1.05 0.95 0; + 7 100 230 5.00 0.0 1.05 0.95 0; + ]; + +Pl.con = [ ... + 7 100 230 60 0 100 0 0 0 100 1 1; + 9 100 230 60 0 100 0 0 0 100 1 1; + ]; + +Syn.con = [ ... + 4 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + 2 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0 0 0 1 1; + 1 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0.002 0 0 1 1; + 3 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + ]; + +Bus.names = {... + 'Bus 01'; 'Bus 02'; 'Bus 03'; 'Bus 04'; 'Bus 05'; + 'Bus 06'; 'Bus 07'; 'Bus 08'; 'Bus 09'; 'Bus 10'; + 'Bus 11'}; + diff --git a/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case2.m b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case2.m new file mode 100644 index 0000000..01d0cdb --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case2.m @@ -0,0 +1,65 @@ +Bus.con = [ ... + 1 20 1.03 0.3229 1 1; + 2 20 1.01 0.1536 1 1; + 3 20 1.03 -0.1187 2 1; + 4 20 1.01 -0.295 2 1; + 5 230 1.01 0.2112 1 1; + 6 230 0.9876 0.03665 1 1; + 7 230 1 -0.1065 1 1; + 8 230 1 -0.3368 3 1; + 9 230 0.9899 -0.555 2 1; + 10 230 0.9938 -0.4119 2 1; + 11 230 1.013 -0.2339 2 1; + ]; + +Line.con = [ ... + 5 6 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 6 7 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 11 10 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 9 10 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 1 5 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 2 6 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 4 10 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 3 11 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + ]; + +Fault.con = [ ... + 8 100 230 60 1 1.05 0 1e-05; + ]; + +SW.con = [ ... + 3 100 20 1.03 -0.1186824 99 -99 1.1 0.9 7 1 1 1; + ]; + +PV.con = [ ... + 1 100 20 2.5 1.03 5 -2 1.1 0.9 1 1; + 2 100 20 2.5 1.01 5 -2 1.1 0.9 1 1; + 4 100 20 2.5 1.01 5 -2 1.1 0.9 1 1; + ]; + +PQ.con = [ ... + 9 100 230 5.00 0.0 1.05 0.95 0; + 7 100 230 2.50 0.0 1.05 0.95 0; + ]; + +Pl.con = [ ... + 7 100 230 60 0 100 0 0 0 100 1 1; + 9 100 230 60 0 100 0 0 0 100 1 1; + ]; + +Syn.con = [ ... + 4 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + 2 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0 0 0 1 1; + 1 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0.002 0 0 1 1; + 3 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + ]; + +Bus.names = {... + 'Bus 01'; 'Bus 02'; 'Bus 03'; 'Bus 04'; 'Bus 05'; + 'Bus 06'; 'Bus 07'; 'Bus 08'; 'Bus 09'; 'Bus 10'; + 'Bus 11'}; + diff --git a/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case3.m b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case3.m new file mode 100644 index 0000000..78313fa --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/d_kundur1_mdl_case3.m @@ -0,0 +1,65 @@ +Bus.con = [ ... + 1 20 1.03 0.3229 1 1; + 2 20 1.01 0.1536 1 1; + 3 20 1.03 -0.1187 2 1; + 4 20 1.01 -0.295 2 1; + 5 230 1.01 0.2112 1 1; + 6 230 0.9876 0.03665 1 1; + 7 230 1 -0.1065 1 1; + 8 230 1 -0.3368 3 1; + 9 230 0.9899 -0.555 2 1; + 10 230 0.9938 -0.4119 2 1; + 11 230 1.013 -0.2339 2 1; + ]; + +Line.con = [ ... + 5 6 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 6 7 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 8 9 100 230 60 0 0 0.011 0.11 0.1925 0 0 1 0 0 1; + 11 10 100 230 60 0 0 0.0025 0.025 0.04375 0 0 1 0 0 1; + 9 10 100 230 60 0 0 0.001 0.01 0.0175 0 0 1 0 0 1; + 7 8 100 230 60 0 0 0.011 0.11 0.09625 0 0 1 0 0 1; + 1 5 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 2 6 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 4 10 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + 3 11 900 20 60 0 0.08695652 0 0.15 0 0 0 1 0 0 1; + ]; + +Fault.con = [ ... + 8 100 230 60 1 1.05 0 1e-05; + ]; + +SW.con = [ ... + 3 100 20 1.03 -0.1186824 99 -99 1.1 0.9 7 1 1 1; + ]; + +PV.con = [ ... + 1 100 20 1.5 1.03 5 -2 1.1 0.9 1 1; + 2 100 20 1.5 1.01 5 -2 1.1 0.9 1 1; + 4 100 20 1.5 1.01 5 -2 1.1 0.9 1 1; + ]; + +PQ.con = [ ... + 9 100 230 3.00 0.0 1.05 0.95 0; + 7 100 230 3.00 0.0 1.05 0.95 0; + ]; + +Pl.con = [ ... + 7 100 230 60 0 100 0 0 0 100 1 1; + 9 100 230 60 0 100 0 0 0 100 1 1; + ]; + +Syn.con = [ ... + 4 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + 2 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0 0 0 1 1; + 1 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 13 0 0 0 1 1 0.002 0 0 1 1; + 3 900 20 60 6 0.2 0.0025 1.8 0.3 0.25 8 0.03 1.7 0.55 0.25 0.4 0.05 12.35 0 0 0 1 1 0 0 0 1 1; + ]; + +Bus.names = {... + 'Bus 01'; 'Bus 02'; 'Bus 03'; 'Bus 04'; 'Bus 05'; + 'Bus 06'; 'Bus 07'; 'Bus 08'; 'Bus 09'; 'Bus 10'; + 'Bus 11'}; + diff --git a/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_base.m b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_base.m new file mode 100644 index 0000000..4cad516 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_base.m @@ -0,0 +1,69 @@ +% Script to obtain the power flow solution from PSAT models +% LV, 2024/01 +clear all; clc; +% put the path to where the psat .zip has been uncompressed +cd("C:\Users\vanfretti\Documents\MATLAB\psat-2.1.11-mat\psat") +initpsat % starts PSAT in command line mode +% put the path to the working director where the models are stored +cd("C:\Users\vanfretti\Documents\MATLAB\example2_psat_models") +clpsat.readfile = 0; % do not reload the data files + +%% Specify the model to be solved and settings +runpsat('d_kundur1_mdl_case0.m','data') +% Set the system parameters +Settings.freq = 60; +Settings.mva = 100; +Settings.showlf = 1; +% Power flow settings and solution +Settings.lftol = 1e-12; +runpsat('pf') + +%% Post-process the data + +% calculate the line flows +[ps0,qs0,pr0,qr0] = fm_flows; + +% extract the bus voltages and angles for further use +voltages = DAE.y(1+Bus.n:2*Bus.n); +angles = DAE.y(Bus.a); + +% extract the power at each bus from the solution +Sbase = 100.0e6; +pgen = Snapshot.Pg*Sbase/1e6; +qgen = Snapshot.Qg*Sbase/1e6; +pload = Snapshot.Pl*Sbase/1e6; +qload = Snapshot.Ql*Sbase/1e6; + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +format long g +disp('Voltage Magnitudes') +disp(voltages) +figure(101) +bar(voltages,'DisplayName','voltages') +xlabel('Iteration no and Bus no') +ylabel('Voltage (pu)') + +%% Display record data +run dexample2_print_record_data.m + +%closepsat % exits PSAT gracefully diff --git a/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case1.m b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case1.m new file mode 100644 index 0000000..1c52d7c --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case1.m @@ -0,0 +1,84 @@ +% Script to obtain the power flow solution from PSAT models +% LV, 2024/03 +clear all; clc; +% put the path to where the psat .zip has been uncompressed +cd("C:\Users\vanfretti\Documents\MATLAB\psat-2.1.11-mat\psat") +initpsat % starts PSAT in command line mode +% put the path to the working director where the models are stored +cd("C:\Users\vanfretti\Documents\MATLAB\example2_psat_models") +clpsat.readfile = 0; % do not reload the data files + +%% Specify the model to be solved +runpsat('d_kundur1_mdl_case1.m','data') +% Set the system parameters +Settings.freq = 60; +Settings.mva = 100; +Settings.showlf = 1; +% Power flow settings and solution +Settings.lftol = 1e-12; + +% % decrease the load/generation +% ldecrease = -0.25; %percent load decrease +% +% % Modify the power output of the generators +% PV.store(1,4) = 5*(1+ldecrease); +% PV.store(2,4) = 5*(1+ldecrease); +% PV.store(4,4) = 5*(1+ldecrease); +% +% % Modify the load +% PQ.store(1,4) = 15.00* (1+ldecrease); +% PQ.store(2,4) = 5.00 * (1+ldecrease); + + +%% Run power flow +runpsat('pf') + +%% Post-process the data + +% calculate the line flows +[ps0,qs0,pr0,qr0] = fm_flows; + +% extract the bus voltages and angles for further use +voltages = DAE.y(1+Bus.n:2*Bus.n); +angles = DAE.y(Bus.a); + +% extract the power at each bus from the solution +Sbase = 100.0e6; +pgen = Snapshot.Pg*Sbase/1e6; +qgen = Snapshot.Qg*Sbase/1e6; +pload = Snapshot.Pl*Sbase/1e6; +qload = Snapshot.Ql*Sbase/1e6; + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% format long g +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +%% Display record data +run dexample2_print_record_data.m + +%closepsat % exits PSAT gracefully diff --git a/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case2.m b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case2.m new file mode 100644 index 0000000..72622a0 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case2.m @@ -0,0 +1,84 @@ +% Script to obtain the power flow solution from PSAT models +% LV, 2024/03 +clear all; clc; +% put the path to where the psat .zip has been uncompressed +cd("C:\Users\vanfretti\Documents\MATLAB\psat-2.1.11-mat\psat") +initpsat % starts PSAT in command line mode +% put the path to the working director where the models are stored +cd("C:\Users\vanfretti\Documents\MATLAB\example2_psat_models") +clpsat.readfile = 0; % do not reload the data files + +%% Specify the model to be solved +runpsat('d_kundur1_mdl_case3.m','data') +% Set the system parameters +Settings.freq = 60; +Settings.mva = 100; +Settings.showlf = 1; +% Power flow settings and solution +Settings.lftol = 1e-12; + +% % decrease the load/generation +% ldecrease = -0.25; %percent load decrease +% +% % Modify the power output of the generators +% PV.store(1,4) = 5*(1+ldecrease); +% PV.store(2,4) = 5*(1+ldecrease); +% PV.store(4,4) = 5*(1+ldecrease); +% +% % Modify the load +% PQ.store(1,4) = 15.00* (1+ldecrease); +% PQ.store(2,4) = 5.00 * (1+ldecrease); + + +%% Run power flow +runpsat('pf') + +%% Post-process the data + +% calculate the line flows +[ps0,qs0,pr0,qr0] = fm_flows; + +% extract the bus voltages and angles for further use +voltages = DAE.y(1+Bus.n:2*Bus.n); +angles = DAE.y(Bus.a); + +% extract the power at each bus from the solution +Sbase = 100.0e6; +pgen = Snapshot.Pg*Sbase/1e6; +qgen = Snapshot.Qg*Sbase/1e6; +pload = Snapshot.Pl*Sbase/1e6; +qload = Snapshot.Ql*Sbase/1e6; + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% format long g +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +%% Display record data +run dexample2_print_record_data.m + +%closepsat % exits PSAT gracefully diff --git a/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case3.m b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case3.m new file mode 100644 index 0000000..eec37b2 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/dexample2_pf_script_commandline_case3.m @@ -0,0 +1,84 @@ +% Script to obtain the power flow solution from PSAT models +% LV, 2024/03 +clear all; clc; +% put the path to where the psat .zip has been uncompressed +cd("C:\Users\vanfretti\Documents\MATLAB\psat-2.1.11-mat\psat") +initpsat % starts PSAT in command line mode +% put the path to the working director where the models are stored +cd("C:\Users\vanfretti\Documents\MATLAB\example2_psat_models") +clpsat.readfile = 0; % do not reload the data files + +%% Specify the model to be solved +runpsat('d_kundur1_mdl_case2.m','data') +% Set the system parameters +Settings.freq = 60; +Settings.mva = 100; +Settings.showlf = 1; +% Power flow settings and solution +Settings.lftol = 1e-12; + +% % decrease the load/generation +% ldecrease = -0.25; %percent load decrease +% +% % Modify the power output of the generators +% PV.store(1,4) = 5*(1+ldecrease); +% PV.store(2,4) = 5*(1+ldecrease); +% PV.store(4,4) = 5*(1+ldecrease); +% +% % Modify the load +% PQ.store(1,4) = 15.00* (1+ldecrease); +% PQ.store(2,4) = 5.00 * (1+ldecrease); + + +%% Run power flow +runpsat('pf') + +%% Post-process the data + +% calculate the line flows +[ps0,qs0,pr0,qr0] = fm_flows; + +% extract the bus voltages and angles for further use +voltages = DAE.y(1+Bus.n:2*Bus.n); +angles = DAE.y(Bus.a); + +% extract the power at each bus from the solution +Sbase = 100.0e6; +pgen = Snapshot.Pg*Sbase/1e6; +qgen = Snapshot.Qg*Sbase/1e6; +pload = Snapshot.Pl*Sbase/1e6; +qload = Snapshot.Ql*Sbase/1e6; + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +% Make a table +varNames = {'Bus', '|V (pu)|','/_V (rad)', ... + 'Pgen (MW)', 'Qgen (Mvar)', ... + 'Pload (MW)', 'Qload (Mvar)'}; +Tableout = table(Bus.names,voltages,angles,pgen,qgen,pload,qload,'VariableNames',varNames); +disp(Tableout) +%% Display data for reuse +% format long g +% disp('Voltage Magnitudes') +% disp(voltages) +% figure(101) +% bar(voltages,'DisplayName','voltages') +% xlabel('Iteration no and Bus no') +% ylabel('Voltage (pu)') + +%% Display record data +run dexample2_print_record_data.m + +%closepsat % exits PSAT gracefully diff --git a/Assets/PSAT_powerflow_scripts/dexample2_print_record_data.m b/Assets/PSAT_powerflow_scripts/dexample2_print_record_data.m new file mode 100644 index 0000000..a2aa4e8 --- /dev/null +++ b/Assets/PSAT_powerflow_scripts/dexample2_print_record_data.m @@ -0,0 +1,86 @@ +%% Bus Data Output to screen +nbuses = 11; +buslist = 1:nbuses; % array with bus numbers + +vmag = voltages(buslist); +vang = angles(buslist); + +% Bus data format specifications + +format short +formatSpecMag = 'V%d = %1.24f ,\n'; +formatSpecAng = 'A%d = %1.24f ,\n'; +formatSpecAngLast = 'A%d = %1.24f )\n'; + +fprintf('**************************\n') +fprintf('Bus Data Starts \n') +fprintf('**************************\n') +fprintf('( \n') +for k = 1:length(buslist) + if k < length(buslist) + fprintf(formatSpecMag,k,vmag(k)) + fprintf(formatSpecAng,k,vang(k)) + else + fprintf(formatSpecMag,k,vmag(k)) + fprintf(formatSpecAngLast,k,vang(k)) + end +end + +%% Generator Data Output to Screen +ngen = 4; +genlist = 1:ngen; + +% Load Data Record formating specifications +format short +formatSpecPg = 'PG%d = 1e06*( %2.24f ),\n'; +formatSpecQg = 'QG%d = 1e06*( %2.24f ),\n'; +formatSpecQgLast = 'QG%d = 1e06*( %2.24f ) ); \n'; + +fprintf('\n') +fprintf('**************************\n') +fprintf('Machine Record Data Starts \n') +fprintf('**************************\n') +fprintf('( \n') +for k = 1:length(genlist) + if k < length(genlist) + fprintf(formatSpecPg,k,pgen(k)) + fprintf(formatSpecQg,k,qgen(k)) + else + fprintf(formatSpecPg,k,pgen(k)) + fprintf(formatSpecQgLast,k,qgen(k)) + end +end + + +%% Load Data Output to Screen +% Note on formatting and numbering: +% The loads are at buses 7 through 12 and 17, so we need to rearrange +% the data for output + +loadarray = [7 9]; +pl = pload(loadarray); +ql = qload(loadarray); + +nloads = length(loadarray); +loadlist = 1:nloads; + +% Load Data Record formating specifications +format short +formatSpecPl = 'PL%d = 1e06*( %2.24f ),\n'; +formatSpecQl = 'QL%d = 1e06*( %2.24f ),\n'; +formatSpecQlLast = 'QL%d = 1e06*( %2.24f ) ); \n'; + +fprintf('\n') +fprintf('**************************\n') +fprintf('Load Record Data Starts \n') +fprintf('**************************\n') +fprintf('( \n') +for k = 1:length(loadlist) + if k < length(loadlist) + fprintf(formatSpecPl,k,pl(k)) + fprintf(formatSpecQl,k,ql(k)) + else + fprintf(formatSpecPl,k,pl(k)) + fprintf(formatSpecQlLast,k,ql(k)) + end +end \ No newline at end of file diff --git a/Example2/Base/Systems/PFVariants/syspf.mo b/Example2/Base/Systems/PFVariants/syspf.mo index 1420d48..1dc0140 100644 --- a/Example2/Base/Systems/PFVariants/syspf.mo +++ b/Example2/Base/Systems/PFVariants/syspf.mo @@ -233,10 +233,10 @@ model syspf "Power system model with input/output interfaces" X=0.01667*(5/4)*percent, B=0) annotation (Placement(transformation(extent={{-176,-42},{-156,-22}}))); PFData.PFScenarios pf( - redeclare record Bus = Example2.PFData.Data.BusData.PF_Bus_0, - redeclare record Loads = Example2.PFData.Data.LoadData.PF_Loads_0, - redeclare record Trafos = Example2.PFData.Data.TrafoData.PF_Trafos_0, - redeclare record Machines = Example2.PFData.Data.MachineData.PF_Machines_0) + redeclare record Bus = Bus, + redeclare record Loads = Loads, + redeclare record Trafos = Trafos, + redeclare record Machines = Machines) annotation (choicesAllMatching=true,Placement(transformation(extent={{6,-108}, {34,-80}}))); // allow replaceable power flow records diff --git a/Example2/PFData/Data/BusData/PF_Bus_0.mo b/Example2/PFData/Data/BusData/PF_Bus_0.mo index dee1fb2..a76c198 100644 --- a/Example2/PFData/Data/BusData/PF_Bus_0.mo +++ b/Example2/PFData/Data/BusData/PF_Bus_0.mo @@ -1,5 +1,5 @@ within Example2.PFData.Data.BusData; -record PF_Bus_0 +record PF_Bus_0 "Case 0: Base Case, 1550 MW Total Generation. Solution obtained manually." extends PFData.Data.BusData.Bus_Template( V1=1.03, A1=0.35378975855, diff --git a/Example2/PFData/Data/BusData/PF_Bus_1.mo b/Example2/PFData/Data/BusData/PF_Bus_1.mo index af21ba9..93c64e3 100644 --- a/Example2/PFData/Data/BusData/PF_Bus_1.mo +++ b/Example2/PFData/Data/BusData/PF_Bus_1.mo @@ -1,5 +1,5 @@ within Example2.PFData.Data.BusData; -record PF_Bus_1 "Solution generated through PSAT and exported" +record PF_Bus_1 "Case 1: Base Case, 1550 MW Total Generation. Solution generated through PSAT and exported" extends PFData.Data.BusData.Bus_Template( V1 = 1.030000000000000026645353, A1 = 0.353381617759011334989339, diff --git a/Example2/PFData/Data/BusData/PF_Bus_2.mo b/Example2/PFData/Data/BusData/PF_Bus_2.mo new file mode 100644 index 0000000..93033d3 --- /dev/null +++ b/Example2/PFData/Data/BusData/PF_Bus_2.mo @@ -0,0 +1,27 @@ +within Example2.PFData.Data.BusData; +record PF_Bus_2 + "Case 2: 760 MW Total Generation. Solution generated through PSAT and exported" + extends PFData.Data.BusData.Bus_Template( +V1 = 1.030000000000000026645353, +A1 = 0.267372850195426503550067, +V2 = 1.010000000000000008881784, +A2 = 0.209099449706210194221967, +V3 = 1.030000000000000026645353, +A3 = -0.118682399999999993456257, +V4 = 1.010000000000000008881784, +A4 = -0.081268120752123917949206, +V5 = 1.024244455958393418271157, +A5 = 0.227867048742997790888865, +V6 = 1.011947918440156968244992, +A6 = 0.168321105829772110773490, +V7 = 1.007850263071546015325453, +A7 = 0.119462552904001748088625, +V8 = 1.006146565666131698080221, +A8 = -0.014664028766080585211573, +V9 = 1.006366833758768564166530, +A9 = -0.147387478259824733495265, +V10 = 1.011767798556977515644917, +A10 = -0.122053728217705284575523, +V11 = 1.023038471567989216026717, +A11 = -0.120446714029060722439546); +end PF_Bus_2; diff --git a/Example2/PFData/Data/BusData/PF_Bus_3.mo b/Example2/PFData/Data/BusData/PF_Bus_3.mo new file mode 100644 index 0000000..1bee7d8 --- /dev/null +++ b/Example2/PFData/Data/BusData/PF_Bus_3.mo @@ -0,0 +1,27 @@ +within Example2.PFData.Data.BusData; +record PF_Bus_3 + "Case 3: 600 MW Total Generation. Solution generated through PSAT and exported" + extends PFData.Data.BusData.Bus_Template( +V1 = 1.030000000000000026645353, +A1 = 0.267372850195426503550067, +V2 = 1.010000000000000008881784, +A2 = 0.209099449706210194221967, +V3 = 1.030000000000000026645353, +A3 = -0.118682399999999993456257, +V4 = 1.010000000000000008881784, +A4 = -0.081268120752123917949206, +V5 = 1.024244455958393418271157, +A5 = 0.227867048742997790888865, +V6 = 1.011947918440156968244992, +A6 = 0.168321105829772110773490, +V7 = 1.007850263071546015325453, +A7 = 0.119462552904001748088625, +V8 = 1.006146565666131698080221, +A8 = -0.014664028766080585211573, +V9 = 1.006366833758768564166530, +A9 = -0.147387478259824733495265, +V10 = 1.011767798556977515644917, +A10 = -0.122053728217705284575523, +V11 = 1.023038471567989216026717, +A11 = -0.120446714029060722439546); +end PF_Bus_3; diff --git a/Example2/PFData/Data/BusData/package.order b/Example2/PFData/Data/BusData/package.order index e31dcf1..214ecf2 100644 --- a/Example2/PFData/Data/BusData/package.order +++ b/Example2/PFData/Data/BusData/package.order @@ -1,3 +1,5 @@ Bus_Template PF_Bus_0 PF_Bus_1 +PF_Bus_2 +PF_Bus_3 diff --git a/Example2/PFData/Data/LoadData/PF_Loads_0.mo b/Example2/PFData/Data/LoadData/PF_Loads_0.mo index 86b6724..9874141 100644 --- a/Example2/PFData/Data/LoadData/PF_Loads_0.mo +++ b/Example2/PFData/Data/LoadData/PF_Loads_0.mo @@ -1,5 +1,5 @@ within Example2.PFData.Data.LoadData; -record PF_Loads_0 +record PF_Loads_0 "Case 0: Base Case, 1550 MW Total Generation. Solution obtained manually." extends PFData.Data.LoadData.Loads_Template( PL7_1=967000000, QL7_1=-84700000, diff --git a/Example2/PFData/Data/LoadData/PF_Loads_1.mo b/Example2/PFData/Data/LoadData/PF_Loads_1.mo index 57ab25e..ef770bd 100644 --- a/Example2/PFData/Data/LoadData/PF_Loads_1.mo +++ b/Example2/PFData/Data/LoadData/PF_Loads_1.mo @@ -1,5 +1,5 @@ within Example2.PFData.Data.LoadData; -record PF_Loads_1 "Solution generated through PSAT and exported" +record PF_Loads_1 "Case 1: Base Case, 1550 MW Total Generation. Solution generated through PSAT and exported" extends PFData.Data.LoadData.Loads_Template( PL7_1 = 1e06*( 967.000000000000000000000000), QL7_1 = 1e06*( -100.000000000000000000000000), diff --git a/Example2/PFData/Data/LoadData/PF_Loads_2.mo b/Example2/PFData/Data/LoadData/PF_Loads_2.mo new file mode 100644 index 0000000..2d54269 --- /dev/null +++ b/Example2/PFData/Data/LoadData/PF_Loads_2.mo @@ -0,0 +1,9 @@ +within Example2.PFData.Data.LoadData; +record PF_Loads_2 + "Case 2: 760 MW Total Generation. Solution generated through PSAT and exported" +extends PFData.Data.LoadData.Loads_Template( +PL7_1 = 1e06*( 250.000000000000000000000000), +QL7_1 = 1e06*( 0.000000000000000000000000), +PL9_1 = 1e06*( 500.000000000000000000000000), +QL9_1 = 1e06*( 0.000000000000000000000000)); +end PF_Loads_2; diff --git a/Example2/PFData/Data/LoadData/PF_Loads_3.mo b/Example2/PFData/Data/LoadData/PF_Loads_3.mo new file mode 100644 index 0000000..954d2a6 --- /dev/null +++ b/Example2/PFData/Data/LoadData/PF_Loads_3.mo @@ -0,0 +1,9 @@ +within Example2.PFData.Data.LoadData; +record PF_Loads_3 + "Case 3: 600 MW Total Generation. Solution generated through PSAT and exported" +extends PFData.Data.LoadData.Loads_Template( +PL7_1 = 1e06*( 250.000000000000000000000000), +QL7_1 = 1e06*( 0.000000000000000000000000), +PL9_1 = 1e06*( 500.000000000000000000000000), +QL9_1 = 1e06*( 0.000000000000000000000000)); +end PF_Loads_3; diff --git a/Example2/PFData/Data/LoadData/package.order b/Example2/PFData/Data/LoadData/package.order index 85b419a..358994b 100644 --- a/Example2/PFData/Data/LoadData/package.order +++ b/Example2/PFData/Data/LoadData/package.order @@ -1,3 +1,5 @@ Loads_Template PF_Loads_0 PF_Loads_1 +PF_Loads_2 +PF_Loads_3 diff --git a/Example2/PFData/Data/MachineData/PF_Machines_0.mo b/Example2/PFData/Data/MachineData/PF_Machines_0.mo index d1f1a73..228134f 100644 --- a/Example2/PFData/Data/MachineData/PF_Machines_0.mo +++ b/Example2/PFData/Data/MachineData/PF_Machines_0.mo @@ -1,5 +1,5 @@ within Example2.PFData.Data.MachineData; -record PF_Machines_0 +record PF_Machines_0 "Case 0: Base Case, 1550 MW Total Generation. Solution obtained manually." extends PFData.Data.MachineData.Machines_Template( P1_1=700000000, Q1_1=185029600, diff --git a/Example2/PFData/Data/MachineData/PF_Machines_1.mo b/Example2/PFData/Data/MachineData/PF_Machines_1.mo index c4fc22a..85e7108 100644 --- a/Example2/PFData/Data/MachineData/PF_Machines_1.mo +++ b/Example2/PFData/Data/MachineData/PF_Machines_1.mo @@ -1,5 +1,5 @@ within Example2.PFData.Data.MachineData; -record PF_Machines_1 "Solution generated through PSAT and exported" +record PF_Machines_1 "Case 1: Base Case, 1550 MW Total Generation. Solution generated through PSAT and exported" extends PFData.Data.MachineData.Machines_Template( P1_1 = 1e06*( 699.999999999999317878973670), Q1_1 = 1e06*( 182.450226027067287759564351), diff --git a/Example2/PFData/Data/MachineData/PF_Machines_2.mo b/Example2/PFData/Data/MachineData/PF_Machines_2.mo new file mode 100644 index 0000000..4759db9 --- /dev/null +++ b/Example2/PFData/Data/MachineData/PF_Machines_2.mo @@ -0,0 +1,13 @@ +within Example2.PFData.Data.MachineData; +record PF_Machines_2 + "Case 2: 760 MW Total Generation. Solution generated through PSAT and exported" +extends PFData.Data.MachineData.Machines_Template( +P1_1 = 1e06*( 250.000000000000397903932026), +Q1_1 = 1e06*( 40.508257739099512662050984), +P2_1 = 1e06*( 249.999999999999801048033987), +Q2_1 = 1e06*( -6.706264123356542761200672), +P3_1 = 1e06*( 11.154654204964604247152238), +Q3_1 = 1e06*( 43.032214037281391938449815), +P4_1 = 1e06*( 250.000000000000170530256582), +Q4_1 = 1e06*( -5.613829283191996033508531)); +end PF_Machines_2; diff --git a/Example2/PFData/Data/MachineData/PF_Machines_3.mo b/Example2/PFData/Data/MachineData/PF_Machines_3.mo new file mode 100644 index 0000000..5c4a62d --- /dev/null +++ b/Example2/PFData/Data/MachineData/PF_Machines_3.mo @@ -0,0 +1,13 @@ +within Example2.PFData.Data.MachineData; +record PF_Machines_3 + "Case 3: 600 MW Total Generation. Solution generated through PSAT and exported" +extends PFData.Data.MachineData.Machines_Template( +P1_1 = 1e06*( 250.000000000000397903932026), +Q1_1 = 1e06*( 40.508257739099512662050984), +P2_1 = 1e06*( 249.999999999999801048033987), +Q2_1 = 1e06*( -6.706264123356542761200672), +P3_1 = 1e06*( 11.154654204964604247152238), +Q3_1 = 1e06*( 43.032214037281391938449815), +P4_1 = 1e06*( 250.000000000000170530256582), +Q4_1 = 1e06*( -5.613829283191996033508531)); +end PF_Machines_3; diff --git a/Example2/PFData/Data/MachineData/package.order b/Example2/PFData/Data/MachineData/package.order index e8c1a11..a8025bc 100644 --- a/Example2/PFData/Data/MachineData/package.order +++ b/Example2/PFData/Data/MachineData/package.order @@ -1,3 +1,5 @@ Machines_Template PF_Machines_0 PF_Machines_1 +PF_Machines_2 +PF_Machines_3 diff --git a/Example2/PFData/TestPF/Ramping_pf.mo b/Example2/PFData/TestPF/Ramping_pf.mo new file mode 100644 index 0000000..e3f5ab2 --- /dev/null +++ b/Example2/PFData/TestPF/Ramping_pf.mo @@ -0,0 +1,84 @@ +within Example2.PFData.TestPF; +model Ramping_pf + "Model to test the power flow scenarios." + extends Modelica.Icons.Example; + Base.Systems.PFVariants.syspf plant( + g1(Rdroop=0.025), + t2pssin=1200, + t3pssin=2100, + g3(pss( + Kw=40, + Tw=10, + T1=0.5336, + T2=0.0942, + T3=0.5336, + T4=0.0942), sEXS(K=200)), + pss2_Kw=48.660727200594167, + pss2_Tw=0.355570139928890, + pss3_Kw=48.660727200594167, + pss3_Tw=0.355570139928890, + pss4_Kw=48.660727200594167, + pss4_Tw=0.355570139928890, + pss5_Kw=48.660727200594167, + pss5_Tw=0.355570139928890, + redeclare record Bus = Example2.PFData.Data.BusData.PF_Bus_3, + redeclare record Loads = Example2.PFData.Data.LoadData.PF_Loads_3, + redeclare record Trafos = Example2.PFData.Data.TrafoData.PF_Trafos_0, + redeclare record Machines = Example2.PFData.Data.MachineData.PF_Machines_3) + annotation (Placement(transformation(extent={{58,-40},{138,40}}))); + Modelica.Blocks.Sources.Constant r(k=0) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={-120,-24}))); + + Example2.CustomComponents.TimedMultiRamp ramping( + rampA_height=0.2, + rampB_height=0.125, + rampC_height=-0.075, + rampD_height=-0.075) annotation (Placement(transformation(rotation=0, + extent={{-140,28},{-100,68}}))); + parameter OpenIPSL.Types.PerUnit pss_vsmax=0.2 "Max stabilizer output signal" annotation (Dialog(tab="PSS Parameters", group="PSS 1")); + parameter OpenIPSL.Types.PerUnit pss_vsmin=-0.2 "Min stabilizer output signal" annotation (Dialog(tab="PSS Parameters", group="PSS 1")); + parameter Real pss1_Kw=5 "Stabilizer gain [pu/pu]" annotation (Dialog(tab="PSS Parameters", group="PSS 1")); + parameter OpenIPSL.Types.Time pss1_Tw=5 "Wash-out time constant" annotation (Dialog(tab="PSS Parameters", group="PSS 1")); + parameter Real pss2_Kw=5 "Stabilizer gain [pu/pu]" annotation (Dialog(tab="PSS Parameters", group="PSS 2")); + parameter OpenIPSL.Types.Time pss2_Tw=5 "Wash-out time constant" annotation (Dialog(tab="PSS Parameters", group="PSS 2")); + parameter Real pss3_Kw=5 "Stabilizer gain [pu/pu]" annotation (Dialog(tab="PSS Parameters", group="PSS 3")); + parameter OpenIPSL.Types.Time pss3_Tw=5 "Wash-out time constant" annotation (Dialog(tab="PSS Parameters", group="PSS 3")); + parameter Real pss4_Kw=5 "Stabilizer gain [pu/pu]" annotation (Dialog(tab="PSS Parameters", group="PSS 4")); + parameter OpenIPSL.Types.Time pss4_Tw=5 "Wash-out time constant" annotation (Dialog(tab="PSS Parameters", group="PSS 4")); +equation + connect(r.y, plant.uLoad7) annotation (Line(points={{-98,-24},{-24,-24},{-24, + -17.1429},{51.7143,-17.1429}}, color={0,0,127})); + connect(ramping.y, plant.uPm) annotation (Line( + points={{-98,48},{-22,48},{-22,34.2857},{52.2857,34.2857}}, + color={238,46,47}, + thickness=1, + arrow={Arrow.None,Arrow.Filled})); + connect(plant.uLoad9, ramping.y) annotation (Line( + points={{51.7143,-34.2857},{-68,-34.2857},{-68,48},{-98,48}}, + color={238,46,47}, + thickness=1)); + connect(plant.uPSS, r.y) annotation (Line(points={{51.7143,17.1429},{8, + 17.1429},{8,-24},{-98,-24}}, color={0,0,127})); + connect(plant.uAVRin, r.y) annotation (Line(points={{51.7143,0},{-30,0},{-30, + -24},{-98,-24}}, color={0,0,127})); + //, +// __Dymola_selections={Selection(name="MySelection", match={MatchVariable(name="plant.Vt", newName="Vt"),MatchVariable(name="plant.Q", newName="Q"),MatchVariable(name="plant.P",newName="P"),MatchVariable(name="plant.w",newName="w"),MatchVariable(name="plant.AVRin",newName="u"),MatchVariable(name="plant.AVRout",newName="AVRout"),MatchVariable(name="timedMultiRamp.y",newName="rampY"),MatchVariable(name="plant.Load9.P",newName="Pload"),MatchVariable(name="r.y",newName="r"),MatchVariable(name="plant.g1.pss.vs",newName="pssy"),MatchVariable(name="ramping.y",newName="rampingy")})}); + annotation ( + experiment( + StopTime=600, + __Dymola_NumberOfIntervals=5000, + Tolerance=1e-06, + __Dymola_Algorithm="Dassl"), + Diagram(coordinateSystem(extent={{-200,-200},{200,200}}), graphics={Text( + extent={{-144,-58},{140,-98}}, + textColor={28,108,200}, + textString="Click on \"plant\" and go to the \"Power Flow Scenario\" tab. + +Select the case for which you want to test a power flow solution.")}), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})),preferredView="diagram", + Documentation(info=" +

This model is intended to test power flow solutions to be used in the models of the Example2.Analysis.PFVariants sub-package.

+")); +end Ramping_pf; diff --git a/Example2/PFData/TestPF/package.mo b/Example2/PFData/TestPF/package.mo new file mode 100644 index 0000000..5c02abf --- /dev/null +++ b/Example2/PFData/TestPF/package.mo @@ -0,0 +1,4 @@ +within Example2.PFData; +package TestPF "Package with a model to test the power flow solutions" + extends Modelica.Icons.ExamplesPackage; +end TestPF; diff --git a/Example2/PFData/TestPF/package.order b/Example2/PFData/TestPF/package.order new file mode 100644 index 0000000..b500331 --- /dev/null +++ b/Example2/PFData/TestPF/package.order @@ -0,0 +1 @@ +Ramping_pf diff --git a/Example2/PFData/package.order b/Example2/PFData/package.order index c1bd3b3..cb75cf7 100644 --- a/Example2/PFData/package.order +++ b/Example2/PFData/package.order @@ -1,3 +1,4 @@ RecordTemplates Data PFScenarios +TestPF diff --git a/Example2/package.mo b/Example2/package.mo index 8205d29..62a71d5 100644 --- a/Example2/package.mo +++ b/Example2/package.mo @@ -6,8 +6,8 @@ annotation (uses( DataFiles(version="1.1.0"), Modelica_LinearSystems2(version="2.4.0"), DymolaCommands(version="1.16"), - OpenIPSL(version="3.0.1"), - Example1(version="3")), Icon(graphics={ + Example1(version="3"), + OpenIPSL(version="3.1.0-dev")), Icon(graphics={ Rectangle( lineColor={0,140,72}, fillColor={170,255,85},