From fbc7535a5addc3ec7b9a6cdb2c3f1f7a552bda1f Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Thu, 5 Mar 2020 00:11:53 -0800 Subject: [PATCH 01/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 240f8a6..6995075 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ An unofficial repository for the Power Systems Analysis Toolbox by Federico Mila The official webpage is [http://faraday1.ucd.ie/psat.html](http://faraday1.ucd.ie/psat.html) -This repository is started from the official version 2.1.10. +This repository is started from the official version 2.1.11. As modifications are made, they will be indicated in the source files as required by the license (GPL). The modifications can also be identified using Git of course. From a4381d2fe8603e50390399e183666524f0a22568 Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Wed, 24 Jun 2020 11:15:56 +0430 Subject: [PATCH 02/10] add PSAT Simulink (.slx) file type --- psat-mat/psat/fm_dirset.m | 161 +++++++++++++++++++++++++------------- 1 file changed, 106 insertions(+), 55 deletions(-) diff --git a/psat-mat/psat/fm_dirset.m b/psat-mat/psat/fm_dirset.m index 404b548..160e7cb 100644 --- a/psat-mat/psat/fm_dirset.m +++ b/psat-mat/psat/fm_dirset.m @@ -34,32 +34,36 @@ PSAT = 2; PSATPERT = 3; PSATMDL = 4; -CYME = 5; -MATPOWER = 6; -PST = 7; -EPRI = 8; -PSSE = 9; -PSAP = 10; -EUROSTAG = 11; -TH = 12; -CESI = 13; -VST = 14; -SIMPOW = 15; -NEPLAN = 16; -DIGSILENT = 17; -POWERWORLD = 18; -PET = 19; -FLOWDEMO = 20; -GEEPC = 21; -CHAPMAN = 22; -UCTE = 23; -PCFLO = 24; -WEBFLOW = 25; -IPSS = 26; -CEPEL = 27; -ODM = 28; -REDS = 29; -VITRUVIO = 30; % all files +PSATSLX=5; %add by s. majid shariatzadeh +CYME = 6; %edit by s. majid shariatzadeh +MATPOWER = 7; %edit by s. majid shariatzadeh +PST = 8; %edit by s. majid shariatzadeh +EPRI = 9; %edit by s. majid shariatzadeh +PSSE = 10; %edit by s. majid shariatzadeh +PSAP = 11; %edit by s. majid shariatzadeh +EUROSTAG = 12; %edit by s. majid shariatzadeh +TH = 13; %edit by s. majid shariatzadeh +CESI = 14; %edit by s. majid shariatzadeh +VST = 15; %edit by s. majid shariatzadeh +SIMPOW = 16; %edit by s. majid shariatzadeh +NEPLAN = 17; %edit by s. majid shariatzadeh +DIGSILENT = 18; %edit by s. majid shariatzadeh +POWERWORLD = 19;%edit by s. majid shariatzadeh +PET = 20; %edit by s. majid shariatzadeh +FLOWDEMO = 21; %edit by s. majid shariatzadeh +GEEPC = 22; %edit by s. majid shariatzadeh +CHAPMAN = 23; %edit by s. majid shariatzadeh +UCTE = 24; %edit by s. majid shariatzadeh +PCFLO = 25; %edit by s. majid shariatzadeh +WEBFLOW = 26; %edit by s. majid shariatzadeh +IPSS = 27; %edit by s. majid shariatzadeh +CEPEL = 28; %edit by s. majid shariatzadeh +ODM = 29; %edit by s. majid shariatzadeh +REDS = 30; %edit by s. majid shariatzadeh +VITRUVIO = 31; % all files %edit by s. majid shariatzadeh + + + switch type @@ -71,6 +75,7 @@ formati{MATPOWER} = 'MatPower (.m)'; formati{PSAT} = 'PSAT data (.m)'; formati{PSATPERT} = 'PSAT pert. (.m)'; + formati{PSATSLX} = 'PSAT Simulink (.slx)'; % add by S. Majid Shariatzadeh formati{PSATMDL} = 'PSAT Simulink (.mdl)'; formati{PST} = 'PST (.m)'; formati{EPRI} = 'EPRI (.wsc, .txt, .dat)'; @@ -173,6 +178,7 @@ case MATPOWER, file = 'pserc'; case PSAT, file = 'psatdata'; case PSATPERT, file = 'psatpert'; + case PSATSLX, file = 'simulinkSLX'; %add by majid shariatzadeh(SLX avatar) case PSATMDL, file = 'simulink'; case PST, file = 'cherry'; case EPRI, file = 'epri'; @@ -228,7 +234,8 @@ set(hdl4,'Enable','off') end - if formato == PSATMDL + %if formato == PSATMDL % old line + if formato == PSATMDL || formato == PSATSLX % add by S. Majid Shariatzadeh set(hdlp,'Enable','on') set(hdlp,'Visible','on') else @@ -472,6 +479,19 @@ fm_disp(['Use modified file name <',filename,'>']) end check = sim2psat(filename,pwd); + + + case PSATSLX %add By S.M. Shariatzadeh + first = double(filename(1)); %add S.M. Shariatzadeh + if first <= 57 && first >= 48 %add S.M. Shariatzadeh + copyfile(filename,['d',filename]) %add S.M. Shariatzadeh + filename = ['d',filename]; %add S.M. Shariatzadeh + fm_disp(['Use modified file name <',filename,'>']) %add + end %add S.M. Shariatzadeh + check = sim2psat(filename,pwd); %add S.M. Shariatzadeh + + + case PSATPERT fm_disp('No filter is associated with pertubation files.') case PST @@ -570,7 +590,8 @@ % determine file name namefile = nomefile{numfile}; switch type - case {PSAT,PSATPERT,PSATMDL,VITRUVIO} + %case {PSAT,PSATPERT,PSATMDL,VITRUVIO} %old line + case {PSAT,PSATPERT,PSATMDL,PSATSLX,VITRUVIO} %edit by majid Shariatzadeh % nothing to do! case PCFLO namefile = regexprep([namefile,'.m'],'^bdat\.','','ignorecase'); @@ -612,7 +633,8 @@ % check whether the selected file is a Simulink model hdl = findobj(Fig.dir,'Tag','PopupMenu1'); type = get(hdl,'Value'); - if type ~= PSATMDL + %if type ~= PSATMDL % old line + if type ~= PSATMDL && type ~= PSATSLX % edit by majid shariatzadeh cd(Path.local) return end @@ -716,6 +738,10 @@ switch ext case 'mdl' open_system(file) + + case 'slx' %add by majid shariatzadeh + open_system(file) %add by majid shariatzadeh + case 'pdf', switch computer case 'GLNX86', eval(['! xpdf ',file, ' &']), @@ -781,32 +807,36 @@ PSAT = 2; PSATPERT = 3; PSATMDL = 4; -CYME = 5; -MATPOWER = 6; -PST = 7; -EPRI = 8; -PSSE = 9; -PSAP = 10; -EUROSTAG = 11; -TH = 12; -CESI = 13; -VST = 14; -SIMPOW = 15; -NEPLAN = 16; -DIGSILENT = 17; -POWERWORLD = 18; -PET = 19; -FLOWDEMO = 20; -GEEPC = 21; -CHAPMAN = 22; -UCTE = 23; -PCFLO = 24; -WEBFLOW = 25; -IPSS = 26; -CEPEL = 27; -ODM = 28; -REDS = 29; -VITRUVIO = 30; % all files + +%edit by Majid Shariatzadeh +PSATSLX = 5; +CYME = 6; +MATPOWER = 7; +PST = 8; +EPRI = 9; +PSSE = 10; +PSAP = 11; +EUROSTAG = 12; +TH = 13; +CESI = 14; +VST = 15; +SIMPOW = 16; +NEPLAN = 17; +DIGSILENT = 18; +POWERWORLD = 19; +PET = 20; +FLOWDEMO = 21; +GEEPC = 22; +CHAPMAN = 23; +UCTE = 24; +PCFLO = 25; +WEBFLOW = 26; +IPSS = 27; +CEPEL = 28; +ODM = 29; +REDS = 30; +VITRUVIO = 31; % all files + a = dir; numfile = find([a.isdir] == 0); @@ -870,6 +900,27 @@ add_file = 1; end end + + %add by Majid shariatzadeh inorder to support SLX file + case PSATSLX + extent = nomefile(max(1,lfile-2):lfile); + if strcmpi(extent,'slx') + if strcmpi(nomefile,'fm_lib.slx') + add_file = 0; + %elseif strcmp(nomefile(1),'d') + % add_file = 1; + %elseif isfile(nomefile,'PSATblock',1000) %% THIS IS TOO SLOW!! + % add_file = 1; + else + add_file = 1; + end + end + + + + + + case PST extent = nomefile(lfile); if strcmpi(extent,'m') && strcmp(nomefile(1),'d') From d2505845888d2aacb824e1a2f65a1b704208c5ee Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Wed, 24 Jun 2020 11:24:53 +0430 Subject: [PATCH 03/10] Update fm_disp.m remove windows error --- psat-mat/psat/fm_disp.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/psat-mat/psat/fm_disp.m b/psat-mat/psat/fm_disp.m index 3792f74..f42819e 100644 --- a/psat-mat/psat/fm_disp.m +++ b/psat-mat/psat/fm_disp.m @@ -103,9 +103,15 @@ 'ForegroundColor', Theme.color07); if Settings.beep, beep, end case 3, - set(Hdl.text, ... - 'String', testo{end,1}, ... - 'ForegroundColor', Theme.color05); + % modified By S.m. Shariatzadeh + if Settings.hostver < 8.0 + set(Hdl.text, ... + 'String', testo{end,1}, ... + 'ForegroundColor', Theme.color05); + else + Hdl.text=testo; + end + end drawnow; end From 1125996911676d7d49b9d50150267dbf9cef9f03 Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Wed, 24 Jun 2020 11:33:13 +0430 Subject: [PATCH 04/10] upgrade fm_lib.mdl to fm_lib.slx --- psat-mat/psat/fm_lib.mdl | 4366 -------------------------------------- 1 file changed, 4366 deletions(-) delete mode 100644 psat-mat/psat/fm_lib.mdl diff --git a/psat-mat/psat/fm_lib.mdl b/psat-mat/psat/fm_lib.mdl deleted file mode 100644 index e14b3e1..0000000 --- a/psat-mat/psat/fm_lib.mdl +++ /dev/null @@ -1,4366 +0,0 @@ -Library { - Name "fm_lib" - Version 6.0 - SavedCharacterEncoding "UTF-8" - LibraryType "BlockLibrary" - SaveDefaultBlockParams on - ScopeRefreshTime 0.035000 - OverrideScopeRefreshTime on - DisableAllScopes off - Created "Sat Jan 13 13:20:27 2001" - Creator "fmilano" - UpdateHistory "UpdateHistoryNever" - ModifiedByFormat "%" - LastModifiedBy "federico" - ModifiedDateFormat "%" - LastModifiedDate "Thu Jan 03 17:55:33 2013" - ModelVersionFormat "1.%" - ConfigurationManager "none" - SampleTimeColors off - LibraryLinkDisplay "none" - WideLines off - ShowLineDimensions off - ShowPortDataTypes off - ShowLoopsOnError on - IgnoreBidirectionalLines off - ShowStorageClass off - ShowTestPointIcons on - ShowViewerIcons on - SortedOrder off - ExecutionContextIcon off - ShowLinearizationAnnotations on - BlockNameDataTip off - BlockParametersDataTip off - BlockDescriptionStringDataTip off - ToolBar off - StatusBar off - BrowserShowLibraryLinks off - BrowserLookUnderMasks off - SimulationMode "normal" - LinearizationMsg "none" - Profile off - ParamWorkspaceSource "MATLABWorkspace" - RecordCoverage off - CovSaveName "covdata" - CovMetricSettings "dw" - CovNameIncrementing off - CovHtmlReporting on - covSaveCumulativeToWorkspaceVar on - CovSaveSingleToWorkspaceVar on - CovCumulativeReport off - CovReportOnPause on - ExtModeBatchMode off - ExtModeEnableFloating on - ExtModeTrigType "manual" - ExtModeTrigMode "normal" - ExtModeTrigPort "1" - ExtModeTrigElement "any" - ExtModeTrigDuration 1000 - ExtModeTrigDurationFloating "auto" - ExtModeTrigHoldOff 0 - ExtModeTrigDelay 0 - ExtModeTrigDirection "rising" - ExtModeTrigLevel 0 - ExtModeArchiveMode "off" - ExtModeAutoIncOneShot off - ExtModeIncDirWhenArm off - ExtModeAddSuffixToVar off - ExtModeWriteAllDataToWs off - ExtModeArmWhenConnect on - ExtModeSkipDownloadWhenConnect off - ExtModeLogAll on - ExtModeAutoUpdateStatusClock off - ShowModelReferenceBlockVersion off - ShowModelReferenceBlockIO off - BlockDefaults { - ForegroundColor "black" - BackgroundColor "white" - DropShadow off - NamePlacement "normal" - FontName "Helvetica" - FontSize 10 - FontWeight "normal" - FontAngle "normal" - ShowName on - Orientation "right" - } - AnnotationDefaults { - HorizontalAlignment "center" - VerticalAlignment "middle" - ForegroundColor "black" - BackgroundColor "white" - DropShadow off - FontName "Helvetica" - FontSize 10 - FontWeight "normal" - FontAngle "normal" - } - LineDefaults { - FontName "Helvetica" - FontSize 9 - FontWeight "normal" - FontAngle "normal" - } - BlockParameterDefaults { - Block { - BlockType Constant - Value "1" - VectorParams1D on - SampleTime "inf" - OutDataTypeMode "Inherit from 'Constant value'" - OutDataType "fixdt(1,16,0)" - ConRadixGroup "Use specified scaling" - OutScaling "[]" - } - Block { - BlockType EnablePort - StatesWhenEnabling "held" - ShowOutputPort off - ZeroCross on - } - Block { - BlockType From - IconDisplay "Tag" - } - Block { - BlockType Goto - IconDisplay "Tag" - TagVisibility "local" - } - Block { - BlockType Inport - Port "1" - BusOutputAsStruct off - PortDimensions "-1" - SampleTime "-1" - SignalType "auto" - SamplingMode "auto" - LatchInput off - Interpolate on - DataType "auto" - OutDataType "fixdt(1,16,0)" - OutScaling "[]" - UseBusObject off - BusObject "BusObject" - } - Block { - BlockType Outport - Port "1" - BusOutputAsStruct off - PortDimensions "-1" - SampleTime "-1" - SignalType "auto" - SamplingMode "auto" - OutputWhenDisabled "held" - InitialOutput "[]" - DataType "auto" - OutDataType "fixdt(1,16,0)" - OutScaling "[]" - UseBusObject off - BusObject "BusObject" - } - Block { - BlockType PMComponent - SubClassName "unknown" - } - Block { - BlockType PMIOPort - } - Block { - BlockType SubSystem - ShowPortLabels "on" - Permissions "ReadWrite" - PermitHierarchicalResolution "All" - TreatAsAtomicUnit off - SystemSampleTime "-1" - RTWFcnNameOpts "Auto" - RTWFileNameOpts "Auto" - SimViewingDevice off - DataTypeOverride "UseLocalSettings" - MinMaxOverflowLogging "UseLocalSettings" - } - Block { - BlockType Terminator - } - } - System { - Name "fm_lib" - Location [168, 203, 569, 449] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "A4" - PaperUnits "inches" - ZoomFactor "100" - ReportName "simulink-default.rpt" - Block { - BlockType SubSystem - Name "Connections" - Tag "PSATfolder" - Description "Connections" - Ports [] - Position [42, 17, 104, 76] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('connections');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Connections" - Location [182, 308, 601, 557] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Bus1" - Tag "PSATblock" - Description "Connection" - Ports [0, 0, 0, 0, 0, 2, 1] - Position [55, 80, 110, 85] - Orientation "down" - BackgroundColor "black" - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0|__newl1" - RConnTagsString "__newr0" - MaskType "Bus" - MaskDescription "Bus block." - MaskPromptString "Number of inputs:|Number of outputs:|Voltage Rating [kV]|Voltage initial guess [p.u. rad]|Area" - " number|Region number" - MaskStyleString "edit,edit,edit,edit,edit,edit" - MaskVariables "in=@1;out=@2;p2q=@3;p3_4q=@4;p5q=@5;p6q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "||||fm_block|" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "fm_inout\n\n" - MaskSelfModifiable on - MaskDisplay "plot([0 1 1 0 0],[0 0 1 1 0])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "2|1|400|[1.00 0.00]|1|1" - } - Block { - BlockType PMComponent - Name "Bus2" - Tag "PSATblock" - Description "Connection" - Ports [0, 0, 0, 0, 0, 3, 2] - Position [55, 121, 60, 189] - BackgroundColor "black" - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0|__newl1|__newl2" - RConnTagsString "__newr0|__newr1" - MaskType "Bus" - MaskDescription "Bus block" - MaskPromptString "Number of inputs:|Number of outputs:|Voltage Rating [kV]|Voltage initial guess [p.u. rad]|Are" - "a number|Region number" - MaskStyleString "edit,edit,edit,edit,edit,edit" - MaskVariables "in=@1;out=@2;p2q=@3;p3_4q=@4;p5q=@5;p6q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "||||fm_block|" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "fm_inout\n\n" - MaskSelfModifiable on - MaskDisplay "plot([0 1 1 0 0],[0 0 1 1 0])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "3|2|400|[1.00 0.00]|1|1" - } - Block { - BlockType SubSystem - Name "Bus3" - Tag "PSATblock" - Description "Connection" - Ports [0, 1, 0, 0, 0, 3, 2] - Position [115, 112, 120, 188] - BackgroundColor "black" - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Bus" - MaskDescription "Bus block." - MaskPromptString "Number of inputs:|Number of outputs:|Voltage Rating [kV]|Voltage initial guess [p.u. rad]|Area" - " number|Region number|Input Signals |Output Signals" - MaskStyleString "edit,edit,edit,edit,edit,edit,popup(0|1|2|3),popup(0|1|2|3)" - MaskVariables "in=@1;out=@2;p2q=@3;p3_4q=@4;p5q=@5;p6q=@6;ins=@7;ous=@8;" - MaskTunableValueString "on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||" - MaskEnableString "on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout" - MaskDisplay "plot([0 1 1 0 0],[0 0 1 1 0])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "3|2|400|[1.00 0.00]|1|1|0|1" - System { - Name "Bus3" - Location [62, 362, 518, 664] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Constant - Name "g1" - Position [130, 20, 155, 50] - } - Block { - BlockType PMComponent - Name "pmc" - Ports [0, 0, 0, 0, 0, 2, 3] - Position [130, 73, 230, 277] - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0|__newl1" - RConnTagsString "__newr0|__newr1|__newr2" - } - Block { - BlockType PMIOPort - Name "pmc_out_0" - Tag "PMCPort" - Position [275, 96, 305, 114] - Orientation "left" - Port "1" - Side "Left" - } - Block { - BlockType PMIOPort - Name "pmc_in_0" - Tag "PMCPort" - Position [65, 116, 95, 134] - Port "2" - Side "Right" - } - Block { - BlockType PMIOPort - Name "pmc_in_1" - Position [65, 216, 95, 234] - Port "3" - Side "Right" - } - Block { - BlockType PMIOPort - Name "pmc_out_1" - Position [275, 166, 305, 184] - Orientation "left" - Port "4" - Side "Left" - } - Block { - BlockType PMIOPort - Name "pmc_out_2" - Position [275, 236, 305, 254] - Orientation "left" - Port "5" - Side "Left" - } - Block { - BlockType Outport - Name "out_1" - Position [185, 25, 205, 45] - IconDisplay "Port number" - } - Line { - LineType "Connection" - SrcBlock "pmc_in_0" - SrcPort RConn1 - DstBlock "pmc" - DstPort LConn1 - } - Line { - LineType "Connection" - SrcBlock "pmc" - SrcPort RConn1 - DstBlock "pmc_out_0" - DstPort RConn1 - } - Line { - SrcBlock "g1" - SrcPort 1 - DstBlock "out_1" - DstPort 1 - } - Line { - LineType "Connection" - SrcBlock "pmc_in_1" - SrcPort RConn1 - DstBlock "pmc" - DstPort LConn2 - } - Line { - LineType "Connection" - SrcBlock "pmc" - SrcPort RConn2 - Points [0, 0] - DstBlock "pmc_out_1" - DstPort RConn1 - } - Line { - LineType "Connection" - SrcBlock "pmc" - SrcPort RConn3 - DstBlock "pmc_out_2" - DstPort RConn1 - } - Annotation { - Name "Tap Changer Under Load " - Position [164, 45] - } - } - } - Block { - BlockType From - Name "From Bus2" - Tag "PSATblock" - Description "Connection" - Position [325, 71, 365, 99] - CloseFcn "tagdialog Close" - GotoTag "A" - } - Block { - BlockType Goto - Name "Goto Bus1" - Tag "PSATblock" - Description "Connection" - Position [250, 70, 290, 100] - GotoTag "A" - } - Block { - BlockType SubSystem - Name "Link1" - Tag "PSATblock" - Description "Connection" - Ports [0, 0, 1, 0, 0, 1, 1] - Position [178, 80, 212, 110] - Orientation "down" - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Link" - MaskDescription "Link block" - MaskInitialization "rot = strcmp(get_param(gcb,'NamePlacement'),'normal');\n" - MaskSelfModifiable on - MaskDisplay "plot([0.45 0],[0.5 0.5],[1 0.55],[0.5 0.5])\ncolor('green')\nplot([0.45 0.55 0.55 0.45 0.45],[0.45 " - "0.45 0.55 0.55 0.45],[0.5 0.5],rot*0.45+[0.1 0.45])\nplot([0.45 0.55 0.55 0.45 0.45],rot*0.9+[0 0 0.1 0.1 0],1-rot," - "1-rot)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - System { - Name "Link1" - Location [716, 243, 980, 409] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType EnablePort - Name "Enable" - Ports [] - Position [125, 115, 145, 135] - } - Block { - BlockType PMComponent - Name "Atomic Subsystem" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [80, 54, 180, 96] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - } - Block { - BlockType PMIOPort - Name "Connection\nPort" - Tag "PMCPort" - Position [15, 66, 45, 84] - ShowName off - Port "1" - Side "Left" - } - Block { - BlockType PMIOPort - Name "Connection\nPort1" - Tag "PMCPort" - Position [220, 66, 250, 84] - Orientation "left" - ShowName off - Port "2" - Side "Right" - } - Line { - LineType "Connection" - SrcBlock "Connection\nPort" - SrcPort RConn1 - DstBlock "Atomic Subsystem" - DstPort LConn1 - } - Line { - LineType "Connection" - SrcBlock "Atomic Subsystem" - SrcPort RConn1 - DstBlock "Connection\nPort1" - DstPort RConn1 - } - Annotation { - Name "Link" - Position [130, 26] - } - } - } - Block { - BlockType SubSystem - Name "Link2" - Tag "PSATblock" - Description "Connection" - Ports [0, 1, 0, 0, 0, 1, 1] - Position [170, 146, 210, 184] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Link2" - MaskDescription "Link block." - MaskDisplay "plot([0 0.45],[0.5 0.5],[0.5 0.5],[0 0.4],[0.5 1],[0 0])\ncolor('green')\nplot([0.5 0.5],[0.6 1],[0" - ".5 0.9],[1 1])\nplot([0.9 0.985 0.985 0.9 0.9],[0.1 0.1 -0.1 -0.1 0.1]+1)\nplot([0.45 0.55 0.55 0.45 0.45],[0.6 0.6" - " 0.4 0.4 0.6])\nplot(0, -0.5,0,1.5)\n\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - System { - Name "Link2" - Location [61, 338, 517, 640] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Constant - Name "g1" - Position [130, 20, 155, 50] - } - Block { - BlockType PMComponent - Name "pmc" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [130, 73, 230, 277] - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - } - Block { - BlockType PMIOPort - Name "pmc_out_0" - Tag "PMCPort" - Position [275, 166, 305, 184] - Orientation "left" - Port "1" - Side "Left" - } - Block { - BlockType PMIOPort - Name "pmc_in_0" - Tag "PMCPort" - Position [65, 166, 95, 184] - Port "2" - Side "Right" - } - Block { - BlockType Outport - Name "out_1" - Position [185, 25, 205, 45] - IconDisplay "Port number" - } - Line { - SrcBlock "g1" - SrcPort 1 - DstBlock "out_1" - DstPort 1 - } - Line { - LineType "Connection" - SrcBlock "pmc" - SrcPort RConn1 - DstBlock "pmc_out_0" - DstPort RConn1 - } - Line { - LineType "Connection" - SrcBlock "pmc_in_0" - SrcPort RConn1 - DstBlock "pmc" - DstPort LConn1 - } - Annotation { - Name "Tap Changer Under Load " - Position [164, 45] - } - } - } - Block { - BlockType SubSystem - Name "Varname" - Tag "PSATblock" - Description "OPF & CPF" - Ports [] - Position [273, 145, 358, 182] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Varname" - MaskDescription "This block defines the indexes of the variables to be plotted." - MaskPromptString "Plot variable list" - MaskStyleString "edit" - MaskVariables "pxq=@1;" - MaskTunableValueString "on" - MaskEnableString "on" - MaskVisibilityString "on" - MaskToolTipString "on" - MaskDisplay "plot([-2 22 22 -2 -2],[-1.1 -1.1 1.1 1.1 -1.1])\ncolor('blue')\ntext(0,0.1,'Plot variable list')" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[]" - System { - Name "Varname" - Location [477, 86, 744, 293] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Annotation { - Position [139, 85] - } - } - } - Annotation { - Name "Buses & Connections" - Position [215, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Link" - Position [166, 118] - } - Annotation { - Name "Link2" - Position [196, 197] - } - Annotation { - Name "Varname" - Position [317, 197] - } - } - } - Block { - BlockType SubSystem - Name "Controls" - Tag "PSATfolder" - Description "Controls" - Ports [] - Position [223, 95, 276, 147] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('controls');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Controls" - Location [710, 337, 1059, 608] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType SubSystem - Name "Cac" - Tag "PSATblock" - Description "Controls" - Ports [1, 2] - Position [265, 129, 310, 156] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Cac" - MaskDescription "This block defines a Central Area Controller" - MaskPromptString "Number of connected clusters|Integral gain constant KI|Proportional gain constant KP|Control si" - "gnal limits q_max, q_min|Connected" - MaskStyleString "popup(1|2|3|4|5|6|7|8|9|10|11|12),edit,edit,edit,checkbox" - MaskVariables "p4q=@1;p6q=@2;p7q=@3;p8_9q=@4;p10q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "||||fm_block" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskInitialization "fm_inout\n[x,y] = fm_draw('C');" - MaskDisplay "plot([1 0 0 1 1],[1 1 0 0 1])\ncolor('red')\nplot([0.35 0.5 0.65],[0.2 0.8 0.2],[0.4 0.6],[0.4 0.4]" - ")\nplot(0.1+0.2*x,0.5+0.6*y,0.7+0.2*x,0.5+0.6*y)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "2|0.02|1|[1.1 0.9]|on" - System { - Name "Cac" - Location [381, 229, 701, 459] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Inport - Name "In1" - Position [130, 150, 150, 170] - ShowName off - IconDisplay "Port number" - } - Block { - BlockType Constant - Name "Constant" - Position [55, 85, 85, 115] - ShowName off - } - Block { - BlockType Constant - Name "Constant1" - Position [170, 85, 200, 115] - ShowName off - } - Block { - BlockType Terminator - Name "Terminator4" - Position [180, 150, 200, 170] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [125, 93, 155, 107] - ShowName off - IconDisplay "Port number" - } - Block { - BlockType Outport - Name "Out2" - Position [240, 93, 270, 107] - ShowName off - Port "2" - IconDisplay "Port number" - } - Line { - SrcBlock "Constant1" - SrcPort 1 - DstBlock "Out2" - DstPort 1 - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "Terminator4" - DstPort 1 - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Central Area Control" - Position [164, 45] - } - } - } - Block { - BlockType SubSystem - Name "Cluster" - Tag "PSATblock" - Description "Controls" - Ports [1, 1] - Position [265, 61, 295, 89] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Cluster" - MaskDescription "This block defines Cluster Controler (Secondary Voltage Regulator)." - MaskPromptString "Integral time constant T [s]|Equivalent reactance Xtg [p.u.]|Equivalent reactance Xeq [p.u.]|Ou" - "tput signal limits Vs_max, Vs_min|Connected" - MaskStyleString "edit,edit,edit,edit,checkbox" - MaskVariables "p4q=@1;p5q=@2;p6q=@3;p8_9q=@4;p10q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "||||fm_block" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('C');" - MaskDisplay "plot([1 0 0 1 1],[1 1 0 0 1])\ncolor('red')\nplot(0.1+0.3*x,0.5+0.6*y,0.6+0.3*x,0.5+0.6*y)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "5|0|1|[0.15 -0.2]|on" - System { - Name "Cluster" - Location [381, 229, 648, 436] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Inport - Name "In1" - Position [110, 150, 130, 170] - ShowName off - IconDisplay "Port number" - } - Block { - BlockType Constant - Name "Constant" - Position [90, 80, 120, 110] - ShowName off - } - Block { - BlockType Terminator - Name "Terminator4" - Position [160, 150, 180, 170] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [160, 88, 190, 102] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "Terminator4" - DstPort 1 - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Cluster Controller" - Position [139, 45] - } - } - } - Block { - BlockType SubSystem - Name "Exc" - Tag "PSATblock" - Description "Controls" - Ports [2, 1] - Position [160, 64, 205, 91] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Exc" - MaskDescription "This block defines an Automatic Voltage Regulator." - MaskHelp "This block defines an Automatic Voltage Regulator.\nThere are three kind of regulators:\n\nType 1:\n\n" - " IEEE Model 1\n\nType 2:\n\n IEEE Model 2\n\nType 3:\n \n IEEE Model 3" - MaskPromptString "Automatic Voltage Regulator Type|Maximum Regulator Voltage [p.u.]|Minimum Regulator Voltage [p." - "u.]|Regulator Gain m0 [p.u./p.u.]|First Regulator Pole T1 [s]|First Regulator Zero T2 [s]|Second Regulator Pole T3 " - "[s]|Second Regulator Zero T4 [s]|Time Constant of the Field Circuit Td [s]|Time Delay of the Measurement System Tr " - "[s]|Coefficient of the Ceiling Function (A B)|Number of input signals|Connected" - MaskStyleString "popup(1|2|3),edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,popup(0|1|2|3),checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;p5q=@4;p6q=@5;p7q=@6;p8q=@7;p9q=@8;p10q=@9;p11q=@10;p12_13q=@11;in=@12;p14q=" - "@13;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "fm_block||||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout\n[x,y] = fm_draw('R');" - MaskDisplay "plot([-1.8 4.1 4.1 -1.8 -1.8],[-1.5 -1.5 1.5 1.5 -1.5])\ncolor('red')\nplot([-1.3 -0.5],[-1 1],[-0." - "5 0.3],[1 -1],[-0.9 -0.1],[0.0 0.0])\nplot(2.8+1.3*x,2*y,1.5+[-1.3 -0.5],[1 -1],1.5+[-0.5 0.3],[-1 1])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "1|5.00|-5.00|400|0.10|0.45|1.00|0.01|1.00|0.001|[0.0006 0.9]|2|on" - System { - Name "Exc" - Location [158, 247, 492, 439] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Inport - Name "in_1" - Position [25, 25, 45, 45] - IconDisplay "Port number" - } - Block { - BlockType Inport - Name "in_2" - Position [25, 75, 45, 95] - Port "2" - IconDisplay "Port number" - } - Block { - BlockType Constant - Name "Constant" - Position [170, 100, 200, 130] - ShowName off - } - Block { - BlockType Terminator - Name "t1" - Position [80, 20, 105, 50] - } - Block { - BlockType Terminator - Name "t2" - Position [80, 70, 105, 100] - } - Block { - BlockType Outport - Name "Out1" - Position [240, 105, 260, 125] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Line { - SrcBlock "in_1" - SrcPort 1 - DstBlock "t1" - DstPort 1 - } - Line { - SrcBlock "in_2" - SrcPort 1 - DstBlock "t2" - DstPort 1 - } - Annotation { - Name "Automatic Voltage Regulator" - Position [234, 30] - } - } - } - Block { - BlockType SubSystem - Name "Oxl" - Tag "PSATblock" - Description "Controls" - Ports [0, 1] - Position [160, 132, 205, 158] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Oxl" - MaskDescription "This block defines a breaker." - MaskPromptString "Integrator time constant T0 [s]|Use generator Xd and Xq|d-axis estimated reactance Xd [p.u.]|q-" - "axis estimated reactance Xq [p.u.]|Maximum Field Current [p.u.]|Maximum output signal [p.u.]|Connected" - MaskStyleString "edit,checkbox,edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;p5q=@4;p6q=@5;p7q=@6;p8q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "|fm_block|||||fm_block" - MaskEnableString "on,on,off,off,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('O');" - MaskDisplay "plot([-1.8 4.1 4.1 -1.8 -1.8],[-1.5 -1.5 1.5 1.5 -1.5])\ncolor('red')\nplot(1.8+[-1.3 0],[1 -1],1.8" - "+[-1.3 0],[-1 1])\nplot(1.5*x-1.2,2*y,[2.3 2.3],[1 -1],[2.3 3.6],[-1 -1])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "10|on|0.2|0.18|2.7|0.05|on" - System { - Name "Oxl" - Location [287, 280, 621, 472] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Constant - Name "Constant" - Position [120, 105, 150, 135] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [190, 110, 210, 130] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Overexcitation\nLimiter" - Position [164, 45] - } - } - } - Block { - BlockType SubSystem - Name "Pod" - Tag "PSATblock" - Description "Controls" - Ports [1, 1] - Position [200, 217, 245, 243] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Pod" - MaskDescription "This block defines a Suplementary Stabilizing Control Loop." - MaskPromptString "Input signal: |Vmax and Vmin Stabilizer Output [p.u., p.u.]|Gain Kw and time constant Tw [p.u." - "/p.u., s]|Lead-Lag time constants T1 and T2 [s, s]|Lead-Lag time constants T3 and T4 [s, s]|Connected" - MaskStyleString "popup(Bus_V|Line_P_from_bus|Line_P_to_bus|Line_I_from_bus|Line_I_to_bus|Line_Q_from_bus|Line_Q_t" - "o_bus),edit,edit,edit,edit,checkbox" - MaskVariables "p3q=@1;p5_6q=@2;p7_8q=@3;p9_10q=@4;p11_12q=@5;p13q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "fm_block|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[xP,yP] = fm_draw('P');\n[xO,yO] = fm_draw('O');\n[xD,yD] = fm_draw('D');" - MaskDisplay "plot([-1.8 4.8 4.8 -1.8 -1.8],[-1.5 -1.5 1.5 1.5 -1.5])\ncolor('red')\nplot(1.5*xP-0.7,2*yP,0.7+1.5" - "*xO,2*yO,3.5+1.5*xD,2*yD)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "Bus_V|[0.2 -0.2]|[-0.1 5]|[0.4 0.2]|[0.4 0.2]|on" - System { - Name "Pod" - Location [32, 214, 364, 386] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Inport - Name "In1" - Position [125, 110, 145, 130] - ShowName off - IconDisplay "Port number" - } - Block { - BlockType Constant - Name "Constant" - Position [115, 60, 145, 90] - ShowName off - } - Block { - BlockType Terminator - Name "Terminator4" - Position [175, 110, 195, 130] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [185, 65, 205, 85] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "In1" - SrcPort 1 - DstBlock "Terminator4" - DstPort 1 - } - Line { - SrcBlock "Constant" - SrcPort 1 - Points [0, 0] - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Suplementary Stabilizing Control Loop for SVCs" - Position [162, 17] - } - } - } - Block { - BlockType SubSystem - Name "Pss" - Tag "PSATblock" - Description "Controls" - Ports [0, 1] - Position [50, 132, 90, 158] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Pss" - MaskDescription "This block defines a Power System Stabilizer." - MaskPromptString "PSS model|Input Signal|Max and Min Stabilizer Output [p.u.]|Gain Kw and time constant Tw [p.u." - "/p.u., s]|Electrical power gain Kp and voltage gain Kv [p.u./p.u., p.u./p.u.]|Lead-Lag time constants T1, T2, T3, T" - "4 [s, s, s, s]|Gain Ka and time constant Ta [p.u./p.u., s]|Additional signal limits Va_max, Va_thr, V3_max and V3_m" - "in [p.u., p.u., p.u., p.u.]|Threshold limits E_thr and w_thr [p.u., p.u.]|Allow switch S2|Connected" - MaskStyleString "popup(1|2|3|4|5),popup(omega|power|voltage),edit,edit,edit,edit,edit,edit,edit,checkbox,checkbox" - MaskVariables "p2q=@1;p3q=@2;p4_5q=@3;p6_7q=@4;p14_15q=@5;p8_9_10_11q=@6;p12_13q=@7;p16_17_18_19q=@8;p20_21q=@9;" - "p22q=@10;p23q=@11;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "fm_block||||||||||fm_block" - MaskEnableString "on,on,on,on,off,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[xs,ys] = fm_draw('S');\n[xp,yp] = fm_draw('P');" - MaskDisplay "plot([-1.8 4.1 4.1 -1.8 -1.8],[-1.5 -1.5 1.5 1.5 -1.5])\ncolor('red')\nplot(1.5*xp-0.7,2*yp,1.2+1.5" - "*xs,2*ys,2.8+1.5*xs,2*ys)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "4|omega|[0.05 -0.05]|[50 0.5]|20 5|[0.1 0.05 0.01 0.005]|[25 0.5]|[0.045 0.045 0.045 -0.045" - "]|[1.000 0.95]|off|on" - System { - Name "Pss" - Location [67, 205, 401, 397] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Constant - Name "Constant" - Position [120, 100, 150, 130] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [190, 105, 210, 125] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Power System Stabilizer" - Position [164, 45] - } - } - } - Block { - BlockType SubSystem - Name "Tg" - Tag "PSATblock" - Description "Controls" - Ports [0, 1] - Position [55, 66, 95, 94] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Tg" - MaskDescription "This block defines a Turbine Governor." - MaskPromptString "Turbine governor type|Reference speed [p.u.]|Pilot valve droop [p.u./p.u.]|Maximum torque [p.u." - "]|Minimum torque [p.u.]|Maximum gate opening rate vmax [p.u.]|Minimum gate opening rate vmin [p.u.]|Pilot valve tim" - "e constant Tp[s]|Dashpot time constant Tr[s]|Permanent speed droop sigma[p.u./p.u.]|Temporary speed droop delta[p.u" - "./p.u.]|Water starting time Tw[s]|Patical derivative of turbine flow rate with respect to tubine head a11|Patical d" - "erivative of turbine flow rate with respect to gate position a13|Patical derivative of turbine torque with respect " - "to tubine head a21|Patical derivative of turbine torque with respect to gate position a23|Proportional droop Kp [p." - "u./p.u.]|Integral droop Ki [p.u./p.u.]|Connected" - MaskStyleString "popup(1|2|3|4|5|6),edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,ed" - "it,edit,checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;p5q=@4;p6q=@5;p7q=@6;p8q=@7;p9q=@8;p10q=@9;p11q=@10;p12q=@11;p13q=@12;p14q=@" - "13;p15q=@14;p16q=@15;p17q=@16;p18q=@17;p19q=@18;p20q=@19;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "fm_block||||||||||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('G');" - MaskDisplay "plot([-1.8 2.8 2.8 -1.8 -1.8],[-1.5 -1.5 1.5 1.5 -1.5])\ncolor('red')\nplot([-0.5 -0.5],[-1 1],[-1." - "3 0.3],[1 1])\nplot(1.4+x,y)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "4|1.00|0.2|1.0|0.0|0.10|-0.10|0.04|5.0|0.04|0.3|1.0|0.5|1.0|1.5|1.0|1.163|0.105|on" - System { - Name "Tg" - Location [154, 243, 488, 435] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Constant - Name "Constant" - Position [115, 100, 145, 130] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [185, 105, 205, 125] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Turbine Governor" - Position [164, 45] - } - } - } - Annotation { - Name "Controls" - Position [175, 28] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Turbine\nGovernor" - Position [69, 107] - } - Annotation { - Name "Automatic Voltage\nRegulator" - Position [181, 106] - } - Annotation { - Name "Cluster \nController" - Position [283, 107] - } - Annotation { - Name "Central Area\nController" - Position [281, 180] - } - Annotation { - Name "Over Excitation \nLimiter" - Position [181, 179] - } - Annotation { - Name "Power System\nStabilizer" - Position [68, 180] - } - Annotation { - Name "Power Oscillation\nDamper" - Position [141, 228] - } - } - } - Block { - BlockType SubSystem - Name "FACTS" - Tag "PSATfolder" - Description "FACTS" - Ports [] - Position [54, 163, 101, 212] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('facts');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "FACTS" - Location [1994, 281, 2404, 672] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Hvdc" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [135, 179, 355, 221] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Hvdc" - MaskDescription "This block defines a HVDC connection." - MaskPromptString "Power and Frequency Ratings [MVA, Hz]|Voltage Rating at Terminal Buses [kV, kV]|DC Ratings (Vn" - "_dc, In_dc) [kV, kA]|Transformer Reactances (Xcr Xci) [p.u. p.u.]|Tap Ratios (Ar Ai) [p.u./p.u. p.u./p.u.]|PI Re" - "gulator Constants (Ki, Kp)|DC Line Parameters (Rdc Ldc) [p.u. p.u.]|Rectifier Angle Limits (a_max, a_min) [deg de" - "g]|Inverter Angle Limits (g_max, g_min) [deg deg]|Reference Current Limits (I0rmax I0rmin I0imax I0imin) [p.u.]|Co" - "ntrol type|Current, active power and dc voltage orders [p.u. p.u. p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,popup(Current_control|Power_control|Voltage_co" - "ntrol),edit,checkbox" - MaskVariables "p3_6q=@1;p4_5q=@2;p7_8q=@3;p9_10q=@4;p11_12q=@5;p13_14q=@6;p15_16q=@7;p17_18q=@8;p19_20q=@9;p21_2" - "2_23_24q=@10;p25q=@11;p26_27_28q=@12;p29q=@13;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||||fm_block||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');" - MaskDisplay "plot(0.7+[0 4 4 0 0],[-2 -2 2 2 -2])\nplot(9.7+[0 4 4 0 0],[-2 -2 2 2 -2])\nplot([4.7 9.7],[-1.25 -" - "1.25],[4.7 9.7],[1.25 1.25])\n\nplot(x-2,y,x-0.6,y,x+15,y,x+16.4,y)\ncolor('green')\nplot(-2+[-1 -1.3],[0 0],-2+[2." - "4 2.7],[0 0])\nplot(-2+[-0.8 0.7],[-1.2 1.2],-2+[0.5 0.7],[1.1 1.2],-2+[0.7 0.7],[1.0 1.2])\nplot(15+[-1 -1.3],[0 0" - "],15+[2.4 2.7],[0 0])\nplot(16.4+[-0.8 0.7],[-1.2 1.2],16.4+[0.5 0.7],[1.1 1.2],16.4+[0.7 0.7],[1.0 1.2])\n\ncolor(" - "'magenta')\ntext(1.1,1.2,'R')\ntext(10.1,1.2,'I')\nplot(0.7+[1 3 2 1],[-0.9 -0.9 0.9 -0.9])\nplot(9.7+[1 3 2 1],[-0" - ".9 -0.9 0.9 -0.9])\nplot(0.7+[2 2],[0.9 1.25],0.7+[2 2],[-0.9 -1.25],0.7+[1.2 2.8],[0.9 0.9])\nplot(9.7+[2 2],[0.9 " - "1.25],9.7+[2 2],[-0.9 -1.25],9.7+[1.2 2.8],[0.9 0.9])\nplot(0.7+[2 2.5],[0.9 1.25],9.7+[2 2.5],[0.9 1.25])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[1000 60]|[400 400]|[400 2.5]|[0.1345 0.1257]|[1.25 1.25]|[20 25]|[0.0625 0.200]|[120 5" - "]|[40 18]|[1.0 0.1 0.9 0.0]|Current_control|[0.5 0.6 1.0]|on" - } - Block { - BlockType PMComponent - Name "Sssc" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [330, 160, 370, 340] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Sssc" - MaskDescription "This block describes a SSSC component." - MaskHelp "Tree control methodology are available:\n\nType 1, Magnitude control: m controls AC voltage by mean of" - " a lead-lag transfer function, whereas alpha controls DC voltage by mean of a PI regulator.\n\nType 2, Phase contro" - "l: alpha controls AC voltage by mean of a PI regulator along with a lead-lag transfer function, whereas m is kept a" - "t 0.9.\n\nType 3, Phase control: alpha controls AC voltage by mean of a two poles and one zero transfer function, w" - "hereas m is kept at 0.9. In this case parameters Kp and Ki are respectively the gain and the time constant of the l" - "ow pass filter." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Operation mode: |Scheduling strategy: |Perc" - "entage of series compensation Cp [%]|Regulator time constant Tr [s]|Max and Min voltage [p.u. p.u.]|Porportional a" - "nd integral gains KP and KI |Connected" - MaskStyleString "edit,popup(constant_voltage|constant_reactance|constant_power),popup(constant_line_power|constan" - "t_angle),edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p2q=@2;p10q=@3;p6q=@4;p7q=@5;p8_9q=@6;p11_12q=@7;p13q=@8;" - MaskTunableValueString "on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block||||||fm_block" - MaskEnableString "on,on,off,on,on,on,off,on" - MaskVisibilityString "on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xc,yc] = fm_draw('cap');\n[xa,ya] = fm_draw('acdc2');" - MaskDisplay "plot([0.3 0.3 -0.95 -0.95 0.3],[-1.7 2.7 2.7 -1.7 -1.7])\nplot([-0.75 -0.75 -0.4],[-1.7 -5 -5],[0.1" - " 0.1 -0.25],[-1.7 -5 -5],[-0.4 -0.4],[-4 -6])\nplot(-0.15+0.1*xc,-5+yc)\nplot([-0.325 -0.325],[2.7 3.5],[-0.575 -0." - "95],[5.9 5.9],[-0.075 0.3],[5.9 5.9],0,17.8)\nplot(0.25*x-0.325,4.5+y,0.25*x-0.325,5.9+y)\n\ncolor('magenta')\nplot" - "(xa,ya)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|constant_voltage|constant_line_power|25|0.1|[1.15 0.85]|[10 50]|on" - } - Block { - BlockType PMComponent - Name "Statcom" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1] - Position [49, 240, 91, 340] - Orientation "down" - NamePlacement "alternate" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Statcom" - MaskDescription "This block describes a StatCom component." - MaskHelp "Tree control methodology are available:\n\nType 1, Magnitude control: m controls AC voltage by mean of" - " a lead-lag transfer function, whereas alpha controls DC voltage by mean of a PI regulator.\n\nType 2, Phase contro" - "l: alpha controls AC voltage by mean of a PI regulator along with a lead-lag transfer function, whereas m is kept a" - "t 0.9.\n\nType 3, Phase control: alpha controls AC voltage by mean of a two poles and one zero transfer function, w" - "hereas m is kept at 0.9. In this case parameters Kp and Ki are respectively the gain and the time constant of the l" - "ow pass filter." - MaskPromptString "Power, voltage and frequency ratings [MVA, kV, Hz]|Gain and time constant of the current contro" - "l Kr, Tr [p.u./p.u. s]|Max and Min Current [p.u. p.u.]|Connected" - MaskStyleString "edit,edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p5_6q=@2;p7_8q=@3;p9q=@4;" - MaskTunableValueString "on,on,on,on" - MaskCallbackString "|||fm_block" - MaskEnableString "on,on,on,on" - MaskVisibilityString "on,on,on,on" - MaskToolTipString "on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xc,yc] = fm_draw('cap');\n[xa,ya] = fm_draw('acdc2');\n" - MaskDisplay "plot([9.2 4.8 4.8 9.2 9.2],[0.3 0.3 -0.95 -0.95 0.3])\nplot([9.2 12.5 12.5],[-0.75 -0.75 -0.4],[9." - "2 12.5 12.5],[0.1 0.1 -0.25],[11.5 13.5],[-0.4 -0.4])\nplot(12.5-yc,-0.15+0.1*xc)\nplot([4.8 4],[-0.325 -0.325],[0" - ".6 0],[-0.325 -0.325])\nplot(3-y,0.25*x-0.325,1.6-y,0.25*x-0.325)\ncolor('magenta'), plot(7.5-ya,xa)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|[50 0.1]|[1.2 0.8]|on" - } - Block { - BlockType PMComponent - Name "Svc" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1] - Position [59, 75, 81, 125] - Orientation "down" - NamePlacement "alternate" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Svc" - MaskDescription "This block describes an SVC component." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Model Type|Regulator Time Constant Tr [s]|Re" - "gulator Gain Kr [p.u./p.u.]|Reference Voltage [p.u.]|B_max and B_min [p.u. p.u.]|Integral deviation Kd and transie" - "nt time constant T1 [p.u. s]|Measurement gain and time delay Km, Tm [p.u. s]|Inductive and capacitive reactances Xl" - " and Xc [p.u. p.u.]|Connected" - MaskStyleString "edit,popup(1|2),edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p5q=@2;p6q=@3;p7q=@4;p8q=@5;p9_10q=@6;p11_12q=@7;p13_14q=@8;p15_16q=@9;p17q=@10;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,off,off,off,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[xi,yi] = fm_draw('ind');\n[xc,yc] = fm_draw('cap');\n[xa,ya] = fm_draw('acdc');" - MaskDisplay "plot([1 0.8],[0.5 0.5],[0 0.2],[0.5 0.5],[0.8 0.8 0.2 0.2 0.8],[0 1 1 0 0]), plot([1 1],[-0.1 1.1]," - "[1.05 1.05],[0.1 0.9],[1.1 1.1],[0.3 0.7]), color('green'), plot([0.1 0.3 0.7 0.9],[-0.4 -0.4 1.4 1.4])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|1|10|100|1.00|[1.00 -1.00]|[0.001 0.000]|[1.000 0.01]|[0.20 0.10]|on" - } - Block { - BlockType PMComponent - Name "Svc2" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1] - Position [120, 75, 150, 135] - Orientation "down" - NamePlacement "alternate" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Svc" - MaskDescription "This block describes an SVC component." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Model Type|Regulator Time Constant T2 [s]|Re" - "gulator Gain K [p.u./p.u.]|Reference Voltage [p.u.]|Alpha_max and Alpha_min [rad rad]|Integral deviation Kd and tra" - "nsient time constant T1 [p.u. s]|Measurement gain and time delay Km, Tm [p.u. s]|Inductive and capacitive reactance" - "s Xl and Xc [p.u. p.u.]|Connected" - MaskStyleString "edit,popup(1|2),edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p5q=@2;p6q=@3;p7q=@4;p8q=@5;p9_10q=@6;p11_12q=@7;p13_14q=@8;p15_16q=@9;p17q=@10;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block||||||||" - MaskEnableString "on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[xi,yi] = fm_draw('ind');\n[xc,yc] = fm_draw('cap');\n[xa,ya] = fm_draw('acdc');" - MaskDisplay "plot([-1.6 -1.8 -1.8],[0.5 0.5 4],[0.2 0.2],[0.5 4],[-0.9 -0.9],[3 5],[0 0.2],[0.5 0.5],[-0.65 -0.8" - "5],[0.5 0.5],[-1.8 -0.9],[4 4],[0.2 -0.8],[4 4],[0.2 0.4],[1.9 1.9],[-1.8 -2],[1.9 1.9],[0.4 0.4],[2.9 0.9],[0.5 0." - "5],[2.5 1.3],[0.6 0.6],[2.1 1.7]), plot(-0.7+0.1*xc,4+yc,-1.15+0.175+0.125*yi,0.5+0.5*xi,-1.15-0.325+0.125*yi,0.5+0" - ".5*xi,-1.15-0.075+0.125*yi,0.5+0.5*xi), color('magenta'), plot(xa,ya)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|2|10|100|1.00|[1.00 -1.00] |[0.001 0.000]|[1.000 0.01]|[0.20 0.10]|on" - } - Block { - BlockType PMComponent - Name "Tcsc" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [210, 78, 265, 102] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Tcsc" - MaskDescription "This block describes a TCSC component." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Model type:|Operation mode:|Scheduling strat" - "egy:|Percentage of series compensation [%]|Regulator time constant Tr [s]|Xc_max and Xc_min [p.u. p.u.]|Proportion" - "al and Integral gains Kp and Ki |XL and XC [p.u. p.u.]|Gain for stabilizing signal Kr [p.u./p.u.]|Connected" - MaskStyleString "edit,popup(Xc|Alpha),popup(constant_admittance|constant_power_flow),popup(constant_line_power|co" - "nstant_angle),edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p5_6_7q=@1;p2q=@2;p3q=@3;p4q=@4;p8q=@5;p9q=@6;p10_11q=@7;p12_13q=@8;p14_15q=@9;p16q=@10;p17q=@11;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block|||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,off,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[xi,yi] = fm_draw('ind');\n[xc,yc] = fm_draw('cap');\n[xa,ya] = fm_draw('acdc');" - MaskDisplay "plot([1 0.8],[0.5 0.5],[0 0.2],[0.5 0.5],[0.8 0.8 0.2 0.2 0.8],[0 1 1 0 0]), color('green'), plot([" - "0.1 0.3 0.7 0.9],[-0.4 -0.4 1.4 1.4])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|Xc|constant_power_flow|constant_line_power|10|0.5|[0.5 -0.5 ]|[5 1]|[0.2 0.1" - "]|10|on" - } - Block { - BlockType PMComponent - Name "Tcsc1" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [300, 75, 365, 105] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Tcsc" - MaskDescription "This block describes a TCSC component." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Model type:|Operation mode:|Scheduling strat" - "egy:|Percentage of series compensation [%]|Regulator time constant Tr [s]|Alpha_max and Alpha_min [rad rad]|Propor" - "tional and Integral gains Kp and Ki |XL and XC [p.u. p.u.]|Gain for stabilizing signal Kr [p.u./p.u.]|Connected" - MaskStyleString "edit,popup(Xc|Alpha),popup(constant_admittance|constant_power_flow),popup(constant_line_power|co" - "nstant_angle),edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p5_6_7q=@1;p2q=@2;p3q=@3;p4q=@4;p8q=@5;p9q=@6;p10_11q=@7;p12_13q=@8;p14_15q=@9;p16q=@10;p17q=@11;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block|||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[xi,yi] = fm_draw('ind');\n[xc,yc] = fm_draw('cap');\n[xa,ya] = fm_draw('acdc');" - MaskDisplay "plot([-1.6 -1.8 -1.8],[0.5 0.5 4],[0.2 0.2],[0.5 4],[-0.9 -0.9],[3 5],[0 0.2],[0.5 0.5],[-0.65 -0.8" - "5],[0.5 0.5],[-1.8 -0.9],[4 4],[0.2 -0.8],[4 4],[0.2 0.4],[1.9 1.9],[-1.8 -2],[1.9 1.9]), plot(-0.7+0.1*xc,4+yc,-1." - "15+0.175+0.125*yi,0.5+0.5*xi,-1.15-0.325+0.125*yi,0.5+0.5*xi,-1.15-0.075+0.125*yi,0.5+0.5*xi), \ncolor('magenta'), " - "plot(xa,ya)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|Alpha|constant_power_flow|constant_line_power|10|0.5|[0.5 -0.5 ]|[5 1]|[0.2 " - "0.1]|10|on" - } - Block { - BlockType PMComponent - Name "Upfc" - Tag "PSATblock" - Description "FACTS" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [160, 187, 275, 333] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Upfc" - MaskDescription "This block describes a UPFC component." - MaskHelp "Tree control methodology are available:\n\nType 1, Magnitude control: m controls AC voltage by mean of" - " a lead-lag transfer function, whereas alpha controls DC voltage by mean of a PI regulator.\n\nType 2, Phase contro" - "l: alpha controls AC voltage by mean of a PI regulator along with a lead-lag transfer function, whereas m is kept a" - "t 0.9.\n\nType 3, Phase control: alpha controls AC voltage by mean of a two poles and one zero transfer function, w" - "hereas m is kept at 0.9. In this case parameters Kp and Ki are respectively the gain and the time constant of the l" - "ow pass filter." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Operation mode: |Percentage of series compen" - "sation Cp [%]|Gain and time constant Kr and Tr [p.u./p.u. s]|Max and min Vp [p.u. p.u.]|Max and min Vq [p.u. p.u.]|" - "Max and min Iq [p.u. p.u.]|Stabilizing Vp signal (series voltage)|Stabilizing Vq signal (quadrature voltage)|Stabil" - "izing Iq signal (quadrature current)|Connected" - MaskStyleString "edit,popup(constant_voltage|constant_reactance),edit,edit,edit,edit,edit,checkbox,checkbox,check" - "box,checkbox" - MaskVariables "p3_4_5q=@1;p2q=@2;p6q=@3;p7_8q=@4;p9_10q=@5;p11_12q=@6;p13_14q=@7;p15q=@8;p16q=@9;p17q=@10;p18q=@" - "11;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xc,yc] = fm_draw('ind');\n[xa,ya] = fm_draw('acdc2');" - MaskDisplay "plot([0.3 0.3 -0.95 -0.95 0.3],[-1.7 2.7 2.7 -1.7 -1.7])\nplot(-2+[0.3 0.3 -0.95 -0.95 0.3],[-1.7 2" - ".7 2.7 -1.7 -1.7])\nplot([-2.325 -2.325],[2.7 3.5],[-2.325 -2.325],[6.9 7.5])\nplot(0.25*x-2.325,4.5+y,0.25*x-2.325" - ",5.9+y)\nplot([-0.325 -0.325],[2.7 5.1],[-0.575 -2.95],[7.5 7.5],[-0.075 0.3],[7.5 7.5],0,16.7)\nplot(0.25*x-0.325," - "6.1+y,0.25*x-0.325,7.5+y)\nplot([-0.95 -1.7],[2.2 2.2],[-0.95 -1.7],[-1.2 -1.2])\nplot([-1.325+0.175 -1.325-0.175]" - ",[0.75 0.75],[-1.325 -1.325],[2.2 0.75],[-1.325 -1.325],[0.35 -1.2])\nplot(-1.325+0.175*yc,0.1+0.25*xc)\n\ncolor('m" - "agenta')\nplot(xa,ya)\nplot(xa-2,ya)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|constant_voltage|25|[50 0.1]|[1.15 0.85]|[1.15 0.85]|[1.1 0.9]|on|on|on|on" - } - Annotation { - Name "Flexible AC Transmission Systems" - Position [208, 35] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "TCSC (model 2)" - Position [333, 124] - } - Annotation { - Name "TCSC\n(model 1)" - Position [237, 122] - } - Annotation { - Name "SVC\n(model 1)" - Position [72, 148] - } - Annotation { - Name "SVC\n(model 2)" - Position [167, 131] - } - Annotation { - Name "HVDC\nTransmission\nLine" - Position [74, 199] - } - Annotation { - Name "StatCom" - Position [71, 352] - } - Annotation { - Name "UPFC" - Position [218, 350] - } - Annotation { - Name "SSSC" - Position [352, 353] - } - } - } - Block { - BlockType SubSystem - Name "Faults & \nBreakers" - Tag "PSATfolder" - Description "Switches" - Ports [] - Position [301, 22, 351, 70] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('fault');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Faults & \nBreakers" - Location [1363, 461, 1639, 611] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Breaker" - Tag "PSATblock" - Description "Faults & Breakers" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [190, 75, 210, 95] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Breaker" - MaskDescription "This block defines a transmission line breaker." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Initially close|First intervention time [s]|" - "Second intervention time [s]|Apply first intervention|Apply second intervention" - MaskStyleString "edit,checkbox,edit,edit,checkbox,checkbox" - MaskVariables "p3_4_5q=@1;p6q=@2;p7q=@3;p8q=@4;p9q=@5;p10q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|fm_block||||" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskDisplay "plot([1 2 2 1 1],[-1 -1 1 1 -1]),color('red'),plot([1 2],[-1 1],[2 1],[-1 1])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|on|0.00|0.00|on|on" - } - Block { - BlockType PMComponent - Name "Fault" - Tag "PSATblock" - Description "Faults & Breakers" - Ports [0, 0, 0, 0, 0, 1] - Position [53, 80, 77, 120] - Orientation "down" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Fault" - MaskDescription "This block defines a three phase fault." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Fault Time [s]|Fault Clearing Time [s]|Fault" - " Resistance [p.u.]|Fault Reactance [p.u.]" - MaskStyleString "edit,edit,edit,edit,edit" - MaskVariables "p2_3_4q=@1;p5q=@2;p6q=@3;p7q=@4;p8q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "||||" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskDisplay "plot([-2 2],[1 1])\ncolor('yellow')\nplot([1 -1],[1 -0.2],[-1 1],[-0.2 0.2],[1 -1],[0.2 -1],[-1 -1]" - ",[-1 -0.7],[-1 -0.2],[-1 -0.8])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|0.00|0.250|1e-3|1e-3" - } - Annotation { - Name "Faults & Operations" - Position [145, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Breaker" - Position [198, 113] - } - Annotation { - Name "Fault" - Position [98, 95] - } - } - } - Block { - BlockType SubSystem - Name "Loads" - Tag "PSATfolder" - Description "Loads" - Ports [] - Position [41, 96, 102, 143] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('loads');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Loads" - Location [473, 447, 880, 719] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Exload" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [135, 156, 165, 184] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Exload" - MaskDescription "This block defines Exponential Recovery Loads." - MaskPromptString "Power ratings [MVA]|Active and reactive power percentages [%, %]|Time constants for the real an" - "d reactive power dynamics Tp, Tq [s, s]|Real power exponents Alpha_S, Alpha_T|Reactive power exponents Beta_S, Beta" - "_T|Connected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3_4q=@2;p5_6q=@3;p7_8q=@4;p9_10q=@5;p11q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('R');" - MaskDisplay "plot([1 0 0 1 1],[1 1 0 0 1])\ncolor('blue')\nplot(0.7+0.3*x,0.6*y+0.5,[0.4 0.1 0.1 0.4],[0.8 0.8 0" - ".2 0.2],[0.1 0.25],[0.5 0.5])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "100|[100 100]|[1 1]|[2 1.5]|[2 1.5]|on" - } - Block { - BlockType PMComponent - Name "Fl" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [50, 155, 80, 185] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Fl" - MaskDescription "This block defines a general exponential voltage \nfrequency dependent load" - MaskPromptString "Active power percentage Kp [%]|Active power voltage and frequency exponents ap, bp|Reactive pow" - "er percentage Kq [%]|Reactive power voltage and frequency exponents aq, bq|Frequency filter time constant Tf [s]|Co" - "nnected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3_4q=@2;p5q=@3;p6_7q=@4;p8q=@5;p9q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskDisplay "plot([-1 -1 1 1 -1],[-1 1 1 -1 -1])\ncolor('blue')\nplot([-0.2 -0.15 0 0 0.15 0.2],[-0.45 -0.5 -0.4" - " 0.35 0.45 0.35],[-0.1 0.15],[0.05 0.05])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "100|[2 0]|100|[2 0]|0.01|on" - } - Block { - BlockType PMComponent - Name "Jimma" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [225, 156, 255, 184] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Jimma" - MaskDescription "This block defines a Jimma's Load." - MaskPromptString "Power, voltage and frequency ratings [MVA, kV, Hz]|Percentage of resistance, active current and" - " active power [% % %]|Percentage of reactance, reactive current and reactive power [% % %]|High-pass filter time co" - "nstant Tf [s]|Coefficient of voltage time derivative KV [1/s]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p6_7_8q=@2;p9_10_11q=@3;p5q=@4;p12q=@5;p13q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('J');" - MaskDisplay "plot([-1 -1 1 1 -1],[-1 1 1 -1 -1]);\ncolor('blue')\nplot(x,y)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|[33 33 34]|[33 33 34]|0.01|100|on" - } - Block { - BlockType PMComponent - Name "Mixload" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [300, 156, 330, 184] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Mixload" - MaskDescription "This block defines a mixed load." - MaskPromptString "Power, voltage and frequency ratings [MVA, kV, Hz]|Percentage of active and reactive power Kpv " - "and Kqv [% %]|Frequency coefficients Kpf and Kqf|Voltage exponents alpha and beta|Time constant of dV/dt Tpv and Tq" - "v [s s]|Filter time constants Tfv and Tft [s s]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p6_10q=@2;p5_9q=@3;p7_11q=@4;p8_12q=@5;p13_14q=@6;p15q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskDisplay "plot([-1 -1 2.4 2.4 -1],[-1 1 1 -1 -1])\ncolor('blue')\nplot([-0.35 -0.35 0 0.35 0.35],[-0.35 0.35 " - "0.05 0.35 -0.35])\nplot([0.7 0.7],[-0.35 0.35])\nplot([1.05 1.75],[-0.35 0.35],[1.05 1.75],[0.35 -0.35])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|[100 100]|[0 0]|[0 0]|[0.1 0.1]|[0.01 0.01]|on" - } - Block { - BlockType PMComponent - Name "Mn" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [100, 65, 130, 95] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Mn" - MaskDescription "This block defines a general exponential voltage load." - MaskPromptString "Power and voltage ratings [MVA, kV]|Percentage of active and reactive powers [%, %]|Voltage exp" - "onents for the active and reactive powers|Initialize after power flow|Connected" - MaskStyleString "edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3q=@1;p4_5q=@2;p6_7q=@3;p8q=@4;p9q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "|||fm_block|fm_block" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskDisplay "plot([-1 -1 1 1 -1],[-1 1 1 -1 -1])\ncolor('blue')\nplot([-0.35 -0.35 0 0.35 0.35],[-0.35 0.35 0.05" - " 0.35 -0.35])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|[80 60]|[2.00 2.00]|on|on" - } - Block { - BlockType PMComponent - Name "Pl" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [185, 66, 215, 94] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Pl" - MaskDescription "This block defines a ZIP load." - MaskPromptString "Power, voltage and frequency ratings [MVA, kV, Hz]|Percentage of resistance, active current and" - " active power [%, %, %]|Percentage of reactance, reactive current and reactive power [%, %, %]|Initialize after pow" - "er flow|Connected" - MaskStyleString "edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3_4q=@1;p5_6_7q=@2;p8_9_10q=@3;p11q=@4;p12q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "|||fm_block|fm_block" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskDisplay "plot([-1 -1 1 1 -1],[-1 1 1 -1 -1])\ncolor('blue')\nplot([0 0],[-0.3 0.3],[-0.3 -0.7 -0.3 -0.7],[-0" - ".3 -0.3 0.3 0.3])\nplot([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])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|[33 33 33]|[33 33 33]|on|on" - } - Block { - BlockType PMComponent - Name "Thload" - Tag "PSATblock" - Description "Loads" - Ports [0, 0, 0, 0, 0, 1] - Position [265, 66, 295, 94] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Thload" - MaskDescription "This block defines a thermostatically controlled load" - MaskPromptString "% of load to be used as thermostatically controlled load [%]|Gain of proportional controller Kp" - "|Gain of integral controller Ki|Time constant of integral controller Ti [s]|Thermostatically controlled load time c" - "onstant T1 [s]|Ambient temperature Ta [F]|Reference temperature Tref [F]|Ceiling conductance ouput KL|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;p5q=@4;p6q=@5;p7q=@6;p8q=@7;p11q=@8;p12q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskDisplay "plot([-1 -1 1 1 -1],[-1 1 1 -1 -1])\ncolor('blue')\nplot([-0.5 -0.5 -0.25 -0.25 -0.5],[0.4 0.15 0.1" - "5 0.4 0.4])\nplot([-0.05 -0.05 0.5],[-0.4 0.4 0.4],[-0.05 0.3],[0.05 0.05])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "50|100|25|10|1200|10|70|2|on" - } - Annotation { - Name "Loads" - Position [210, 29] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Voltage \nDependent \nLoad" - Position [116, 120] - } - Annotation { - Name "ZIP Load" - Position [200, 105] - } - Annotation { - Name "Thermostatically\nControlled\nLoad" - Position [278, 119] - } - Annotation { - Name "Frequency\nDependent \nLoad" - Position [63, 207] - } - Annotation { - Name "Exponential \nRecovery\nLoad" - Position [152, 207] - } - Annotation { - Name "Jimma's\nLoad" - Position [237, 204] - } - Annotation { - Name "Mixed\nLoad" - Position [314, 203] - } - } - } - Block { - BlockType SubSystem - Name "Machines" - Tag "PSATfolder" - Description "Machines" - Ports [] - Position [131, 95, 186, 150] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('machines');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Machines" - Location [725, 199, 1016, 369] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Ind" - Tag "PSATblock" - Description "Machines" - Ports [0, 0, 0, 0, 0, 1] - Position [185, 64, 220, 96] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Ind" - MaskDescription "This block defines an asynchronous machine.\n\nOrder 1: mechanical equation\nOrder 3: single c" - "age\nOrder 5: double cage" - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Dynamic Order|Start up|Stator Resistance Rs " - "[p.u.]|Stator Reactance Xs [p.u.] |First Cage Resitance Rr1 and Reactance Xr1 [p.u. p.u.]|Second Cage Resistance R" - "r2 and Reactance Xr2 [p.u. p.u.]|Magnetization Reactance Xm [p.u.]|Inertia Constant Hm [kWs/kVA]|Mechanical Torque" - " coefficients [a, b, c] [p.u. p.u. p.u.]|Start up time|Allow working as brake|Connected" - MaskStyleString "edit,popup(1|3|5),checkbox,edit,edit,edit,edit,edit,edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3_4q=@1;p5q=@2;p6q=@3;p7q=@4;p8q=@5;p9_10q=@6;p11_12q=@7;p13q=@8;p14q=@9;p15_16_17q=@10;p18q=@" - "11;p19q=@12;p20q=@13;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block|||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,off,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xs,ys] = fm_draw('sinus');" - MaskDisplay "plot(x+1.4,y,0.12*xs+1,0.15*ys-0.6)\ncolor('blue')\nplot([1 1 1.4 1.8 1.8],[-0.05 0.7 0.4 0.7 -0.05" - "])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 25 60]|3|off|0.01 |0.15|[0.05 0.15]|[0.001 0.04]|5.00|3.00|[1.00 0.00 0.00]|0|off" - "|on" - } - Block { - BlockType SubSystem - Name "Syn" - Tag "PSATblock" - Description "Machines" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [70, 63, 105, 97] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Syn" - MaskDescription "This block defines a fourth order synchronous machine." - MaskPromptString "Power, voltage and frequency ratings [MVA, kV, Hz]|Machine Dynamic Order|resistance ra and leak" - "age reactance xl [p.u. p.u.]|d-axis reactances Xd, X'd X\"d [p.u.,p.u.,p.u.]|d-axis open circuit time constants T'd" - "0 and T\"d0 [s, s]|q-axis reactances Xq, X'q, X\"q [p.u. p.u. p.u.]|q-axis open circuit time constants T'q0 and T" - "\"q0 [s s]|Inertia (M = 2H) and Damping [s, p.u.]|Speed and active power additional signals Kw and Kp [p.u., p.u.]|" - "Percentage of active and reactive powers at bus [p.u. p.u.]|d-axis additional circuit leakage time constant Taa [s]" - " |Saturation coefficients S(1.0) and S(1.2)|Number of input signals|COI number|Connected" - MaskStyleString "edit,popup(8|6|5.3|5.2|5.1|4|3|2),edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,popup(0|1|2)" - ",edit,checkbox" - MaskVariables "p2_3_4q=@1;p5q=@2;p7_6q=@3;p8_9_10q=@4;p11_12q=@5;p13_14_15q=@6;p16_17q=@7;p18_19q=@8;p20_21q=@9;" - "p22_23q=@10;p24q=@11;p25_26q=@12;in=@13;p27q=@14;p28q=@15;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|fm_block|||||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout\n[x,y] = fm_draw('circle');\n[xg,yg] = fm_draw('G');\n[xs,ys] = fm_draw('sinus');\n" - MaskDisplay "plot(x+1.4,y,0.12*xs+1,0.15*ys-0.6)\ncolor('blue')\nplot(1.4+0.45*xg,0.3+0.45*yg)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[370 20 50]|6|[0.001 0.05]|[1.90 0.302 0.204]|[8.00 0.04]|[1.70 0.50 0.30]|[0.80 0.02]" - "|[10.00 0.00]|[0.00 0.00]|[1.00 1.00]|0.002|[0 0]|0|1|on" - System { - Name "Syn" - Location [412, 233, 746, 425] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Atomic Subsystem" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [140, 89, 240, 131] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - } - Block { - BlockType PMIOPort - Name "Connection\nPort1" - Tag "PMCPort" - Position [280, 101, 310, 119] - Orientation "left" - ShowName off - Port "1" - Side "Right" - } - Line { - LineType "Connection" - SrcBlock "Atomic Subsystem" - SrcPort RConn1 - DstBlock "Connection\nPort1" - DstPort RConn1 - } - Annotation { - Name "Synchronous Machine" - Position [164, 45] - } - } - } - Annotation { - Name "Electrical Machines" - Position [142, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Synchronous\nMachine" - Position [89, 113] - } - Annotation { - Name "Induction\nMachine" - Position [199, 116] - } - } - } - Block { - BlockType SubSystem - Name "Measurements" - Tag "PSATfolder" - Description "Switches" - Ports [] - Position [301, 170, 361, 217] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('measures');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Measurements" - Location [308, 234, 584, 384] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Busfreq" - Tag "PSATblock" - Description "Measurements" - Ports [0, 0, 0, 0, 0, 1] - Position [60, 60, 90, 90] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Busfreq" - MaskDescription "This block defines a bus frequency measurement." - MaskPromptString "Frequency deviation filter time constant Tf [s]|Frequency filter time constant Tw [s]|Connected" - MaskStyleString "edit,edit,checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;" - MaskTunableValueString "on,on,on" - MaskCallbackString "||fm_block" - MaskEnableString "on,on,on" - MaskVisibilityString "on,on,on" - MaskToolTipString "on,on,on" - MaskDisplay "plot([-1 0 1 0 -1],[0 1 0 -1 0])\ncolor('yellow')\nplot([-0.2 -0.15 0 0 0.15 0.2],[-0.45 -0.5 -0.4 " - "0.35 0.45 0.35],[-0.1 0.15],[0.05 0.05])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "0.001|0.001|on" - } - Block { - BlockType PMComponent - Name "Pmu" - Tag "PSATblock" - Description "Measurements" - Ports [0, 0, 0, 0, 0, 1] - Position [180, 59, 235, 91] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Pmu" - MaskDescription "This block defines a phasor measurement unit (PMU)." - MaskPromptString "Voltage and frequency rates [kV Hz]|Time constant of the voltage magnitude filter [s]|Time cons" - "tant of the voltage phase filter [s]|Connected" - MaskStyleString "edit,edit,edit,checkbox" - MaskVariables "p2_3q=@1;p4q=@2;p5q=@3;p6q=@4;" - MaskTunableValueString "on,on,on,on" - MaskCallbackString "|||fm_block" - MaskEnableString "on,on,on,on" - MaskVisibilityString "on,on,on,on" - MaskToolTipString "on,on,on,on" - MaskInitialization "[xp,yp] = fm_draw('P');\n[xu,yu] = fm_draw('U');\n[xm,ym] = fm_draw('M');\n" - MaskDisplay "plot([-1 0 4 5 4 0 -1],[0 1 1 0 -1 -1 0])\ncolor('yellow')\nplot(xp+0.5,yp,xu+3,yu,xm+2,ym)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[230 60]|0.05|0.05|on" - } - Annotation { - Name "Measurements" - Position [135, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Bus Frequency\nMeasurement" - Position [74, 112] - } - Annotation { - Name "Phasor\nMeasument Unit" - Position [207, 112] - } - } - } - Block { - BlockType SubSystem - Name "OPF & CPF" - Tag "PSATfolder" - Description "OPFandCPF" - Ports [] - Position [225, 20, 278, 75] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('opfcpf');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "OPF & CPF" - Location [2177, 430, 2475, 766] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Demand" - Tag "PSATblock" - Description "OPF & CPF" - Ports [0, 0, 0, 0, 0, 1] - Position [200, 58, 230, 92] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Demand" - MaskDescription "This block defines a constant power load for bifurcation and market studies." - MaskPromptString "Power Rating [MVA]|Active Power [p.u.]|Reactive Power [p.u.]|Max and Min Power Demand [p.u. p." - "u.]|Cost = a + b*P + c*P^2 [$/h, $/MWh, $/(MW)^2 h]|Cost = a + b*Q + c*Q^2 [$/h, $/MVArh, $/(MVAr)^2 h]|Allow Unit " - "Commitment|Tie Breaking Cost [$/h]|Up and down congestion costs [$/h $/h]|Number of Output Signals|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox,edit,edit,popup(0|1),checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;p5_6q=@4;p8_9_10q=@5;p11_12_13q=@6;p14q=@7;p15q=@8;p16_17q=@9;out=@10;p18q=@" - "11;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout;\n[xs,ys]=fm_draw('$');" - MaskDisplay "plot([ 1.0000 -0.5 -0.5 1],[ 0 0.866 -0.866 0])\ncolor('blue')\nplot(0.6*xs,0.6*ys)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "100|0.80|0.60|[1.00 0.00]|[0.00 10.5 0.00]|[0.00 0.00 0.00]|off|0|[0 0]|0|on" - } - Block { - BlockType PMComponent - Name "Rmpg" - Tag "PSATblock" - Description "OPF & CPF" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [50, 154, 80, 186] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Rmpg" - MaskDescription "This block defines ramping parameters for generators for market studies." - MaskPromptString "Power Rating [MVA]|Ramp Up and Down Rates [p.u./h p.u./h] |Minimum Up and Down Times [h h] |N" - "umbers of period up and down at initial time [h h]|Start Up Cost [$]|Conneted" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3_4q=@2;p5_6q=@3;p7_8q=@4;p9q=@5;p10q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xr,yr] = fm_draw('ramp');" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot(xr,yr)\n\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "100|[1.00 1.00]|[1 1]|[0 2]|10|on" - } - Block { - BlockType PMComponent - Name "Rmpl" - Tag "PSATblock" - Description "OPF & CPF" - Ports [0, 0, 0, 0, 0, 1] - Position [45, 248, 75, 282] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Rmpl" - MaskDescription "This block defines ramping parameters for loads for market studies." - MaskPromptString "Power Rating [MVA]|Ramp Up and Down Rates [p.u./h p.u./h] |Minimum Up and Down Times [h h]|N" - "umber of period up and down at initial time [h h]|Connected" - MaskStyleString "edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3_4q=@2;p5_6q=@3;p7_8q=@4;p9q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "||||fm_block" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskInitialization "[xr,yr] = fm_draw('ramp');" - MaskDisplay "plot([ 1.0000 -0.5 -0.5 1],[ 0 0.866 -0.866 0])\ncolor('blue')\nplot(0.7*xr, 0.6*yr)" - "\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "100|[1.00 1.00]|[1 1]|[0 2]|on" - } - Block { - BlockType PMComponent - Name "Rsrv" - Tag "PSATblock" - Description "OPF & CPF" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [135, 155, 165, 185] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Rsrv" - MaskDescription "This block defines generator reserve data." - MaskPromptString "Power Rating [MVA]|Maximum and Minimum reserve Offer [p.u. p.u.]|Reserve Offer Price [$/MWh]|C" - "onnected" - MaskStyleString "edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3_4q=@2;p5q=@3;p6q=@4;" - MaskTunableValueString "on,on,on,on" - MaskCallbackString "|||fm_block" - MaskEnableString "on,on,on,on" - MaskVisibilityString "on,on,on,on" - MaskToolTipString "on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xr,yr] = fm_draw('R');" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot(0.5*xr,yr)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "100|0.08 0.00|10.00|on" - } - Block { - BlockType PMComponent - Name "Supply" - Tag "PSATblock" - Description "OPF & CPF" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [55, 57, 90, 93] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Supply" - MaskDescription "This block defines a PV bus for bifurcation and market studies:\n" - MaskPromptString "Power Rating [MVA]|Active Power [p.u.]|Max and Min Power Supply [p.u. p.u.]|Cost = a + b*P + c" - "*P^2 [$/h, $/MWh, $/(MW)^2 h]|Cost = a + b*Q + c*Q^2 [$/h, $/MVArh, $/(MVAr)^2 h]|Allow Unit Commitment|Tie Breakin" - "g Cost [$/h]|Loss participation factor|Reactive power limits Qmax and Qmin [p.u. p.u.]|Up and down congestion costs" - " [$/h $/h]|Number of Input Signals|Connected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox,edit,edit,edit,edit,popup(0|1|2),checkbox" - MaskVariables "p2q=@1;p3q=@2;p4_5q=@3;p7_8_9q=@4;p10_11_12q=@5;p13q=@6;p14q=@7;p15q=@8;p16_17q=@9;p18_19q=@10;in" - "=@11;p20q=@12;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout;\n[x,y] = fm_draw('circle');\n[xs,ys] = fm_draw('$');" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot(xs,ys)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "100|0.80|[1.00 0.00]|[0.00 8.80 0.00]|[0.00 0.00 0.00]|off|0|1|[0 0]|[0 0]|0|on" - } - Block { - BlockType PMComponent - Name "Vltn" - Tag "PSATblock" - Description "OPF & CPF" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [215, 155, 245, 185] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Vltn" - MaskDescription "This block defines penalty factors for generators for market studies." - MaskPromptString "Power Rating [MVA]|Deficit Generation Penalty|Surplus Generation Penalty|Deficit 10 Minutes Res" - "erve Penalty|Deficit Synch 10 Min Reserve Penalty|Deficit Total Reserve Penalty|Surplus Intertie Penalty |Deficit I" - "ntertie Penalty|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2q=@1;p3q=@2;p4q=@3;p5q=@4;p6q=@5;p7q=@6;p8q=@7;p9q=@8;p10q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot([0.3 0 -0.3],[0.5 -0.5 0.5])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "100|0.01|0.01|0.01|0.01|0.01|0.01|0.01|on" - } - Block { - BlockType SubSystem - Name "Ypdp" - Tag "PSATblock" - Description "OPF & CPF" - Ports [] - Position [113, 230, 198, 267] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Ypdp" - MaskDescription "This block defines the yearly power demand profile." - MaskPromptString "Select Day Type:|Select Day of the Week:|Se|Mask Parameter 4:|Mask Parameter 5:|Mask Parameter " - "6:|Mask Parameter 7:|Mask Parameter 8:|Mask Parameter 9:|Mask Parameter 10:|Mask Parameter 11:|Mask Parameter 12:|M" - "ask Parameter 13:|Mask Parameter 14:" - MaskStyleString "popup(winter_week_day|winter_week_end|summer_week_day|summer_week_end|spring_fall_week_day|sprin" - "g_fall_week_end),popup(monday|tuesday|wednesday|thursday|friday|saturday|sunday),edit,edit,edit,edit,edit,edit,edit" - ",edit,edit,edit,edit,edit" - MaskVariables "p204q=@1;p205q=@2;p206q=@3;p1x24q=@4;p25x48q=@5;p49x72q=@6;p73x96q=@7;p97x120q=@8;p121x144q=@9;p1" - "45x151q=@10;p152x164q=@11;p165x177q=@12;p178x190q=@13;p191x203q=@14;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||||||||" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskDisplay "plot([-2 22 22 -2 -2],[-1.1 -1.1 1.1 1.1 -1.1])\ncolor('blue')\nplot([0 0 20],[0.8 -0.8 -0.8])\ncol" - "or('red')\nplot([0:19],[ 0.3941 0.5030 0.7220 0.3062 0.1122 0.4433 0.4668 0.0147 0.6641 0.7241 0" - ".2816 0.2618 0.7085 0.7839 0.9862 0.4733 0.9028 0.4511 0.8045 0.8289]-0.2)\ntext(13,-0.25,'Fixed'" - ")" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "winter_week_day|monday|1|[67 63 60 59 59 60 74 86 95 96 96 95 95 95 93 94 99 100 100 96 91 83 73" - " 63]|[78 72 68 66 64 65 66 70 80 88 90 91 90 88 87 87 91 100 99 97 94 92 87 81]|[64 60 58 56 56 58 64 76 87 95 99 1" - "00 99 100 100 97 96 96 93 92 92 93 87 72]|[74 70 66 65 64 62 62 66 81 86 91 93 93 92 91 91 92 94 95 95 100 93 88 80" - "]|[63 62 60 58 59 65 72 85 95 99 100 99 93 92 90 88 90 92 96 98 96 90 80 70]|[75 73 69 66 65 65 68 74 83 89 92 94 9" - "1 90 90 86 85 88 92 100 97 95 90 85]|[93 100 98 96 94 77 75]|[86 90 87 83 88 84 83 80 74 73 71 72 70]|[75 72 80 75 " - "83 87 88 85 81 90 88 89 86]|[75 81 80 88 72 77 80 72 72 70 78 69 72]|[72 74 74 80 88 88 90 94 89 94 97 100 95]" - System { - Name "Ypdp" - Location [477, 86, 744, 293] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Annotation { - Position [139, 85] - } - } - } - Block { - BlockType SubSystem - Name "Ypdp1" - Tag "PSATblock" - Description "OPF & CPF" - Ports [] - Position [113, 275, 198, 312] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Ypdp" - MaskDescription "This block defines the power demand profile (custom length)." - MaskPromptString "Percentage of load [%]" - MaskStyleString "edit" - MaskVariables "pxq=@1;" - MaskTunableValueString "on" - MaskEnableString "on" - MaskVisibilityString "on" - MaskToolTipString "on" - MaskDisplay "plot([-2 22 22 -2 -2],[-1.1 -1.1 1.1 1.1 -1.1])\ncolor('blue')\nplot([0 20],[-0.8 -0.8],[0 0],[-0.8" - " 0.8])\ncolor('red')\nplot([0:19],[ 0.3941 0.5030 0.7220 0.3062 0.1122 0.4433 0.4668 0.0147 0.6641 " - " 0.7241 0.2816 0.2618 0.7085 0.7839 0.9862 0.4733 0.9028 0.4511 0.8045 0.8289]-0.2)\ntext(10,-0" - ".25,'Custom')" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[60 80 100 120 100]" - System { - Name "Ypdp1" - Location [477, 86, 744, 293] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Annotation { - Position [139, 85] - } - } - } - Annotation { - Name "OPF & CPF Data" - Position [150, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Power Supply Bids \nand Generator Power \nDirections" - Position [76, 118] - } - Annotation { - Name "Power Demand Bids\nand Load Power\nDirections" - Position [214, 118] - } - Annotation { - Name "Generator\nRamping" - Position [67, 207] - } - Annotation { - Name "Load Ramping" - Position [56, 296] - } - Annotation { - Name "Violation\nPenalty Factors" - Position [232, 205] - } - Annotation { - Name "Generator\nReserve Bids" - Position [150, 203] - } - Annotation { - Position [208, 302] - } - Annotation { - Name "Yearly Power\nDemand Profile" - Position [250, 267] - } - } - } - Block { - BlockType SubSystem - Name "Others" - Tag "PSATfolder" - Description "Others" - Ports [] - Position [226, 168, 276, 215] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('others');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Others" - Location [48, 283, 389, 555] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType SubSystem - Name "Mass" - Tag "PSATblock" - Description "Sparse Dynamic Component" - Ports [0, 1] - Position [40, 165, 105, 195] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Mass" - MaskDescription "This block defines a mechanical model for synchronous generator shaft.\n" - MaskPromptString "HP, IP, LP and EX inertiae [1/s 1/s 1/s 1/s]|HP, IP, LP and EX damping [p.u. p.u. p.u. p.u.]|D1" - "2, D23, D34 and D45 damping [p.u. p.u. p.u. p.u.]|K12, K23, K34 and K45 coefficients |Number of input signals|Conne" - "cted" - MaskStyleString "edit,edit,edit,edit,popup(0|1),checkbox" - MaskVariables "p2_3_4_5q=@1;p6_7_8_9q=@2;p10_11_12_13q=@3;p14_15_16_17q=@4;in=@5;p18q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "fm_inout\n[x,y] = fm_draw('circle');\n[x1,y1] = fm_draw('semicircle');" - MaskDisplay "plot(-x1,y1,3+x,y,[0 3],[1 1],[0 3],[-1 -1],[3 5],[0 0])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[0.6695 1.4612 1.6307 0.0903]|[0.518 0.224 0.224 0.145]|[0.0518 0.0224 0.0224 0.0145]|[" - "33.07 28.59 44.68 21.98]|0|on" - System { - Name "Mass" - Location [320, 260, 654, 452] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType Constant - Name "Constant" - Position [110, 100, 140, 130] - ShowName off - } - Block { - BlockType Outport - Name "Out1" - Position [180, 105, 200, 125] - ShowName off - IconDisplay "Port number" - } - Line { - SrcBlock "Constant" - SrcPort 1 - DstBlock "Out1" - DstPort 1 - } - Annotation { - Name "Dynamic Shaft" - Position [164, 45] - } - } - } - Block { - BlockType PMComponent - Name "Sofc" - Tag "PSATblock" - Description "Sparse Dynamic Component" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [50, 74, 95, 106] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Sofc" - MaskDescription "This block defines a Solid Oxyde Fuel Cell:" - MaskPromptString "DC Power and Voltage Rating [MW, kV]|Electrical and fuel processor response times (Te, Tf) [s, " - "s]|Response times TH2, TH2O and TO2 [s, s, s]|Valve molar constants KH2, KH2O and KO2|Constant Kr, ohmic loss [Ohm]" - " and hydrogen to oxygen ratio rH_O|Fuel optimization constants Uopt, Umax and Umin|Number of cells N0 and ideal sta" - "ndard potential E0 [V]|Gas absolute temperature T [K]|Transformer reactance Xt [p.u.]|Gain and Time constant for Vo" - "ltage Control Km, Tm [p.u. s]|Max and Min tap ratio [p.u./p.u. p.u./p.u.]|Control Mode: [0] costant current; [1] c" - "ostant power|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,popup(1|0),checkbox" - MaskVariables "p2_3q=@1;p4_13q=@2;p5_8_10q=@3;p6_9_11q=@4;p7_17_12q=@5;p14_15_16q=@6;p18_19q=@7;p20q=@8;p26q=@9;" - "p27_28q=@10;p29_30q=@11;p25q=@12;p31q=@13;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskDisplay "plot([0 1 1 0 0],[0 0 1 1 0])\nplot([0.1 0.1 0.3 0.3],[1 1.1 1.1 1])\nplot([0.9 0.9 0.7 0.7],[1 1.1" - " 1.1 1])\ncolor('yellow')\nplot([0.85 0.75],[0.85 0.85],[0.15 0.25],[0.85 0.85],[0.8 0.8],[0.8 0.9])\ncolor('blue')" - "\nplot([0.85 0.65 0.65 0.85 0.85],[0.3 0.3 0.7 0.7 0.3])\nplot([0.15 0.15],[0.3 0.7],[0.35 0.35],[0.3 0.7],[0.15 0." - "35],[0.5 0.5])\nplot([0.55 0.45 0.45 0.55 0.55 0.45],[0.15 0.15 0.25 0.25 0.35 0.35])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 333.8]|[0.8 5]|[26.1 78.3 2.91]|[8.43e-4 2.81e-4 2.52e-3]|[0.996e-6 0.126 1.145]|[0" - ".85 0.9 0.8]|[384 1.18]|1273|0.1|[100 10]|[1.2 0.8]|0|on" - } - Block { - BlockType PMComponent - Name "Spq" - Tag "PSATblock" - Description "Sparse Dynamic Component" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [165, 162, 205, 198] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Spq" - MaskDescription "This block defines a Solar Photo-Voltaic generator with constant PQ model." - MaskPromptString "Active and Reactive Power Rating [MW, MVar]|Inverter response times (Tp, Tq) [s, s]|Connected" - MaskStyleString "edit,edit,checkbox" - MaskVariables "p2_3q=@1;p4_5q=@2;p6q=@3;" - MaskTunableValueString "on,on,on" - MaskCallbackString "||fm_block" - MaskEnableString "on,on,on" - MaskVisibilityString "on,on,on" - MaskToolTipString "on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xc,yc] = fm_draw('S');" - MaskDisplay "plot(x,y,[-0.25 -0.25],[-0.25 0.25])\ncolor('blue')\nplot(xc,yc)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[60 80]|[15 15]|on" - } - Block { - BlockType PMComponent - Name "Spv" - Tag "PSATblock" - Description "Sparse Dynamic Component" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [260, 162, 300, 198] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Spv" - MaskDescription "This block defines a Solar Photo-Voltaic generator.\nP_ref = const\nV_ref = const" - MaskPromptString "Active Power and Voltage References [MW, p.u.]|Inverter response times (Tp, Tq) [s, s]|Voltage " - "PI Controller Gains (kv, ki)|Connected" - MaskStyleString "edit,edit,edit,checkbox" - MaskVariables "p2_3q=@1;p4_5q=@2;p6_7q=@3;p8q=@4;" - MaskTunableValueString "on,on,on,on" - MaskCallbackString "|||fm_block" - MaskEnableString "on,on,on,on" - MaskVisibilityString "on,on,on,on" - MaskToolTipString "on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[x1,y1] = fm_draw('sunedge');\n[xp,yp] = fm_draw('G');" - MaskDisplay "plot(1.1*x,1.1*y,[-0.25 -0.25],[-0.25 0.25])\nplot(1.5*x1,y1)\nplot(-1.5*x1,y1)\nplot(y1,1.5*x1)\np" - "lot(y1,-1.5*x1)\ncolor('blue')\nplot(0.5*xp,0.5*yp)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[40 1.045]|[0.015 0.015]|[0.0868 50.9005]|on" - } - Block { - BlockType PMComponent - Name "Ssr" - Tag "PSATblock" - Description "Sparse Dynamic Component" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [155, 75, 305, 115] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "SSR" - MaskDescription "This block defines a fourth order synchronous machine with shaft dynamics and compensated line." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Machine reactances Xd, Xq [p.u. p.u.]|Armatu" - "re parameters Xad, Ra [p.u. p.u.]|D-axis parameters Xf, Rf [p.u. p.u.]|Line parameters R, Xl, Xc [p.u. p.u. p.u.]|I" - "nertiae M (HP, IP, LP, rotor, EX)|Dampings D (HP, IP, LP, rotor, EX)|Shaft coefficients K12, K23, K34, K45|Connecte" - "d" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p5_6q=@2;p8_7q=@3;p13_12q=@4;p9_10_11q=@5;p14_15_16_17_18q=@6;p19_20_21_22_23q=@7;p24_" - "25_26_27q=@8;p28q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xg,yg] = fm_draw('G');\n[xs,ys] = fm_draw('sinus');" - MaskDisplay "plot(0,-50,450,50,[0 30 30 38 53 68 83 98 113 120 120 150],[0 0 0 25 -25 25 -25 25 -25 0 0 0],[0 23" - " 23 24 28 34 40 47 52 55 56 54 51 51 47 46 48 51 57 64 70 75 79 79 77 74 74 70 69 71 75 80 87 93 99 102 103 101 97 " - "97 94 93 94 98 104 110 117 122 125 126 126 150]+150,[0 0 1 11 19 24 25 23 17 8 -2 -12 -18 -18 -9 1 11 19 24 25 23 1" - "7 8 -2 -12 -18 -18 -9 1 11 19 24 25 23 17 8 -2 -12 -18 -18 -9 1 11 19 24 25 23 17 8 0 0 0],[0 60 60 57 55 57 60 60 " - "57 55]+300,[0 0 8 16 25 16 8 -8 -16 -25],[90 90 90 150]+300,[25 -25 0 0])\nplot(-150+60*(x+1.4),40*y,-150+60*0.12*x" - "s+60,40*0.15*ys-40*0.6)\ncolor('blue')\nplot(-150+60*0.45*(xg+1.4)+60*0.75,40*0.45*yg+40*0.3)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 230 60]|[1.79 1.71]|[1.66 0.015]|[1.70 0.01]|[0.0165 0.30 0.05]|[0.6695 1.4612 1." - "6307 1.5228 0.0903]|[0.518 0.224 0.224 0.000 0.145]|[33.07 28.59 44.68 21.98]|on" - } - Annotation { - Name "Other Models" - Position [172, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Subsynchronous \nResonance Model" - Position [238, 131] - } - Annotation { - Name "Solid Oxyde\nFuel Cell" - Position [70, 130] - } - Annotation { - Name "Dynamic Mass-Spring\nShaft Model" - Position [76, 223] - } - Annotation { - Name "Solar Photo-Voltaic\nGenerator (PQ)" - Position [184, 222] - } - Annotation { - Name "Solar Photo-Voltaic\nGenerator (PV)" - Position [279, 222] - } - } - } - Block { - BlockType SubSystem - Name "Power Flow" - Tag "PSATfolder" - Description "PowerFlow" - Ports [] - Position [131, 23, 192, 71] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('powerflow');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Power Flow" - Location [692, 260, 1102, 746] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Area 1" - Tag "PSATblock" - Description "Power Flow" - Ports [] - Position [45, 413, 106, 443] - ShowName off - CopyFcn "idnum(Areas,gcb,gcs)" - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - MaskType "Areas" - MaskDescription "Area block." - MaskPromptString "Output for slack bus connection|Area Id Number (must be unique)|Slack bus number (can be zero)|" - "Power rating [MVA]|Power interchange export (>0 = out) [p.u.]|Power interchange tolerance [p.u.]|Annual growth rate" - " [%]|Actual net interchange powers P and Q [p.u.]" - MaskStyleString "popup(0|1),edit,edit,edit,edit,edit,edit,edit" - MaskVariables "out=@1;p1q=@2;p2q=@3;p3q=@4;p4q=@5;p5q=@6;p6q=@7;p7_8q=@8;" - MaskTunableValueString "on,on,on,on,on,on,on,on" - MaskCallbackString "fm_block|fm_block||||||" - MaskEnableString "on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout\n[xc,yc] = fm_draw('rounded');\n" - MaskSelfModifiable on - MaskDisplay "plot(xc,yc), color('blue'), text(-0.5,0.1,'Area 1')" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "0|1|0|100|0|0.01|0|[0 0]" - } - Block { - BlockType PMComponent - Name "Auto" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [60, 351, 105, 379] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines an auto-transformer." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Primary and secondary voltage ratio [kV/kV]|" - "Resistance [p.u.]|Reactance [p.u.]|Imax, Pmax and Smax [p.u., p.u., p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p7q=@2;p8q=@3;p9q=@4;p13_14_15q=@5;p16q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xq,yq] = fm_draw('quarter');" - MaskDisplay "plot(x,y,1.75*xq,yq,[-1 -1.3],[0 0],[1.75 2.05],[0 0])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|1|0.01|0.20|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Line" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [140, 150, 200, 160] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines a pi model for a tree phase line." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Length of line [km] (0 for p.u. parameters)|" - "Resistance [p.u. (Ohms/km)]|Reactance [p.u. (H/km)]|Susceptance [p.u. (F/km)]|Imax, Pmax and Smax [p.u., p.u., p.u." - "]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p6q=@2;p8q=@3;p9q=@4;p10q=@5;p13_14_15q=@6;p16q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskInitialization "[xp,yp] = fm_draw('pi');" - MaskDisplay "plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2])\ncolor('blue')\nplot(0.35*xp,0.2*yp)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|0|0.01|0.10|1e-3|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Line1" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [135, 209, 205, 221] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines a pi model for a tree phase cable." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Length of line [km] (0 for p.u. parameters)|" - "Resistance [p.u. (Ohms/km)]|Reactance [p.u. (H/km)]|Susceptance [p.u. (F/km)]|Imax, Pmax and Smax [p.u., p.u., p.u." - "]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p6q=@2;p8q=@3;p9q=@4;p10q=@5;p13_14_15q=@6;p16q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[x1,y1] = fm_draw('semicircle');" - MaskDisplay "color('yellow')\nplot(10+0.433*x,0.5+0.433*y)\nplot(9.567+0.433*x,-0.25+0.433*y)\nplot(10.433+0.433" - "*x,-0.25+0.433*y)\ncolor('black')\nplot(-x1,y1)\nplot(10+x,y,[0 10],[1 1],[0 10],[-1 -1])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|0|0.01|0.10|1e-3|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Lines" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [265, 350, 330, 360] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Lines" - MaskDescription "This block defines a pi model for a tree phase line.\nThe line is NOT included in the admittance" - " matrix." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Resistance, Reactance and Susceptance [p.u. " - " p.u. p.u.]|Connected" - MaskStyleString "edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p6_7_8q=@2;p9q=@3;" - MaskTunableValueString "on,on,on" - MaskCallbackString "||fm_block" - MaskEnableString "on,on,on" - MaskVisibilityString "on,on,on" - MaskToolTipString "on,on,on" - MaskInitialization "[xp,yp] = fm_draw('L');" - MaskDisplay "plot([-1 1 1 -1 -1],[-0.2 -0.2 0.2 0.2 -0.2])\ncolor('blue')\nplot(0.35*xp,0.2*yp)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|[0.01 0.10 0.00]|on" - } - Block { - BlockType PMComponent - Name "PQ" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1] - Position [250, 66, 275, 94] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "PQ" - MaskDescription "This block defines a constant power load:\n\nP = Pcost.\nQ = Qcost." - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Active and Reactive Powers [p.u. p.u.]|Maximum and Minimum" - " Allowable Voltage [p.u. p.u.]|Allow conversion to impendance for min or max voltage|Connected" - MaskStyleString "edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3q=@1;p4_5q=@2;p6_7q=@3;p8q=@4;p9q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "|||fm_block|fm_block" - MaskEnableString "on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskDisplay "plot([1 -0.5 -0.5 1],[0 0.866 -0.866 0])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|[0.80 0.60]|[1.2 0.8]|on|on" - } - Block { - BlockType PMComponent - Name "PQgen" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [170, 63, 205, 97] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "PQgen" - MaskDescription "This block defines a PQ generator." - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Active and Reactive Powers [p.u. p.u.]|Vmax and Vmin [p.u." - " p.u.]|Allow conversion to impedance|Connected" - MaskStyleString "edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3q=@1;p4_5q=@2;p6_7q=@3;p8q=@4;p9q=@5;" - MaskTunableValueString "on,on,on,on,on" - MaskCallbackString "|||fm_block|fm_block" - MaskEnableString "on,on,off,on,on" - MaskVisibilityString "on,on,on,on,on" - MaskToolTipString "on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xp,yp] = fm_draw('P');\n[xq,yq] = fm_draw('Q');" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot(0.3*xp-0.35,0.6*yp,0.4*xq+0.1,0.6*yq)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|[0.8 0.6]|[1.1 0.9]|off|on" - } - Block { - BlockType PMComponent - Name "PV" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [105, 63, 140, 97] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "PV" - MaskDescription "This block defines a PV bus for load flow studies:\n\nP = Pcost.\nV = Vdes." - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Active Power [p.u.]|Voltage Magnitude [p.u.]|Qmax and Qmin " - "[p.u. p.u.]|Vmax and Vmin [p.u. p.u.]|Loss Participation Factor|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3q=@1;p4q=@2;p5q=@3;p6_7q=@4;p8_9q=@5;p10q=@6;p11q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xp,yp] = fm_draw('P');" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot(0.3*xp-0.35,0.6*yp,[0.1 0.3 0.5],[0.3 -0.3 0.3])\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|0.8|1.00|[0.8 -0.2]|[1.1 0.9]|1|on" - } - Block { - BlockType PMComponent - Name "Region 1" - Tag "PSATblock" - Description "Power Flow" - Ports [] - Position [145, 413, 219, 442] - ShowName off - CopyFcn "idnum(Regions,gcb,gcs)" - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - MaskType "Regions" - MaskDescription "Region block." - MaskPromptString "Output for slack bus connection|Region Id Number (must be unique)|Slack bus number (can be zero" - ")|Power rating [MVA]|Power interchange export (>0 = out) [p.u.]|Power interchange tolerance [p.u.]|Annual growth ra" - "te [%]|Actual net interchange powers P and Q [p.u.]" - MaskStyleString "popup(0|1),edit,edit,edit,edit,edit,edit,edit" - MaskVariables "out=@1;p1q=@2;p2q=@3;p3q=@4;p4q=@5;p5q=@6;p6q=@7;p7_8q=@8;" - MaskTunableValueString "on,on,on,on,on,on,on,on" - MaskCallbackString "fm_block|fm_block||||||" - MaskEnableString "on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout\n[xc,yc] = fm_draw('rounded');\n\n" - MaskSelfModifiable on - MaskDisplay "plot(xc,yc), color('blue'), text(-0.5,0.1,'Region 1')" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "0|1|0|100|0|0.01|0|[0 0]" - } - Block { - BlockType PMComponent - Name "SC" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [170, 335, 200, 365] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "PV" - MaskDescription "This block defines a static synchronous compensator:\nP = 0\nV = Vdes" - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Voltage Magnitude [p.u.]|Qmax and Qmin [p.u. p.u.]|Vmax an" - "d Vmin [p.u. p.u.]|Loss Participation Coefficient|Connected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3q=@1;p5q=@2;p6_7q=@3;p8_9q=@4;p10q=@5;p11q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xc,yc] = fm_draw('C');" - MaskDisplay "plot(x,y,[-0.25 -0.25],[-0.25 0.25])\ncolor('blue')\nplot(0.5*xc-0.25,yc)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|1.00|[0.8 -0.2]|[1.1 0.9]|1|on" - } - Block { - BlockType PMComponent - Name "Shunt" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1] - Position [329, 160, 341, 205] - Orientation "down" - NamePlacement "alternate" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Shunt" - MaskDescription "This block defines a constant admittance." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Conductance G and Susceptance B [p.u. p.u.]" - "|Connected" - MaskStyleString "edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p5_6q=@2;p7q=@3;" - MaskTunableValueString "on,on,on" - MaskCallbackString "|fm_block|fm_block" - MaskEnableString "on,on,on" - MaskVisibilityString "on,on,on" - MaskToolTipString "on,on,on" - MaskInitialization "[xp,yp] = fm_draw('Y');" - MaskDisplay "plot([-1 1 1 -1 -1],[0.2 0.2 -0.2 -0.2 0.2])\nplot([-1 -1.5],[0 0],[1 1.2],[0 0],[1.2 1.2],[-0.2 0" - ".2],[1.35 1.35],[-0.125 0.125],[1.5 1.5],[-0.05 0.05])\ncolor('blue')\nplot(xp,0.3*yp)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|[0.0 0.5]|on" - } - Block { - BlockType PMComponent - Name "Shunt1" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1] - Position [247, 160, 283, 205] - Orientation "down" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Shunt" - MaskDescription "This block defines a static condenser:\n\nQ = B * V^2\n\n(Negative values of B define an inducti" - "ve load)." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Susceptance B [p.u.]|Connected" - MaskStyleString "edit,edit,checkbox" - MaskVariables "p2_3_4q=@1;p6q=@2;p7q=@3;" - MaskTunableValueString "on,on,on" - MaskCallbackString "||fm_block" - MaskEnableString "on,on,on" - MaskVisibilityString "on,on,on" - MaskToolTipString "on,on,on" - MaskInitialization "fm_block" - MaskDisplay "plot(-[0 60 60 55 53 55 60 60 55 53]/150,[0 0 8 16 25 16 8 -8 -16 -25]/50,-[80 80 80 150]/150,[25 -" - "25 0 0]/50,[0 0],[-0.4 0.4],[0.075 0.075],[-0.25 0.25],[0.15 0.15],[-0.1 0.1])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|0.5|on" - } - Block { - BlockType PMComponent - Name "Slack" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [35, 63, 70, 97] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "SW" - MaskDescription "This block defines a V-theta bus:\n\nV = V_des\ntheta = theta_des" - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Voltage Magnitude [p.u.]|Reference Phase Angle [rad]|Qmax a" - "nd Qmin [p.u. p.u.]|Vmax and Vmin [p.u. p.u.]|Active Power Guess [p.u.]|Loss Participation Factor|Reference bus|" - "Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3q=@1;p4q=@2;p5q=@3;p6_7q=@4;p8_9q=@5;p10q=@6;p11q=@7;p12q=@8;p13q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||fm_block|fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xt,yt] = fm_draw('theta');\n" - MaskDisplay "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])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|1.00|0.00|[1.5 -1.5]|[1.1 0.9]|0.80|1|on|on" - } - Block { - BlockType PMComponent - Name "Slack1" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [310, 62, 345, 98] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "blob" - RightPortType "blob" - RConnTagsString "__newr0" - MaskType "SW" - MaskDescription "This block defines a V-theta bus:\n\nV = V_des\ntheta = theta_des\n" - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Voltage Magnitude [p.u.]|Reference Phase Angle [rad]|Qmax a" - "nd Qmin [p.u. p.u.]|Vmax and Vmin [p.u. p.u.]|Active Power Guess [p.u.]|Loss Participation Factor|Reference bus|" - "Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,checkbox,checkbox" - MaskVariables "p2_3q=@1;p4q=@2;p5q=@3;p6_7q=@4;p8_9q=@5;p10q=@6;p11q=@7;p12q=@8;p13q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||fm_block|fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xt,yt] = fm_draw('theta');\n" - MaskDisplay "plot(x,y)\ncolor('blue')\nplot([0.1 0.3 0.5]-0.6,[0.3 -0.3 0.3],0.45*xt+0.1,0.6*yt)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - MaskValueString "[100 400]|1.00|0.00|[1.5 -1.5]|[1.1 0.9]|0.80|1|off|on" - } - Block { - BlockType PMComponent - Name "Transf1" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [35, 142, 85, 168] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines a transformer." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Primary and secondary voltage ratio [kV/kV]|" - "Resistance [p.u.]|Reactance [p.u.]|Imax, Pmax and Smax [p.u., p.u., p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p7q=@2;p8q=@3;p9q=@4;p13_14_15q=@5;p16q=@6;" - MaskTunableValueString "on,on,on,on,on,on" - MaskCallbackString "|||||fm_block" - MaskEnableString "on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[x1,y1] = fm_draw('1');\n[x2,y2] = fm_draw('2');\n" - MaskDisplay "plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0])\ncolor('green')\nplot(-0.1+0.65*x1,0.65*y1)\nplot" - "(1.5+0.65*x2,0.65*y2)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|1|0.01|0.20|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Transf2" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [35, 200, 85, 230] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines a transformer with constant tap ratio." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Primary and secondary voltage ratio [kV/kV]|" - "Resistance [p.u.]|Reactance [p.u.]|Fixed tap ratio [p.u./p.u.]|Imax, Pmax and Smax [p.u., p.u., p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p7q=@2;p8q=@3;p9q=@4;p11q=@5;p13_14_15q=@6;p16q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[x2,y2] = fm_draw('2');\n" - MaskDisplay "plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0])\ncolor('green')\nplot([-0.8 0.7],[-1.2 1.2],[0.5 " - "0.7],[1.1 1.2],[0.7 0.7],[1.0 1.2])\nplot(1.5+0.65*x2,0.65*y2)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|400/400|0.01|0.20|1.00|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Transf3" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [155, 262, 225, 288] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines a transformer with constant phase shifter." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Primary and secondary voltage ratio [kV/kV]|" - "Resistance [p.u.]|Reactance [p.u.]|Fixed phase shift [deg]|Imax, Pmax and Smax [p.u. p.u. p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p7q=@2;p8q=@3;p9q=@4;p12q=@5;p13_14_15q=@6;p16q=@7;" - MaskTunableValueString "on,on,on,on,on,on,on" - MaskCallbackString "||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xa,ya] = fm_draw('a');\n[x1,y1] = fm_draw('1');\n[x2,y2] = fm_dr" - "aw('2');" - MaskDisplay "plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0],[2.7 2.7 4 4 2.7],[-0.5 0.5 0.5 -0.5 -0.5],[4 4.3]" - ",[0 0])\ncolor('red')\nplot(3.35+0.2*xa,-0.1+0.15*ya)\ncolor('green')\nplot(-0.1+0.65*x1,0.65*y1)\nplot(1.5+0.65*x2" - ",0.65*y2)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|400/400|0.01|0.20|0.00|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Transf4" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [270, 259, 340, 291] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Line" - MaskDescription "This block defines a transformer with constant phase shifter and constant tap ratio." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Primary and secondary voltage ratio [kV/kV]|" - "Resistance [p.u.]|Reactance [p.u.]|Fixed tap ratio [p.u./p.u.]|Fixed phase shift [deg]|Imax, Pmax and Smax [p.u. p." - "u. p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p7q=@2;p8q=@3;p9q=@4;p11q=@5;p12q=@6;p13_14_15q=@7;p16q=@8;" - MaskTunableValueString "on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xa,ya] = fm_draw('a');\n[x2,y2] = fm_draw('2');" - MaskDisplay "plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0],[2.7 2.7 4 4 2.7],[-0.5 0.5 0.5 -0.5 -0.5],[4 4.3]" - ",[0 0])\ncolor('green')\nplot([-0.8 0.7],[-1.2 1.2],[0.5 0.7],[1.1 1.2],[0.7 0.7],[1.0 1.2])\nplot(1.5+0.65*x2,0.65" - "*y2)\ncolor('red')\nplot(3.35+0.2*xa,-0.1+0.15*ya)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 400 60]|400/400|0.01|0.20|1.00|0.00|[0.0 0.0 0.0]|on" - } - Block { - BlockType PMComponent - Name "Twt" - Tag "PSATblock" - Description "Power Flow" - Ports [0, 0, 0, 0, 0, 1, 2] - Position [50, 263, 105, 312] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0|__newr1" - MaskType "Twt" - MaskDescription "This block defines a three-winding transformer with constant tap ratio." - MaskPromptString "Power and Frequency Ratings [MVA, Hz]|Voltage Ratings Vn1, Vn2 and Vn3 [kV, kV, kV]|Resistances" - " R12, R13 and R23 [p.u. p.u. p.u.]|Reactances X12, X13 and X23 [p.u. p.u. p.u.]|Fixed tap ratio [p.u./p.u.]|Max" - " Currents Imax1, Imax2 and Imax3 [p.u. p.u. p.u.]|Max Powers Pmax1, Pmax2 and Pmax3 [p.u. p.u. p.u.]|Max Powers Sm" - "ax1, Smax2 and Smax3 [p.u. p.u. p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p4_5q=@1;p6_7_8q=@2;p9_10_11q=@3;p12_13_14q=@4;p15q=@5;p16_17_18q=@6;p19_20_21q=@7;p22_23_24q=@8;" - "p25q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[x2,y2] = fm_draw('2');\n[x3,y3] = fm_draw('3');\n" - MaskDisplay "plot(x,y,x+1.4,0.8+y,1.4+x,y-0.8,[-1 -1.3],[0 0],[2.4 2.75],[0.9 0.9],[2.4 2.75],[-0.9 -0.9])\ncolo" - "r('green')\nplot([-0.8 0.7]-0.4,[-1.2 1.2]+0.2,[0.5 0.7]-0.4,[1.1 1.2]+0.2,[0.7 0.7]-0.4,[1.0 1.2]+0.2)\nplot(1.5+0" - ".65*x2,0.9+0.65*y2)\nplot(1.5+0.65*x3,-0.9+0.65*y3)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 60]|[230 132 60]|[0.01 0.01 0.01]|[0.1 0.1 0.1]|1.00|[0.0 0.0 0.0]|[0.0 0.0 0.0]|[0.0 " - " 0.0 0.0]|on" - } - Annotation { - Name "Static Components & Devices" - Position [180, 29] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Slack Bus" - Position [52, 111] - } - Annotation { - Name "PV\nGenerator" - Position [123, 118] - } - Annotation { - Name "Constant\nPQ load" - Position [259, 117] - } - Annotation { - Name "Transmission\nLine" - Position [171, 178] - } - Annotation { - Name "Transformer" - Position [60, 181] - } - Annotation { - Name "Shunt\nAdmittance" - Position [336, 226] - } - Annotation { - Name "Tap Ratio\nTransformer" - Position [61, 243] - } - Annotation { - Name "Phase Shifter\nTransformer" - Position [191, 307] - } - Annotation { - Name "Tap Ratio and\nPhase Shifter\nTransfomer" - Position [302, 318] - } - Annotation { - Name "Extra model for\nTransmission Line" - Position [300, 383] - } - Annotation { - Name "Static\nCompensator" - Position [188, 383] - } - Annotation { - Name "Autotransformer" - Position [80, 390] - } - Annotation { - Name "Static\nCondenser" - Position [268, 226] - } - Annotation { - Name "Cable" - Position [169, 233] - } - Annotation { - Name "Three-Winding\nTransformer" - Position [74, 326] - } - Annotation { - Name "PQ\nGenerator" - Position [190, 118] - } - Annotation { - Name "Fixed V\ntheta" - Position [330, 119] - } - Annotation { - Name "Area" - Position [72, 457] - } - Annotation { - Name "Region" - Position [182, 457] - } - } - } - Block { - BlockType SubSystem - Name "ULTC" - Tag "PSATfolder" - Description "ULTC" - Ports [] - Position [298, 95, 361, 139] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('ultc');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "ULTC" - Location [736, 311, 1060, 598] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType SubSystem - Name "Ltc" - Tag "PSATblock" - Description "ULTC" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [45, 59, 115, 111] - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Ltc" - MaskDescription "This block defines a pi model for a LTC Transformer.\n\nControl type: \n\n[1] secondary V cont" - "rol; \n[2] secondary Q control;\n[3] remote V control." - MaskPromptString "Power and Frequency ratings [MVA, Hz]|Primary Voltage rating and nominal tap ratio V1/V2 [kV, " - "kV/kV]|Control Type|Inverse Time Constant and integral deviation [1/s, p.u.]|Max and Min Tap Ratio [p.u./p.u. p.u." - "/p.u.]|Tap ratio step [0 for continuous model]|Reference Voltage Vref [p.u.]|Resistance and Reactance [p.u. p.u.]" - "|Dead zone [%]|Connected" - MaskStyleString "edit,edit,popup(1|2|3),edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_5q=@1;p4_6q=@2;p16q=@3;p8_7q=@4;p9_10q=@5;p11q=@6;p12q=@7;p14_13q=@8;p17q=@9;p18q=@10;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||fm_block|||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on" - MaskInitialization "rot = strcmp(get_param(gcb,'NamePlacement'),'normal');\n[x,y] = fm_draw('circle');" - MaskDisplay "plot(x,y,x+1.4,y,[2.4 2.8],[0 0],[3.1 3.5],[0 0],[-1 -2],[0 0],0,2), color('green'), plot([2.95 2.9" - "5],[-0.15 -2],[2.95 -0.8],[-2 -2],[-0.8 -0.8],[-2 -1.2], [-0.8 0.7],[-1.2 1.2],[0.5 0.7],[1.1 1.2],[0.7 0.7], [1.0 " - "1.2],[2.8 3.1 3.1 2.8 2.8],[-0.15 -0.15 0.15 0.15 -0.15]);" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 60]|[220 5]|1|[0.10 1e-3]|[1.20 0.8]|0|1.00|[0.10 0.001]|5|on" - System { - Name "Ltc" - Location [285, 394, 645, 586] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Atomic Subsystem" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [125, 74, 225, 116] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - } - Block { - BlockType PMIOPort - Name "Connection\nPort1" - Tag "PMCPort" - Position [260, 86, 290, 104] - Orientation "left" - ShowName off - Port "1" - Side "Left" - } - Block { - BlockType PMIOPort - Name "Connection\nPort2" - Tag "PMCPort" - Position [60, 86, 90, 104] - ShowName off - Port "2" - Side "Right" - } - Line { - LineType "Connection" - SrcBlock "Atomic Subsystem" - SrcPort RConn1 - DstBlock "Connection\nPort1" - DstPort RConn1 - } - Line { - LineType "Connection" - SrcBlock "Connection\nPort2" - SrcPort RConn1 - DstBlock "Atomic Subsystem" - DstPort LConn1 - } - Annotation { - Name "Tap Changer Under Load " - Position [164, 45] - } - } - } - Block { - BlockType SubSystem - Name "Ltc1" - Tag "PSATblock" - Description "ULTC" - Ports [0, 0, 1, 0, 0, 1, 1] - Position [190, 164, 260, 216] - Orientation "left" - ShowName off - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskType "Ltc" - MaskDescription "This block defines a pi model for a LTC Transformer.\n\nControl type: \n\n[1] secondary V cont" - "rol; \n[2] secondary Q control;\n[3] remote V control." - MaskPromptString "Power and Frequency ratings [MVA, Hz]|Primary Voltage rating and nominal tap ratio V1/V2 [kV, " - "kV/kV]|Control Type|Inverse Time Constant and integral deviation [1/s, p.u.]|Max and Min Tap Ratio [p.u./p.u. p.u." - "/p.u.]|Tap ratio step [0 for continuous model]|Remote Reference Voltage Vref [p.u.]|Resistance and Reactance [p.u." - " p.u.]|Dead zone [%]|Connected" - MaskStyleString "edit,edit,popup(1|2|3),edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_5q=@1;p4_6q=@2;p16q=@3;p8_7q=@4;p9_10q=@5;p11q=@6;p12q=@7;p14_13q=@8;p17q=@9;p18q=@10;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||fm_block|||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on" - MaskInitialization "rot = strcmp(get_param(gcb,'NamePlacement'),'normal');\n[x,y] = fm_draw('circle');" - MaskDisplay "plot(x,y,x+1.4,y,[2.4 3.5],[0 0],[-1 -2],[0 0],0,2-4*rot), color('green'), plot([0.8 0.8],3*rot-[1." - "3 1.7],[0.65 0.95 0.95 0.65 0.65],[3.4*rot-1.7 3.4*rot-1.7 4*rot-2 4*rot-2 3.4*rot-1.7],[0.8 -0.8],[2.4*rot-1.2 1.3" - "-2.6*rot],[-0.6 -0.8],[1.1-2.2*rot 1.2-2.4*rot],[-0.8 -0.8], [1-2*rot 1.2-2.4*rot]);" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 60]|[220 5]|3|[0.10 1e-3]|[1.20 0.8]|0|1.00|[0.10 0.001]|5|on" - System { - Name "Ltc1" - Location [285, 394, 645, 586] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType EnablePort - Name "in_2" - Ports [] - Position [65, 155, 85, 175] - } - Block { - BlockType PMComponent - Name "Atomic Subsystem" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [125, 74, 225, 116] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - } - Block { - BlockType PMIOPort - Name "Connection\nPort1" - Tag "PMCPort" - Position [260, 86, 290, 104] - Orientation "left" - ShowName off - Port "1" - Side "Left" - } - Block { - BlockType PMIOPort - Name "Connection\nPort2" - Tag "PMCPort" - Position [60, 86, 90, 104] - ShowName off - Port "2" - Side "Right" - } - Line { - LineType "Connection" - SrcBlock "Connection\nPort2" - SrcPort RConn1 - Points [0, 0] - DstBlock "Atomic Subsystem" - DstPort LConn1 - } - Line { - LineType "Connection" - SrcBlock "Atomic Subsystem" - SrcPort RConn1 - Points [0, 0] - DstBlock "Connection\nPort1" - DstPort RConn1 - } - Annotation { - Name "Tap Changer Under Load " - Position [164, 45] - } - } - } - Block { - BlockType PMComponent - Name "Phs" - Tag "PSATblock" - Description "Phase Shifter" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [190, 61, 265, 109] - NamePlacement "alternate" - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Phs" - MaskDescription "This block defines a pi model for a Phase Shifting Transformer." - MaskPromptString "Power and Frequency ratings [MVA, Hz]|Primary and Secondary Voltage ratings [kV, kV]|Time cons" - "tant of measurement block [s]|Max and Min Phase angle [rad rad]|Proportional and Integral Gains [Kp Ki]|Reference P" - "ower Pref [p.u.]|Resistance and Reactance [p.u. p.u.]|Tap ratio [p.u./p.u.]|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_6q=@1;p4_5q=@2;p7q=@3;p13_14q=@4;p8_9q=@5;p10q=@6;p11_12q=@7;p15q=@8;p16q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "if strcmp(get_param(gcb,'NamePlacement'),'alternate'), rot = 0; else, rot = 1; end\n[x,y] = f" - "m_draw('circle');\n[xa,ya] = fm_draw('a');\n" - MaskDisplay "plot(x,y,x+1.4,y,[-1 -1.3],[0 0],[2.4 2.7],[0 0],[2.7 2.7 4 4 2.7],[-0.5 0.5 0.5 -0.5 -0.5],[4 4.3]" - ",[0 0],[-1.7 -2],[0 0])\ncolor('green')\nplot([-1.3 -1.3 -1.7 -1.7 -1.3],[0.2 -0.2 -0.2 0.2 0.2],[3.35 3.35 -1.5 -1" - ".5],[-0.5 -2 -2 -0.2],0,2)\ncolor('red')\nplot(3.35+0.2*xa,-0.1+0.15*ya)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 60]|[230 138]|0.001|[pi/2 -pi/2]|[0.05 0.1]|1.00|[0.01 0.1]|1|on" - } - Block { - BlockType PMComponent - Name "Tap" - Tag "PSATblock" - Description "ULTC" - Ports [0, 0, 0, 0, 0, 1] - Position [50, 165, 140, 215] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - MaskType "Tap" - MaskDescription "This block defines an ideal LTC transformer feeding a static load described by monomial expressi" - "ons. " - MaskPromptString "Power and Voltage Ratings [MVA, kV]|Integral Behaviour Deviation|Inverse Time Constant [1/s]|Ma" - "x and Min Tap Ratio Limits [p.u./p.u. p.u./p.u.]|Reference Voltage [p.u.]|Nominal Active and Reactive Power Rating" - "s [p.u. p.u.]|Active and Reactive Power Exponents|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p2_3q=@1;p4q=@2;p5q=@3;p6_7q=@4;p8q=@5;p9_10q=@6;p11_12q=@7;p13q=@8;" - MaskTunableValueString "on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');" - MaskDisplay "plot(x,y,x+1.4,y)\nplot([-1 -1.3],[0 0],[2.4 2.8],[0 0],[3.1 3.7],[0 0],0,2)\nplot([3.7 3.7 5.7 5.7" - " 3.7],[-1 1 1 -1 -1])\ncolor('green')\nplot([-0.8 0.7],[-1.2 1.2],[0.5 0.7],[1.1 1.2],[0.7 0.7],[1.0 1.2])\nplot([2" - ".8 3.1 3.1 2.8 2.8],[-0.15 -0.15 0.15 0.15 -0.15])\nplot([2.95 2.95],[-0.15 -2],[2.95 -0.8],[-2 -2],[-0.8 -0.8],[-2" - " -1.2])\ncolor('blue')\nplot([4.2 4.2 5.2],[0.6 -0.6 -0.6])" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[100 60]|1e-3|0.10|[1.20 0.80]|1.00|[0.80 0.60]|[2.00 2.00]|on" - } - Annotation { - Name "Regulating Transformers" - Position [157, 32] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Under Load Tap\nChanger with\nEmbedded Load" - Position [82, 241] - } - Annotation { - Name "Under Load Tap\nChanger" - Position [81, 133] - } - Annotation { - Name "Phase Shifting\nTransformer" - Position [226, 128] - } - Annotation { - Name "Under Load Tap\nChanger with\nRemote Voltage Control" - Position [226, 243] - } - } - } - Block { - BlockType SubSystem - Name "Wind\nTurbines" - Tag "PSATfolder" - Description "Controls" - Ports [] - Position [132, 165, 197, 216] - ShowName off - FontSize 12 - MinAlgLoopOccurrences off - PropExecContextOutsideSubsystem off - RTWSystemCode "Auto" - MaskInitialization "x = fm_draw('wind');" - MaskDisplay "image(x)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "none" - MaskIconUnits "autoscale" - System { - Name "Wind\nTurbines" - Location [267, 309, 610, 683] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 - ScreenColor "white" - PaperOrientation "landscape" - PaperPositionMode "auto" - PaperType "usletter" - PaperUnits "inches" - ZoomFactor "100" - Block { - BlockType PMComponent - Name "Cswt" - Tag "PSATblock" - Description "Wind Turbines" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [195, 64, 295, 136] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Cswt" - MaskDescription "This block defines a constant speed wind turbine with third order asynchronous generator and dyn" - "amic shaft." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Stator Resistance Rs and Reactance Xs [p.u. " - " p.u.]|Rotor Resitance Rr and Reactance Xr [p.u. p.u.]|Magnetization Reactance Xm [p.u.]|Inertia Constants Hwr Hm a" - "nd Ks [kWs/kVA kWs/kVA p.u.]|Number of poles p and gear box ratio [int -]|Blade length and number [m int]|Number o" - "f machine that compose the park|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p6_7q=@2;p8_9q=@3;p10q=@4;p11_12_13q=@5;p15_17q=@6;p14_16q=@7;p18q=@8;p19q=@9;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xh,yh] = fm_draw('helix');" - MaskDisplay "plot(1.4*x,1.4*y,[0,-2],[0 0],[-2 -3 -3 -2 -2],[-1 -1 1 1 -1],[-3 -5],[0 0],[1.4 3],[0 0],[2.2 2.2]" - ",[0 -1],[1.8 2.6],[-1 -1],[1.8 2.6],[-1.2 -1.2],[2.2 2.2],[-1.2 -2.2],[1.9 2.5],[-2.2 -2.2],[2.1 2.3],[-2.4 -2.4])\n" - "color('blue')\nplot(x,y)\ncolor('cyan')\nplot(xh-4,3*yh)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[2 25 60]|[0.01 0.10]|[0.01 0.08]|3.00|[2.5 0.5 0.3]|[4 1/89]|[75.00 3]|0|on" - } - Block { - BlockType PMComponent - Name "Ddsg" - Tag "PSATblock" - Description "Wind Turbines" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [185, 227, 310, 303] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Ddsg" - MaskDescription "This block defines a variable speed wind turbine with direct drive synchronous generator." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Stator Resistance Rs [p.u.]|Direct and inver" - "se reactances Xd and Xq [p.u. p.u.]|Constant field flux Psi_p [p.u.]|Inertia Constants Hm [kWs/kVA]|Pitch contro" - "l gain and time constant Kp, Tp [p.u. s]|Voltage control gain and time constant Kv Tv [p.u. s]|Active and React" - "ive Power Control time constants Tep Teq [s s]|Number of poles p and gear box ratio [int -]|Blade length and numbe" - "r [m int]|Pmax and Pmin [p.u. p.u.]|Qmax and Qmin [p.u. p.u.]|Number of machines that compose the park|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p6q=@2;p7_8q=@3;p9q=@4;p10q=@5;p11_12q=@6;p13_14q=@7;p15_16q=@8;p18_20q=@9;p17_19q=@10" - ";p21_22q=@11;p23_24q=@12;p25q=@13;p26q=@14;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xh,yh] = fm_draw('helix');" - MaskDisplay "plot(1.4*x,1.4*y,[0,-2],[0 0],[-2 -3 -3 -2 -2],[-1 -1 1 1 -1],[-3 -5],[0 0],[1.4 2.075],[0 0],[3.95" - " 4.5],[0 0])\nplot(1.5*[0.3 0.3 -0.95 -0.95 0.3]+3.5,0.5*[-1.7 2.7 2.7 -1.7 -1.7]-0.25,1.5*[0 0.2]+3.5,0.5*[0.5 0" - ".5]-0.25)\ncolor('blue')\nplot(x,y)\ncolor('cyan')\nplot(xh-4,3*yh)\ncolor('magenta')\nplot(1.5*[0 0]+3.5,0.5*[-0.5" - " 1.5]-0.25,1.5*[0 -0.2]+3.5,0.5*[-0.5 -0.5]-0.25,1.5*[0 -0.65]+3.5,0.5*[1.5 1.5]-0.25)\nplot(1.5*[-0.2 -0.2]+3.5,0." - "5*[-1 0]-0.25,1.5*[-0.2 -0.45]+3.5,0.5*[-1 -0.5]-0.25,1.5*[-0.2 -0.45]+3.5,0.5*[0 -0.5]-0.25,1.5*[-0.45 -0.45]+3.5," - "0.5*[-1 0]-0.25)\nplot(1.5*[-0.2 -0.2]+3.5,0.5*[2 1]-0.25,1.5*[-0.45 -0.45]+3.5,0.5*[2 1]-0.25,1.5*[-0.45 -0.2]+3.5" - ",0.5*[2 1.5]-0.25,1.5*[-0.45 -0.2]+3.5,0.5*[1 1.5]-0.25)\nplot(1.5*[-0.65 -0.65]+3.5,0.5*[-0.5 1.5]-0.25,1.5*[-0.45" - " -0.65]+3.5,0.5*[-0.5 -0.5]-0.25,1.5*[-0.45 -0.65]+3.5,0.5*[1.5 1.5]-0.25)\nplot(1.5*[-0.65 -0.85]+3.5,0.5*[0.5 0.5" - "]-0.25,1.5*[-0.3 -0.3]+3.5,0.5*[1.7 2.2]-0.25,1.5*[-0.325 -0.275]+3.5,0.5*[1.975 1.975]-0.25)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[2 25 60]|0.01|[1 0.8]|1.00|3|[10 3]|[10 1]|[0.01 0.01]|[4 1/89]|[75.00 3]|[1.00 0.00]|" - "[0.7 -0.7]|0|on" - } - Block { - BlockType PMComponent - Name "Dfig" - Tag "PSATblock" - Description "Wind Turbines" - Ports [0, 0, 0, 0, 0, 1, 1] - Position [35, 148, 145, 252] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - LConnTagsString "__newl0" - RConnTagsString "__newr0" - MaskType "Dfig" - MaskDescription "This block defines a variable speed wind turbine with doubly fed induction generator." - MaskPromptString "Power, Voltage and Frequency Ratings [MVA, kV, Hz]|Stator Resistance Rs and Reactance Xs [p.u. " - " p.u.]|Rotor Resitance Rr and Reactance Xr [p.u. p.u.]|Magnetization Reactance Xm [p.u.]|Inertia Constants Hm [kWs" - "/kVA]|Pitch control gain and time constant Kp, Tp [p.u. s]|Voltage control gain Kv [p.u.]|Power Control time cons" - "tant Te [s]|Number of poles p and gear box ratio [int -]|Blade length and number [m int]|Pmax and Pmin [p.u. p.u." - "]|Qmax and Qmin [p.u. p.u.]|Number of wind generators that compose the park|Connected" - MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,edit,checkbox" - MaskVariables "p3_4_5q=@1;p6_7q=@2;p8_9q=@3;p10q=@4;p11q=@5;p12_13q=@6;p14q=@7;p15q=@8;p17_19q=@9;p16_18q=@10;p2" - "0_21q=@11;p22_23q=@12;p24q=@13;p25q=@14;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "|||||||||||||fm_block" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "[x,y] = fm_draw('circle');\n[xh,yh] = fm_draw('helix');" - MaskDisplay "plot(1.4*x,1.4*y,[0,-2],[0 0],[-2 -3 -3 -2 -2],[-1 -1 1 1 -1],[-3 -5],[0 0],[1.4 3.5],[0 0],1,4.35," - "[0 0 1.075],[-1 -3.25 -3.25],[2.05 2.05],[0 -2.15])\nplot(1.5*[0.3 0.3]+2.5,0.5*[-1.7 2.7]-3.5,1.5*[ -0.95 -0.95]" - "+2.5,0.5*[-1.7 2.7]-3.5,1.5*[0 0.2]+2.5,0.5*[0.5 0.5]-3.5)\nplot(1.5*[0.3 -0.95]+2.5,0.5*[2.7 2.7]-3.5,1.5*[0.3 -0." - "95]+2.5,0.5*[-1.7 -1.7]-3.5)\ncolor('blue')\nplot(x,y)\ncolor('cyan')\nplot(xh-4,3*yh)\ncolor('magenta')\nplot(1.5*" - "[0 0]+2.5,0.5*[-0.5 1.5]-3.5,1.5*[0 -0.2]+2.5,0.5*[-0.5 -0.5]-3.5,1.5*[0 -0.65]+2.5,0.5*[1.5 1.5]-3.5)\nplot(1.5*[-" - "0.2 -0.2]+2.5,0.5*[-1 0]-3.5,1.5*[-0.2 -0.45]+2.5,0.5*[-1 -0.5]-3.5,1.5*[-0.2 -0.45]+2.5,0.5*[0 -0.5]-3.5,1.5*[-0.4" - "5 -0.45]+2.5,0.5*[-1 0]-3.5)\nplot(1.5*[-0.2 -0.2]+2.5,0.5*[2 1]-3.5,1.5*[-0.45 -0.45]+2.5,0.5*[2 1]-3.5,1.5*[-0.45" - " -0.2]+2.5,0.5*[2 1.5]-3.5,1.5*[-0.45 -0.2]+2.5,0.5*[1 1.5]-3.5)\nplot(1.5*[-0.65 -0.65]+2.5,0.5*[-0.5 1.5]-3.5,1.5" - "*[-0.45 -0.65]+2.5,0.5*[-0.5 -0.5]-3.5,1.5*[-0.45 -0.65]+2.5,0.5*[1.5 1.5]-3.5)\nplot(1.5*[-0.65 -0.85]+2.5,0.5*[0." - "5 0.5]-3.5,1.5*[-0.3 -0.3]+2.5,0.5*[1.7 2.2]-3.5,1.5*[-0.325 -0.275]+2.5,0.5*[1.975 1.975]-3.5)\n" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "[2 25 60]|[0.01 0.10]|[0.01 0.08]|3.00|3|[10 3]|10|0.01|[4 1/89]|[75.00 3]|[1.00 0.00]|[" - "0.7 -0.7]|1|on" - } - Block { - BlockType PMComponent - Name "Wind" - Tag "PSATblock" - Description "Wind Turbines" - Ports [0, 0, 0, 0, 0, 0, 1] - Position [55, 79, 110, 121] - ShowName off - PhysicalDomain "psatdomain" - LeftPortType "p1" - RightPortType "p1" - RConnTagsString "__newr0" - MaskType "Wind" - MaskDescription "This block defines wind models for use with wind turbines." - MaskPromptString "Number of output ports|Wind model type|Nominal wind speed [m/s]|Air density rho [kg/m^3]|Filter" - " time constant tau [s]|Sample time for wind measures [s]|Weibull distribution constants C and K |Wind ramp constan" - "ts Tsr, Ter and Awr [s s m/s]|Wind gust constants Tsg, Teg and Awg [s s m/s]|Wind turbolence constants h, z0, df an" - "d n [m - Hz int]|Mexican hat wavelet time center and shape factor" - MaskStyleString "edit,popup(measurements|weibull|composite|mexican_hat),edit,edit,edit,edit,edit,edit,edit,edit,e" - "dit" - MaskVariables "out=@1;p1q=@2;p2q=@3;p3q=@4;p4q=@5;p5q=@6;p6_7q=@7;p8_9_10q=@8;p11_12_13q=@9;p14_15_16_17q=@10;p_" - "18_19q=@11;" - MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on" - MaskCallbackString "||||||||||" - MaskEnableString "on,on,on,on,on,on,on,on,on,on,on" - MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on" - MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on" - MaskInitialization "fm_inout\n[xa,ya] = fm_draw('arrow');" - MaskDisplay "color('cyan')\nplot(xa,ya,xa-0.2,ya-0.2,xa+0.2,ya+0.2,xa+0.4,ya+0.4,xa-0.4,ya-0.4)" - MaskIconFrame off - MaskIconOpaque on - MaskIconRotate "port" - MaskIconUnits "autoscale" - MaskValueString "1|measurements|15.00|1.225|4|0.1|[20 2]|[5 15 1]|[5 15 1]|[50 0.01 0.2 50]|[10 1]" - } - Annotation { - Name "Constant Speed\nWind Turbine with\nSquirrel Cage\nInduction Generator" - Position [249, 166] - } - Annotation { - Name "Wind Turbines" - Position [177, 34] - ForegroundColor "blue" - FontSize 12 - } - Annotation { - Name "Wind Model" - Position [86, 134] - } - Annotation { - Name "Variable Speed\nWind Turbine with\nDoubly Fed Induction\nGenerator" - Position [84, 279] - } - Annotation { - Name "Variable Speed\nWind Turbine with\nDirect Drive Synchronous\nGenerator" - Position [253, 331] - } - } - } - } -} From bea39a8b54b4ece9a1d0234fcdd2a7e0c60eb4f0 Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Wed, 24 Jun 2020 11:35:18 +0430 Subject: [PATCH 05/10] Create fm_lib.slx --- psat-mat/psat/fm_lib.slx | 1 + 1 file changed, 1 insertion(+) create mode 100644 psat-mat/psat/fm_lib.slx diff --git a/psat-mat/psat/fm_lib.slx b/psat-mat/psat/fm_lib.slx new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/psat-mat/psat/fm_lib.slx @@ -0,0 +1 @@ + From 8049c42b3d684ad5fbb79f8115f8f916b5a38d4d Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Wed, 24 Jun 2020 11:42:29 +0430 Subject: [PATCH 06/10] Add files via upload --- psat-mat/psat/fm_lib.slx | Bin 1 -> 56005 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/psat-mat/psat/fm_lib.slx b/psat-mat/psat/fm_lib.slx index 8b137891791fe96927ad78e64b0aad7bded08bdc..9b28c44a5f2a3faeca0b6bd5cf0817b3fc83d012 100644 GIT binary patch literal 56005 zcmZUZLv$_*kc4B~xxtNX+s=(`Pu0n8-WW+L<^w0Zbg}+^ns<6?Nne z8IZoH<9AWH$MOEES`2N6lgA-}ZHKcP*=k)LAg+g?`0%=HgeVdg@o+F7u4g~HVAgt2 z==MRHOoJ?=3xZ=A6f;$Vdz{ryFe?X*MIQyS)(H@UDQnlsa!^%;YT4qwl@XwgkAYEb zfm9ngp&b&eYw$5%y%=}ocX>m)av3hai(}9zLUG#s$a&xV`B~H>OsPyduiWgh0SKEr zeyr^mey-bjw&c(@|7ok&U@=NhMG8`*D;YIyeNFXdY;_Si`GLegkl6?-26?wM?trnp zL65c79`Jy1EJ`Cj$9u6Z2}vrVm0V18+{l^FC5KFZfl&I3udA#pmxABH$Dd6#tB!HC zlDf@W^wUr7gJ^B`15jA!mj6HGV%N2yM*brv{vSQO|4q)?_5ZUoi4~LuWrP#0MKPHz zs#YgRl62knm#2he2wx5-t1skenz|kj7>1*DvDTL%ES&s9Xs@uOf)Tg;y0eb+N_#oAp!$%501L| z##E&L&701?_C@i^VI+j=a76roTCr;N{!!Zb2Kv7OTpE}qV(6k>FMeBC!M`D zEDJnQEQp2cimtcS-S`zM%iz+>2D|9RamY|eeSLj#CPl+4Kh?y)@EmErj>)RdFTLOs z3d&;eH@k=6W`90zadvb+LW!}kCi;9qdBPEbk>H}x{)uUeOw&FRO)kU2KCLZo=fvYt zM?eL$9fqn-@`pM0Dt_urXZ-qyU{D0~fc}LM0Xi{MC@6e}uzZI2MXsH^RX`WVA<>B! z<3Uzuv{rw=KJ2XNOE;L7YymlD{&pBkVXoi#U`b9HUd%doE6PQO5f=~;V1lg!H8WFV zF$vAdZbzUXBPE#2?MK196#s|#_P!`1f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un 2020 11:43:18 +0430 Subject: [PATCH 07/10] Add files via upload --- fm_main.m | 1177 +++++++++++++++++++++++++++++++++++++++++++++++++++++ fm_set.m | 935 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2112 insertions(+) create mode 100644 fm_main.m create mode 100644 fm_set.m diff --git a/fm_main.m b/fm_main.m new file mode 100644 index 0000000..23293f0 --- /dev/null +++ b/fm_main.m @@ -0,0 +1,1177 @@ +function fig = fm_main(varargin) +% FM_MAIN create the main GUI for PSAT +% +% HDL = FM_MAIN() +% +%see general purpose structures for settings +% +%Author: Federico Milano +%Date: 11-Nov-2002 +%Update: 10-Feb-2003 +%Update: 27-Feb-2003 +%Update: 29-Jul-2003 +%Version: 1.0.3 +% +%E-mail: federico.milano@ucd.ie +%Web-site: faraday1.ucd.ie/psat.html +% +% Copyright (C) 2002-2019 Federico Milano + +global Settings Path File History Hdl Theme Fig + +simulinkcode = 5; +if Settings.hostver >= 9 + simulinkcode = 4; +end +if exist('simulink') ~= simulinkcode + fmlib = 'fm_choice(''Simulink is not available on this system'',2)'; +else + fmlib = 'fm_lib'; +end + +if nargin + if ~exist('Fig'), Fig.main = -1, end + if ~ishandle(Fig.main) + Fig.main = findobj(get(0,'Children'),'FileName','fm_main'); + end + switch varargin{1} + + case 'buttondown' + + pos = get(Fig.main,'CurrentPoint'); + if pos(1) > 0.04064 && pos(2) > 0.1152 && ... + pos(1) < 0.2943 && pos(2) < 0.3395 + if ~exist('Hdl'), return, end + if ishandle(Hdl.status) + delete(Hdl.status) + Hdl.status = -1; + elseif strcmp(get(Fig.main,'SelectionType'),'open') + fm_about + end + elseif pos(1) > 0.0406404 && pos(2) > 0.0358255 && ... + pos(1) < 0.9618 && pos(2) < 0.0794 + if strcmp(get(Fig.main,'SelectionType'),'open') + fm_hist + end + elseif pos(1) > 0.098522 && pos(2) > 0.7180 && ... + pos(1) < 0.5751 && pos(2) < 0.7569 + if strcmp(get(Fig.main,'SelectionType'),'open') + fm_set setpert, + end + elseif pos(1) > 0.098522 && pos(2) > 0.8317 && ... + pos(1) < 0.5751 && pos(2) < 0.8706 + if strcmp(get(Fig.main,'SelectionType'),'open') + fm_set setdata, + end + end + + case 'buttonmotion' + + if Settings.hostver >= 7.01 + pointer = 'hand'; + else + pointer = 'crosshair'; + end + + pos = get(Fig.main,'CurrentPoint'); + if pos(1) > 0.04064 && pos(2) > 0.1152 && ... + pos(1) < 0.2943 && pos(2) < 0.3395 + set(Fig.main,'Pointer',pointer); + elseif pos(1) > 0.0406404 && pos(2) > 0.0358255 && ... + pos(1) < 0.9618 && pos(2) < 0.0794 + set(Fig.main,'Pointer',pointer); + elseif pos(1) > 0.098522 && pos(2) > 0.7180 && ... + pos(1) < 0.5751 && pos(2) < 0.7569 + set(Fig.main,'Pointer',pointer); + elseif pos(1) > 0.098522 && pos(2) > 0.8317 && ... + pos(1) < 0.5751 && pos(2) < 0.8706 + set(Fig.main,'Pointer',pointer); + else + set(Fig.main,'Pointer','arrow'); + end + + end + + return + +end + +if ishandle(Fig.main) + figure(Fig.main) + return +end + +simversion = '5.1 (R13SP1)'; +allowsimconv = 1; + +h0 = figure('Color',Theme.color01, ... + 'Units','normalized', ... + 'CreateFcn','Fig.main = gcf;', ... + 'DeleteFcn','fm_set delete', ... + 'FileName','fm_main', ... + 'KeyPressFcn','fm_set keypress', ... + 'MenuBar','none', ... + 'Name',['PSAT ',Settings.version], ... + 'NumberTitle','off', ... + 'PaperPosition',[18 180 576 432], ... + 'PaperType','A4', ... + 'PaperUnits','points', ... + 'Position',sizefig(0.6348,0.6276), ... + 'RendererMode','manual', ... + 'Resize','on', ... + 'Tag','Settings', ... + 'ToolBar','none', ... + 'UserData', 1, ... + 'WindowButtonDownFcn','fm_main buttondown', ... + 'WindowButtonMotionFcn','fm_main buttonmotion'); + +if Settings.hostver < 7.05 + set(h0,'ShareColors','on') +end + +if Settings.hostver <= 7.09 + set(h0,'MinColormap', 256) +end + +fm_set colormap + +% Menu File/Open +h1 = uimenu('Parent',h0, ... + 'Label','File', ... + 'Tag','MenuFile'); + +h2 = uimenu('Parent',h1, ... + 'Label', 'Open', ... + 'Tag','FileOpen'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set setdata', ... + 'Label', 'Data File', ... + 'Tag','OpenData', ... + 'Accelerator','d'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set setpert', ... + 'Label', 'Perturbation File', ... + 'Tag','OpenPert', ... + 'Accelerator','j'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set opensys', ... + 'Label', 'Saved System', ... + 'Tag','OpenLF', ... + 'Accelerator','y'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_simrep(''ViewModel'',0,0)', ... + 'Label', 'Current Simulink model', ... + 'Tag','OpenSimModel', ... + 'Accelerator','0'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set opensim', ... + 'Label', 'Simulink Model', ... + 'Tag','OpenSim', ... + 'Accelerator','%'); + +% Menu File/Save +h2 = uimenu('Parent',h1, ... + 'Label', 'Save', ... + 'Tag','FileSave'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set savesys', ... + 'Label', 'Current System', ... + 'Tag','SaveLF', ... + 'Accelerator','a'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set savedata', ... + 'Label', 'Restore Data File', ... + 'Tag','SaveD', ... + 'Accelerator','r'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_dump', ... + 'Label', 'Dump Data File', ... + 'Tag','SaveDump'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set appendV normal', ... + 'Label', 'Save Voltages', ... + 'Tag','SaveV'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set appendV flat', ... + 'Label', 'Set Flat Voltages', ... + 'Tag','FlatV'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_set savesettings', ... + 'Label', 'Settings', ... + 'Tag','SaveS'); +h3 = uimenu('Parent',h2, ... + 'Callback','fm_simsave(''fm_lib.mdl'',Path.psat)', ... + 'Label', ['Library as Simulink ', simversion], ... + 'Tag','SaveS'); +if ~allowsimconv, set(h3,'Enable','off'), end +h3 = uimenu('Parent',h2, ... + 'Callback','fm_simsave', ... + 'Label',['Save model as Simulink ',simversion], ... + 'Tag','ToolsSIMMOD'); +if ~allowsimconv, set(h3,'Enable','off'), end +h3 = uimenu('Parent',h2, ... + 'Callback','fm_simsave(''all'')', ... + 'Label',['Save all models in folder as Sim. ',simversion], ... + 'Tag','ToolsALLSIM'); +if ~allowsimconv, set(h3,'Enable','off'), end +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set closedata', ... + 'Label','Discard Data File', ... + 'Tag','DataClose', ... + 'Separator','on'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set closepert', ... + 'Label','Discard Perturbation File', ... + 'Tag','PertClose'); +h2 = uimenu('Parent',h1, ... + 'Callback','close(gcf)', ... + 'Label','Close', ... + 'Tag','FileClose', ... + 'Separator','on', ... + 'Accelerator','q'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set exit', ... + 'Label','Exit', ... + 'Tag','NetSett', ... + 'Accelerator','x'); + +% Menu Edit +h1 = uimenu('Parent',h0, ... + 'Label','Edit', ... + 'Tag','MenuEdit'); +h2 = uimenu('Parent',h1, ... + 'Callback',fmlib, ... + 'Label', 'Simulink Library', ... + 'Tag','NetEdit', ... + 'Accelerator','s'); +a = dir([Path.psat,filesep,'*.mdl']); +a = {a.name}'; +idx = strmatch('fm_xlib',a); +for i = 2:length(idx) + h2 = uimenu('Parent',h1, ... + 'Callback',strrep(a{idx(i)},'.mdl',''), ... + 'Label',['Extra Library #',num2str(i-1)], ... + 'Tag',['NetEdit',num2str(i)]); +end +h2 = uimenu('Parent',h1, ... + 'Callback','fm_simset', ... + 'Label','Simulink Model Settings', ... + 'Tag','NetSett'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_setting', ... + 'Label','General Settings', ... + 'Tag','ToolSett', ... + 'Separator','on', ... + 'Accelerator','k'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_advanced', ... + 'Label','Advanced Settings', ... + 'Tag','ToolAdvanced'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_plotsel', ... + 'Label','Select Plot Variables', ... + 'Tag','PlotSetVar'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_snbfig', ... + 'Label','SNB Settings', ... + 'Tag','ToolSNBSett', ... + 'Accelerator','g'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_libfig', ... + 'Label', 'LIB Settings', ... + 'Tag','ToolLIBSett', ... + 'Accelerator','l'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_cpffig', ... + 'Label','CPF Settings', ... + 'Tag','ToolOPFSett', ... + 'Accelerator','i'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_opffig', ... + 'Label','OPF Settings', ... + 'Tag','ToolCPFSett', ... + 'Accelerator','z'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set setdefault', ... + 'Label','Set Default', ... + 'Tag','ToolDef'); + +% Menu Run +h1 = uimenu('Parent',h0, ... + 'Label','Run', ... + 'Tag','MenuRun'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set lf', ... + 'Label','Power Flow', ... + 'Tag','RunPF', ... + 'Accelerator','p'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_snb', ... + 'Label','Saddle-Node Bifurcation', ... + 'Tag','ViewSNB'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_limit', ... + 'Label','Limit-Induced Bifurcation', ... + 'Tag','ViewLIB'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_cpf(''cpf'');', ... + 'Label','Continuation Power Flow', ... + 'Tag','ViewCPF', ... + 'Accelerator','c'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set opf', ... + 'Label','Optimal Power Flow', ... + 'Tag','ViewOPF', ... + 'Accelerator','o'); + +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set sc', ... + 'Label','Short Circuit', ... + 'Tag','RunSC'); % add By s.M.Shariatzadeh + +h2 = uimenu('Parent',h1, ... + 'Callback','fm_n1cont', ... + 'Label','N-1 Contingency Analysis', ... + 'Tag','ViewN1C'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_eigfig', ... + 'Label','Eigenvalue Analysis', ... + 'Tag','ViewEIG', ... + 'Separator','on', ... + 'Accelerator','e'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_int', ... + 'Label','Time Simulation', ... + 'Tag','RunTime', ... + 'Accelerator','t'); + +% Menu Tools +h1 = uimenu('Parent',h0, ... + 'Label','Tools', ... + 'Tag','Tool'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_dir(0)', ... + 'Label','Data Format Conversion', ... + 'Tag','ToolDir', ... + 'Accelerator','f'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_comp copen', ... + 'Label','Component Browser', ... + 'Tag','ToolComp', ... + 'Accelerator','b'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_snap', ... + 'Label','Snapshots', ... + 'Tag','ToolSnap', ... + 'Accelerator','n'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_pmufig', ... + 'Label','PMU placement', ... + 'Tag','ToolsPMU', ... + 'Accelerator','u'); +%h2 = uimenu('Parent',h1, ... +% 'Callback','fm_pcode', ... +% 'Label','Archive (p-code)', ... +% 'Tag','ToolsPCODE', ... +% 'Separator','on'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_laprint', ... + 'Label','LaTeX Print', ... + 'Tag','ToolsLaPrint', ... + 'Separator','on'); + +% Menu Interfaces +h1 = uimenu('Parent',h0, ... + 'Label','Interfaces', ... + 'Tag','Interface'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_gamsfig', ... + 'Label','GAMS', ... + 'Accelerator', '1', ... + 'Tag','InterGams'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_uwfig', ... + 'Label','UWPFLOW', ... + 'Accelerator','2', ... + 'Tag','InterGams'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_equivfig', ... + 'Label','Network Equivalents', ... + 'Separator','on', ... + 'Accelerator','3', ... + 'Tag','LibEquiv'); + +% Menu View +h1 = uimenu('Parent',h0, ... + 'Label','View', ... + 'Tag','View'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_stat', ... + 'Label','Static Report', ... + 'Tag','ToolStat', ... + 'Accelerator','v'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_threed', ... + 'Label','Network Visualization', ... + 'Tag','ToolStat', ... + 'Accelerator','$'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_matrx', ... + 'Label','Sparse Matrix Visualisation', ... + 'Tag','ViewSparseMenu', ... + 'Accelerator','m'); +%h2 = uimenu('Parent',h1, ... +% 'Callback','fm_vstab', ... +% 'Label','View Node Sensitivity', ... +% 'Tag','ViewEA'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_plotfig', ... + 'Label','Plotting Utilities', ... + 'Tag','ViewPlot', ... + 'Separator','on', ... + 'Accelerator','w'); +h2 = uimenu('Parent',h1, ... + 'Callback','vwplot(Wind)', ... + 'Label','Plot wind speeds', ... + 'Tag','ViewWind'); + +% Menu Options +h1 = uimenu('Parent',h0, ... + 'Label','Options', ... + 'Tag','Options'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_hist', ... + 'Label','History', ... + 'Tag','ToolHist', ... + 'Accelerator','h'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_themefig', ... + 'Label','Themes', ... + 'Tag','OptionsTh', ... + 'Separator','on'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_tviewer', ... + 'Label','Text Viewer', ... + 'Tag','OptionsTV'); + +% Menu Help +h1 = uimenu('Parent',h0, ... + 'Label','Help', ... + 'Tag','uimenu2'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_about', ... + 'Label','About PSAT', ... + 'Tag','Subuimenu3'); +h2 = uimenu('Parent',h1, ... + 'Callback','web(''faraday1.ucd.ie/psat.html'');', ... + 'Label','PSAT website', ... + 'Tag','UWLink', ... + 'Separator','on'); +h2 = uimenu('Parent',h1, ... + 'Callback','web(''http://groups.yahoo.com/group/psatforum'');', ... + 'Label','PSAT Forum', ... + 'Tag','YahooLink'); +h2 = uimenu('Parent',h1, ... + 'Label','Feedback', ... + 'Tag','MailLink'); +h3 = uimenu('Parent',h2, ... + 'Callback','web(''mailto:federico.milano@ucd.ie'');', ... + 'Label','federico.milano@ucd.ie', ... + 'Tag','MailUW'); +h3 = uimenu('Parent',h2, ... + 'Callback','web(''mailto:milano.federico@gmail.com'');', ... + 'Label','milano.federico@gmail.com', ... + 'Tag','MailUCLM'); +h3 = uimenu('Parent',h2, ... + 'Callback','web(''mailto:psatforum@yahoo.com'');', ... + 'Label','psatforum@yahoo.com', ... + 'Tag','MailYahoo'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_enter(Path.psat,Settings.version,Settings.date)', ... + 'Label','Splash Window', ... + 'Tag','SplashPSAT'); + +if Settings.hostver < 8.04 + h2 = uimenu('Parent',h1, ... + 'Callback','fm_clock', ... + 'Label','Clock', ... + 'Tag','ClockMenu', ... + 'Separator','on'); +end +h2 = uimenu('Parent',h1, ... + 'Callback','fm_warranty', ... + 'Label','No Warranty', ... + 'Tag','WarMenu', ... + 'Separator','on'); +h2 = uimenu('Parent',h1, ... + 'Callback','fm_license', ... + 'Label','GNU License', ... + 'Tag','LicMenu'); + +% general pushbuttons +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color03, ... + 'Callback','fm_set lf', ... + 'FontWeight','bold', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.35345 0.26324 0.16379 0.068536], ... + 'String','Power Flow', ... + 'Tag','Pushbutton1'); +h1 = uicontrol('Parent',h0, ... 'changed by Majid Shariatzadeh + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set savesys', ... + 'Position',[0.7968 0.26324 0.16379 0.068536], ... + 'String','Save System', ... + 'Tag','Pushbutton5'); +h1 = uicontrol('Parent',h0, ... 'changed by Majid Shariatzadeh + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set sc', ... + 'Position',[0.57512 0.18847 0.16379 0.068536], ... + 'String','Short Circuit', ... + 'Tag','Pushbutton4', ... + 'UserData','[ ]'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_cpf(''main'');', ... + 'Position',[0.35345 0.18847 0.16379 0.068536], ... + 'String','CPF', ... + 'Tag','Pushbutton3'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color03, ... + 'Callback','fm_int', ... + 'FontWeight','bold', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.57389 0.26324 0.16379 0.068536], ... + 'String','Time Domain', ... + 'Tag','Pushbutton2'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_plotfig', ... + 'Position',[0.7968 0.18847 0.16379 0.068536], ... + 'String','Plot', ... + 'Tag','Pushbutton6'); +%h1 = uicontrol('Parent',h0, ... +% 'Units','normalized', ... +% 'BackgroundColor',Theme.color02, ... +% 'Callback','fm_set close', ... +% 'Position',[0.7968 0.11371 0.16379 0.068536], ... +% 'String','Close', ... +% 'Tag','PushClose'); % edit By Majid Shariatzadeh (convert close Icon To Static report) +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_stat', ... + 'Position',[0.7968 0.11371 0.16379 0.068536], ... + 'String','Static Report', ... + 'Tag','PushstatRep'); % edit By Majid Shariatzadeh (convert close Icon To Static report) + +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_eigfig', ... + 'Position',[0.57512 0.11371 0.16379 0.068536], ... + 'String','Eigenvalue', ... + 'Tag','Pushbutton10'); % edit By Majid Shariatzadeh (convert Savesystem Icon To Eigenvalue) +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set opf', ... + 'Position',[0.35345 0.11371 0.16379 0.068536], ... + 'String','OPF', ... + 'Tag','Pushbutton9'); + +% PSAT logo +set(Fig.main,'Units','pixels') +figdim = get(Fig.main,'Position'); +set(Fig.main,'Units','normalized') +xdim = fix(0.2536946*figdim(3)); +ydim = fix(0.2242991*figdim(4)); + +h1 = axes('Parent',h0, ... + 'CreateFcn','Hdl.axes = gca;', ... + 'Units','normalized', ... + 'Box','on', ... + 'CameraUpVector',[0 1 0], ... + 'CameraUpVectorMode','manual', ... + 'Color',Theme.color04, ... + 'ColorOrder',Settings.color, ... + 'HandleVisibility','on', ... + 'HitTest','off', ... + 'Layer','top', ... + 'Position',[0.0406404 0.1152265 0.2536946 0.22429907], ... + 'Tag','Axes1', ... + 'XColor',Theme.color03, ... + 'XLim',[0.5 xdim+0.5], ... + 'XLimMode','manual', ... + 'XTickLabelMode','manual', ... + 'XTickMode','manual', ... + 'YColor',Theme.color03, ... + 'YLim',[0.5 ydim+0.5], ... + 'YLimMode','manual', ... + 'YTickLabelMode','manual', ... + 'YTickMode','manual', ... + 'ZColor',[0 0 0]); + +a = imread([Path.images,'main_logo.jpg'],'jpg'); +%a = fm_mat('main_logo'); + +try + if Settings.hostver >= 7.04 + a = imresize(a,[ydim xdim],'bilinear'); + else + a = imresize(a,[ydim xdim],'bilinear',11); + end +catch + % imresize is not available!!! +end +if ispc, set(h1,'XColor',[126 157 185]/255,'YColor',[126 157 185]/255), end +if Settings.hostver < 8.04 + set(h1,'YDir','reverse') + h2 = image( ... + 'Parent',h1, ... + 'CData',a, ... + 'Tag','Axes1Image1', ... + 'XData',[1 xdim], ... + 'YData',[1 ydim]); + set(h2,'EraseMode','none'); +else + h2 = image( ... + 'Parent',h1, ... + 'CData',flipud(a), ... + 'Tag','Axes1Image1', ... + 'XData',[1 xdim], ... + 'YData',[1 ydim]); +end +color1 = [0 0 0]; +color2 = [0 0.503 0]; +if sum(Theme.color02) < 1 + color1 = [1 1 1]; + color2 = [0 1 0]; +end + +if Settings.hostver < 8.04 + h1 = text(0.08*xdim,0.175*ydim,'PSAT'); +else + h1 = text(0.08*xdim,ydim-0.175*ydim,'PSAT'); +end +set(h1, ... + 'Color',color1, ... + 'FontSize',12, ... + 'FontWeight','bold', ... + 'FontName','Times') +if Settings.hostver < 8.04 + h1 = text(0.08*xdim,0.9*ydim,Settings.date); +else + h1 = text(0.08*xdim,ydim-0.9*ydim,Settings.date); +end +set(h1, ... + 'Color',color2, ... + 'FontSize', 9, ... + 'FontWeight','bold', ... + 'FontName','Times') +if Settings.hostver < 8.04 + h1 = text(0.08*xdim,0.775*ydim,['Version ',Settings.version]); +else + h1 = text(0.08*xdim,ydim-0.775*ydim,['Version ',Settings.version]); +end +set(h1, ... + 'Color',color2, ... + 'FontSize', 9, ... + 'FontWeight','bold', ... + 'FontName','Times') + +% frame and general settings +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'ForegroundColor',Theme.color03, ... + 'Position',[0.04064 0.35358 0.91872 0.57125], ... + 'Enable', 'inactive', ... + 'Style','frame', ... + 'Tag','Frame1'); +%h1 = uicontrol('Parent',h0, ... +% 'Units','normalized', ... +% 'BackgroundColor',Theme.color02, ... +% 'Callback','fm_set setpert', ... +% 'Position',[0.41749 0.74143-0.025 0.15764 0.042056], ... +% 'String','Set Perturbation File', ... +% 'Tag','Pushbutton8'); +%h1 = uicontrol('Parent',h0, ... +% 'Units','normalized', ... +% 'BackgroundColor',Theme.color02, ... +% 'Callback','fm_set setdata', ... +% 'Position',[0.41749 0.85514-0.025 0.15764 0.042056], ... +% 'String','Set Data File', ... +% 'Tag','Pushbutton7'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.098522 0.7601 0.18547 0.028037], ... + 'String','Perturbation File', ... + 'Style','text', ... + 'Tag','StaticText10'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.098522 0.8738 0.13547 0.028037], ... + 'String','Data File', ... + 'Style','text', ... + 'Tag','StaticText9'); + +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'ForegroundColor',Theme.color05, ... + 'Enable', 'inactive', ... + 'Position',[0.098522 0.7180 0.4766 0.038941], ... + 'Style','frame', ... + 'Tag','FramePert'); +if ispc, set(h1,'Style','edit'), end +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'ForegroundColor',Theme.color05, ... + 'Enable', 'inactive', ... + 'Position',[0.098522 0.8317 0.4766 0.038941], ... + 'Style','frame', ... + 'Tag','FrameData'); +if ispc, set(h1,'Style','edit'), end + +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'CreateFcn','if ~isempty(File.pert) && ~strcmp(File.pert,''pert''), set(gcbo,''String'',File.pert); end', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color04, ... + 'Enable', 'inactive', ... + 'HorizontalAlignment','left', ... + 'Position',[0.105 0.722 0.46 0.03], ... + 'Style','text', ... + 'TooltipString',[Path.pert,File.pert], ... + 'Tag','EditText10'); +if strcmp('@ ',File.pert(1:min(end,2))) + set(h1,'ForegroundColor',[0 0 0.592]) +end + +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'CreateFcn','if ~isempty(File.data), set(gcbo,''String'',File.data); end', ... + 'Enable', 'inactive', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color07, ... + 'HorizontalAlignment','left', ... + 'TooltipString',[Path.data,File.data], ... + 'Position',[0.105 0.8357 0.46 0.03], ... + 'Style','text', ... + 'Tag','EditText9'); +if ~isempty(findstr(File.data,'(mdl)')) + set(h1,'ForegroundColor',[0 0.592 0]) +end +if strcmp('@ ',File.data(1:min(end,2))) + set(h1,'ForegroundColor',[0 0 0.592]) +end + +if strcmp(Settings.platform,'MAC') + dm = 0.01; + aligntxt = 'center'; +else + dm = 0; + aligntxt = 'left'; +end + +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.098522 0.6385 0.18547 0.028037], ... + 'String','Command Line', ... + 'Style','text', ... + 'Tag','StaticText10'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','fm_set command', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.098522 0.5965-dm 0.4766 0.042056+dm], ... + 'String','', ... + 'Style','edit', ... + 'Tag','EditCommand'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'Callback','fm_set listcommand', ... + 'BackgroundColor',Theme.color01, ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'Position',[0.098522 0.3940 0.4766 0.17134], ... + 'String',{''}, ... + 'Style','listbox', ... + 'Tag','ListCommand', ... + 'Value',1); + +% system parameters +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.3940 0.14778 0.037383], ... + 'String','Max Dyn. Iter.', ... + 'Style','text', ... + 'Tag','StaticText8'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.dyntol = fval(gcbo,Settings.dyntol);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.4563 0.096059 0.038941+dm], ... + 'String',num2str(Settings.dyntol), ... + 'Style','edit', ... + 'Tag','EditText7'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.4563 0.14778 0.037383], ... + 'String','Dyn. Tolerance', ... + 'Style','text', ... + 'Tag','StaticText7'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.dynmit = fval(gcbo,Settings.dynmit);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.3940 0.096059 0.038941+dm], ... + 'String',num2str(Settings.dynmit), ... + 'Style','edit', ... + 'Tag','EditText8'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.5186 0.14778 0.037383], ... + 'String','Max PF Iter.', ... + 'Style','text', ... + 'Tag','StaticText6'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.lfmit = fval(gcbo,Settings.lfmit);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.5186 0.096059 0.038941+dm], ... + 'String',num2str(Settings.lfmit), ... + 'Style','edit', ... + 'Tag','EditText6'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.5809 0.14778 0.037383], ... + 'String','PF Tolerance', ... + 'Style','text', ... + 'Tag','StaticText5'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.lftol = fval(gcbo,Settings.lftol);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.5809 0.096059 0.038941+dm], ... + 'String',num2str(Settings.lftol), ... + 'Style','edit', ... + 'Tag','EditText5'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.6432 0.15778 0.037383], ... + 'String','Ending Time (s)', ... + 'Style','text', ... + 'Tag','StaticText4'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.tf = fval(gcbo,Settings.tf);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.6432 0.096059 0.038941+dm], ... + 'String',num2str(Settings.tf), ... + 'Style','edit', ... + 'Tag','EditText4'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.7055 0.16 0.037383], ... + 'String','Starting Time (s)', ... + 'Style','text', ... + 'Tag','StaticText3'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.t0 = fval(gcbo,Settings.t0);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HitTest','off', ... + 'HorizontalAlignment',aligntxt, ... + 'ListboxTop',0, ... + 'Position',[0.69089 0.7055 0.096059 0.038941+dm], ... + 'String',num2str(Settings.t0), ... + 'Style','edit', ... + 'Tag','EditText3'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.7678 0.17 0.037383], ... + 'String','Power Base (MVA)', ... + 'Style','text', ... + 'Tag','StaticText2'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.mva = fval(gcbo,Settings.mva,2);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.7678 0.096059 0.038941+dm], ... + 'String',num2str(Settings.mva), ... + 'Style','edit', ... + 'Tag','EditText2'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.79926 0.8301 0.14778 0.037383], ... + 'String','Freq. Base (Hz)', ... + 'Style','text', ... + 'Tag','StaticText1'); +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.freq = fval(gcbo,Settings.freq,2);', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment',aligntxt, ... + 'Position',[0.69089 0.8301 0.094828 0.038941+dm], ... + 'String',num2str(Settings.freq), ... + 'Style','edit', ... + 'Tag','EditText1'); + +% Menubar +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_open'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set setdata', ... + 'Position',[0.0379 0.9375 0.0379 0.05], ... + 'TooltipString','Open Data File', ... + 'Tag','Pushbutton7'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_opensys'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set opensys', ... + 'Position',[0.0379*2 0.9375 0.0379 0.05], ... + 'TooltipString','Open System', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_pert'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set setpert', ... + 'Position',[0.0379*3 0.9375 0.0379 0.05], ... + 'TooltipString','Open Perturbation File', ... + 'Tag','Pushbutton8'); + +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_settings'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_setting', ... + 'Position',[0.0379*4+0.0190-0.01 0.9375 0.0379 0.05], ... + 'TooltipString','Settings', ... + 'Tag','Pushbutton4'); % modified By s.m. Shariatzadeh, add(-0.01) to position +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_save'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set savesys', ... + 'Position',[0.0379*5+0.0190-0.01 0.9375 0.0379 0.05], ... + 'TooltipString','Save System', ... + 'Tag','Pushbutton4'); % modified By s.m. Shariatzadeh, add(-0.01) to position +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_exit'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set close', ... + 'Position',[0.0379*6+0.0190-0.01 0.9375 0.0379 0.05], ... + 'TooltipString','Close window or stop process', ... + 'Tag','Pushbutton4'); % modified By s.m. Shariatzadeh, add(-0.01) to position +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_sym'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback',fmlib, ... + 'Position',[0.0379*7+0.0379-0.017 0.9375 0.0379 0.05], ... + 'TooltipString','Open PSAT Simulink Library', ... + 'Tag','Pushbutton8');% modified By s.m. Shariatzadeh, add(-0.017) to position + +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_curntsym'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_simrep(''ViewModel'',0,0)', ... + 'Position',[0.0379*7+1.5*0.0379 0.9375 0.0379 0.05], ... + 'TooltipString','Open Current Simulink Model', ... + 'Tag','Pushbutton800'); % add By s.m. Shariatzadeh new Icon for "Current Simulink Model" + + +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_lf'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set lf', ... + 'Position',[0.0379*8+0.0569+0.01 0.9375 0.0379 0.05], ... + 'TooltipString','Solve Power Flow', ... + 'Tag','Pushbutton1'); % modified By s.m. Shariatzadeh add(+0.01) to position +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_cpf'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_cpf(''main'');', ... + 'Position',[0.0379*9+0.0569+0.01 0.9375 0.0379 0.05], ... + 'TooltipString','Continuation Power Flow', ... + 'Tag','Pushbutton4');% modified By s.m. Shariatzadeh add(+0.01) to position +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_opf'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_set opf', ... + 'Position',[0.0379*10+0.0569+0.01 0.9375 0.0379 0.05], ... + 'TooltipString','Optimal Power Flow', ... + 'Tag','Pushbutton4');% modified By s.m. Shariatzadeh add(+0.01) to position +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_eigen'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_eigfig', ... + 'Position',[0.0379*11+0.0759 0.9375 0.0379 0.05], ... + 'TooltipString','Eigenvalue Analysis', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_time'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_int', ... + 'Position',[0.0379*12+0.0759 0.9375 0.0379 0.05], ... + 'TooltipString','Time Domain Simulation', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_conv'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_dir(0)', ... + 'Position',[0.0379*13+0.0949 0.9375 0.0379 0.05], ... + 'TooltipString','Data Format Conversion', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_make'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_comp copen', ... + 'Position',[0.0379*14+0.0949 0.9375 0.0379 0.05], ... + 'TooltipString','Component Browser', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_snapshot'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_snap', ... + 'Position',[0.0379*15+0.0949 0.9375 0.0379 0.05], ... + 'TooltipString','Snapshots', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_static'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_stat', ... + 'Position',[0.0379*16+0.1139 0.9375 0.0379 0.05], ... + 'TooltipString','Static Report', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_matrix'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_threed', ... + 'Position',[0.0379*17+0.1139 0.9375 0.0379 0.05], ... + 'TooltipString','Sparse Matrix Visualization', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_plot'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_plotfig', ... + 'Position',[0.0379*18+0.1139 0.9375 0.0379 0.05], ... + 'TooltipString','Plotting Utilities', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_history'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_hist', ... + 'Position',[0.0379*19+0.1329 0.9375 0.0379 0.05], ... + 'TooltipString','History', ... + 'Tag','Pushbutton4'); +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_info'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_about', ... + 'Position',[0.0379*20+0.1625 0.9375 0.0379 0.05], ... + 'TooltipString','About PSAT', ... + 'Tag','Pushbutton8'); + +% Message bar +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'ForegroundColor',Theme.color05, ... + 'CreateFcn','Hdl.frame = gcbo;', ... + 'Enable', 'inactive', ... + 'Position',[0.04064 0.035826 0.92118 0.043614], ... + 'Style','frame', ... + 'Tag','Frame2'); +if ispc, set(h1,'Style','edit'), end +h1 = uicontrol('Parent',h0, ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color04, ... + 'CreateFcn','Hdl.text = gcbo;', ... + 'Enable', 'inactive', ... + 'FontName',Theme.font01, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment','left', ... + 'Position',[0.0542 0.0400 0.8916 0.0312], ... + 'String',['PSAT version ',Settings.version, ... + ', Copyright (C) 2002-2019 Federico Milano'], ... + 'TooltipString','Double click for viewing the command history.', ... + 'Style','text', ... + 'Tag','StaticText13'); +if nargout > 0, fig = h0; end diff --git a/fm_set.m b/fm_set.m new file mode 100644 index 0000000..38bbd08 --- /dev/null +++ b/fm_set.m @@ -0,0 +1,935 @@ +function fm_set(varargin) +% FM_SET define general settings and operations for +% the main window and other utilities +% +%FM_SET(COMMAND) +% COMMAND = 'lf' solves power flow +% COMMAND = 'setdata' sets data file +% COMMAND = 'opensys' load system +% COMMAND = 'savesys' save current system +% etc. +% +%Author: Federico Milano +%Date: 11-Nov-2002 +%Update: 10-Feb-2003 +%Update: 27-Feb-2003 +%Version: 1.0.2 +% +%E-mail: federico.milano@ucd.ie +%Web-site: faraday1.ucd.ie/psat.html +% +% Copyright (C) 2002-2019 Federico Milano + +global Settings +fm_var + +command = varargin{1}; + +switch command + case 'colormap' + + map = [0 0 0; + 0 0 0.5020; + 0 0 1.0000; + 0.5020 0 0; + 0.5020 0 0.5020; + 1.0000 0 0; + 1.0000 0 1.0000; + 0 0.5020 0; + 0 0.7530 0.5020; + 0.5020 0.5020 0; + 0.5020 0.5020 0.5020; + 0.7530 0.7530 0.7530; + 0 1.0000 0; + 0 0.7530 1.0000; + 1.0000 1.0000 0; + 1.0000 1.0000 1.0000]; + set(gcf,'ColorMap',map); + + case 'delete' + + Fig.main = -1; + Hdl.status = -1; + Hdl.text = -1; + Hdl.status = -1; + Hdl.frame = -1; + Hdl.bar = -1; + Hdl.axes = -1; + + case 'keypress' + + hdl = findobj(gcbf,'Tag','EditCommand'); + tasto = get(Fig.main,'CurrentCharacter'); + if isempty(tasto), return, end + switch double(tasto) + case 13 + fm_set('command') + case 8 + testo = get(hdl,'String'); + if length(testo) <= 1 + testo = ''; + else + testo = testo(1:end-1); + end + set(hdl,'String',testo) + case 9 + set(hdl,'SelectionHighlight','on') + case 127 + set(hdl,'String','') + case 28 + stringa = get(hdl,'String'); + set(hdl,'String',stringa(1:end-1),'UserData',stringa) + case 29 + stringa = get(hdl,'String'); + set(hdl,'String',stringa(1:end-1),'UserData',stringa) + case 27 + fm_set('exit') + case 30 + hdll = findobj(gcbf,'Tag','ListCommand'); + stringa = get(hdll,'String'); + value = max(get(hdll,'Value')-1,1); + if ~strcmp(stringa{value},''), + set(hdl,'String',stringa{value}), + set(hdll,'Value',max(value,1)) + end + case 31 + hdll = findobj(gcbf,'Tag','ListCommand'); + stringa = get(hdll,'String'); + value = min(get(hdll,'Value')+1,length(stringa)); + if ~strcmp(stringa{value},''), + set(hdl,'String',stringa{value}), + set(hdll,'Value',max(value,1)) + end + otherwise + set(hdl,'String',[get(hdl,'String'),tasto]) + end + + case 'exit' + + uiwait(fm_choice('Quit PSAT?')) + if Settings.ok, + a = fieldnames(Fig); + for i = length(a):-1:1 + fig = getfield(Fig,a{i}); + if fig, close(fig), end + end + end + + case 'setdefault' + + uiwait(fm_choice('Set Default Values?')); + if Settings.ok == 1 + hdl1 = findobj(gcbf,'Tag','EditText1'); + set(hdl1,'String','50'); + Settings.freq = 50; + hdl2 = findobj(gcbf,'Tag','EditText2'); + set(hdl2,'String','100'); + Settings.mva = 100; + hdl3 = findobj(gcbf,'Tag','EditText3'); + set(hdl3,'String','0'); + Settings.t0 = 0; + hdl4 = findobj(gcbf,'Tag','EditText4'); + set(hdl4,'String','30'); + Settings.tf = 30; + hdl5 = findobj(gcbf,'Tag','EditText5'); + set(hdl5,'String','1e-5'); + Settings.lftol = 1e-5; + hdl6 = findobj(gcbf,'Tag','EditText6'); + set(hdl6,'String','20'); + Settings.lfmit = 20; + hdl7 = findobj(gcbf,'Tag','EditText7'); + Settings.dyntol = 1e-5; + set(hdl7,'String','1e-5'); + hdl8 = findobj(gcbf,'Tag','EditText8'); + Settings.dynmit = 20; + set(hdl8,'String','20'); + + Settings.vs = 0; + Settings.plot = 1; + Settings.red = 1; + Settings.showlf = 0; + Settings.dlf = 0; + Settings.dac = 0; + Settings.method = 2; + Settings.plottype = 1; + + fm_disp('Default parameter values set.') + else + fm_disp('No parameter values resetting.') + end + + case 'savesys' + + if ~Bus.n || ~Settings.init + fm_disp('No system is loaded. ',2), + return, + end + fileout = fm_filenum('out'); + filedata = strrep(File.data,'@ ',''); + filepert = strrep(File.pert,'@ ',''); + + pathdata = Path.data; + if strcmp(pathdata(1),'~') + pathdata = [getenv('HOME'),pathdata(2:end)]; + end + + pathpert = Path.pert; + if ~isempty(Path.pert) + if strcmp(pathpert(1),'~') + pathpert = [getenv('HOME'),pathpert(2:end)]; + end + end + + filedata = strrep(filedata,'(mdl)','_mdl'); + if Settings.matlab && Settings.hostver >= 7.14, + Source.data = ... + strvcat(textread([pathdata,deblank(filedata),'.m'], ... + '%s','delimiter', ... + '\n','whitespace','')); + + if ~isempty(Path.pert) + Source.pert = ... + strvcat(textread([pathpert,deblank(filepert),'.m'], ... + '%s','delimiter', ... + '\n','whitespace','')); + end + else + Source.data = ... + char(textread([pathdata,deblank(filedata),'.m'], ... + '%s','delimiter', ... + '\n','whitespace','')); + + if ~isempty(Path.pert) + Source.pert = ... + char(textread([pathpert,deblank(filepert),'.m'], ... + '%s','delimiter', ... + '\n','whitespace','')); + end + end + hdlpert = Hdl.pert; + Hdl.pert = ''; + save([pathdata,fileout,'.out']) + Hdl.pert = hdlpert; + fm_disp + fm_disp(['System saved in "',Path.data,fileout,'.out"']) + + case 'closepert' + + fm_disp(['Perturbation file "',Path.pert,File.pert,'" closed.'],1) + Path.pert = ''; + File.pert = ''; + Source.pert = ''; + cd(Path.psat) + if Settings.hostver >= 6 + Hdl.pert = str2func('pert'); + else + Hdl.pert = 'pert'; + end + cd(Path.local) + hdltext = findobj(Fig.main,'Tag','EditText10'); + set(hdltext,'String','','TooltipString',''); + + case 'closedata' + + fm_disp(['Data file "',Path.data,File.data,'" closed.'],1) + Path.data = ''; + File.data = ''; + Source.data = ''; + hdltext = findobj(Fig.main,'Tag','EditText9'); + set(hdltext,'String','','TooltipString',''); + + case 'savesettings' + + [fid,msg] = fopen([Path.psat,'settings.m'],'wt'); + if fid == -1 + fm_disp(msg) + return + end + fields = fieldnames(Settings); + for i = 1:length(fields) + if strcmp(fields{i},'color') + continue + end + value = eval(['Settings.',fields{i}]); + if isnumeric(value) + cout = fprintf(fid,'Settings.%s = %s;\n',fields{i},num2str(value)); + else + cout = fprintf(fid,'Settings.%s = ''%s'';\n',fields{i},value); + end + end + fields = fieldnames(Theme); + for i = 1:length(fields) + if strcmp(fields{i},'hdl') + continue + end + value = eval(['Theme.',fields{i}]); + if isnumeric(value) + cout = fprintf(fid,'Theme.%s = [%s];\n',fields{i},num2str(value)); + else + cout = fprintf(fid,'Theme.%s = ''%s'';\n',fields{i},value); + end + end + cout = fprintf(fid,'Theme.hdl = zeros(18,1);\n'); + fclose(fid); + + case 'savedata' + + filedata = [File.data,' ']; + if strcmp(filedata([1:2]),'@ ') + filedata = deblank(strrep(filedata,'@ ','')); + if isempty(Source.data), + fm_disp('Cannot restore the data file.'), + return, + end + a = dir([Path.data,'*.m']); + b = {a.name}; + older = strmatch([filedata,'.m'],b,'exact'); + if ~isempty(older) + uiwait(fm_choice(['Overwrite Existing File "',filedata,'.m" ?'])) + if ~Settings.ok, + return, + end + end + try + fid = fopen([Path.data,filedata,'.m'],'wt'); + if fid == -1, + fm_disp(['Cannot write the data file. Check folder ' ... + 'authorizations.'],2), + return, + end + catch + fm_disp(['Cannot write the data file. Check folder ' ... + 'authorizations.'],2) + return + end + rowc = length(Source.data(1,:)); + count = fprintf(fid,[repmat('%c',1,rowc),' \n'],Source.data'); + fclose(fid); + fm_disp(['Data file stored in "',Path.data,filedata,'.m"']) + File.data = filedata; + hdltext = findobj(Fig.main,'Tag','EditText9'); + set(hdltext, ... + 'String',File.data, ... + 'TooltipString',[Path.data,File.data]); + + else + fm_disp('The current data file is already saved.') + end + + case 'close' + + stringa = get(findobj(Fig.main,'Tag','PushClose'),'String'); + if strcmpi(stringa(end-3:end),'stop') + set(Fig.main,'UserData',0) + else + close(Fig.main) + end + + case 'opensys' + + if clpsat.init && nargin > 1 + file = varargin{2}; + pathname = varargin{3}; + else + if ~isempty(Path.data), cd(Path.data); end + [file,pathname] = uigetfile('d*.out',['Select System Data ' ... + 'File']); + end + + fm_disp + if pathname ~= 0 + + path2 = Path; + fig2 = Fig; + hdl2 = Hdl; + file2 = File; + history2 = History; + theme2 = Theme; + load([pathname,file],'-mat') + + dfile = strrep(file,'.out','.m'); + pfile = ''; + if ~isempty(Source.pert) + pfile = strrep(file,'.out','.m'); + pfile(1) = 'p'; + end + + fid = fopen([pathname,dfile],'wt+'); + if fid == -1, + fm_disp(['Cannot write the data file. Check folder ' ... + 'authorizations.'],2), + else + rowc = length(Source.data(1,:)); + count = fprintf(fid,[repmat('%c',1,rowc),' \n'],Source.data'); + fclose(fid); + end + if ~isempty(pfile) + fid = fopen([pathname,pfile],'wt+'); + if fid == -1, + fm_disp(['Cannot write the disturbance file. Check folder ' ... + 'authorizations.'],2), + else + rowc = length(Source.pert(1,:)); + count = fprintf(fid,[repmat('%c',1,rowc),' \n'],Source.pert'); + fclose(fid); + cd(pathname) + if Settings.hostver >= 6 + Hdl.pert = str2func(pfile(1:end-2)); + else + Hdl.pert = pfile(1:end-2); + end + cd(Path.local) + end + end + + hdl_data = findobj(fig2.main,'Tag','EditText9'); + hdl_pert = findobj(fig2.main,'Tag','EditText10'); + Fig = fig2; + hdlpert = Hdl.pert; + Hdl = hdl2; + Hdl.pert = hdlpert; + History = history2; + Theme = theme2; + if ~isempty(File.pert), + File.pert = ['@ ',pfile(1:end-2)]; + %File.pert = strrep(File.pert,'@ @ ','@ '); + end + File.data = ['@ ',dfile(1:end-2)]; + %File.data = strrep(File.data,'@ @ ','@ '); + + set(hdl_data, ... + 'String',File.data, ... + 'ForegroundColor',[0 0 0.592], ... + 'TooltipString',[Path.data,File.data]); + set(hdl_pert, ... + 'String',File.pert, ... + 'ForegroundColor',[0 0 0.592], ... + 'TooltipString',[Path.pert,File.pert]); + + Path.psat = path2.psat; + Path.build = path2.build; + Path.local = path2.local; + Path.images = path2.images; + Path.themes = path2.themes; + Path.data = pathname; + if ~isempty(File.pert) + Path.pert = pathname; + else + Path.pert = ''; + end + + if ishandle(Fig.plot) > 0, + close(Fig.plot), + Fig.plot = -1; + end + fm_disp(['System ',pathname, file,' loaded.']) + + else + fm_disp('No loaded system or not existent directory',2) + end + + case 'opensim' + + [filename, pathname] = uigetfile( ... + '*.mdl', ... + 'Pick a Simulink Model'); + if ~pathname, return, end + cd(pathname) + if exist(filename) ~= 4 + fm_disp('The selected file is not a Simulink model.',2) + cd(Path.local) + return + end + open_system(filename(1:end-4)) + cd(Path.local) + + case 'setdata' + + Path.temp = Path.data; + File.temp = File.data; + + if ishandle(Fig.dir) + set(Fig.dir,'Name','Load Data File') + hdl = findobj(Fig.dir,'Tag','Pushbutton1'); + set(hdl,'String','Load','Callback','fm_dirset openfile') + hdl = findobj(Fig.dir,'Tag','Listbox2'); + set(hdl,'Max',0,'ButtonDownFcn','fm_dirset openfile','Value',1) + hdl = findobj(Fig.dir,'Tag','Pushbutton3'); + set(hdl,'Callback','fm_dirset cancel','String','Cancel') + else + fm_dir(1) + end + warning('off', 'all'); + uiwait(Fig.dir); + + if Path.temp == 0 + fm_disp(['No data file has been selected or file does not exist'],2) + return + end + + if strcmp(computer,'GLNX86'), + Path.temp = strrep(Path.temp,getenv('HOME'),'~'); + end + + if exist([Path.temp,File.temp(1:end-2)]) == 4 ... + && strcmp(File.temp(end-1:end),'.m') + fm_choice(['Simulink model with the same name of the ', ... + 'selected data exists. No file set.'],2) + fm_disp('No file data set.',2) + else + File.data = File.temp; + Path.data = Path.temp; + a = dir([Path.data,File.data]); + if isempty(a) + fm_disp(['File "',File.data,'" does not exist.'],2) + return + else + File.modify = a.date; + end + if ~isempty(findstr(File.data,'.mdl')) + % make sure that the file name does not start with a number + first = double(File.data(1)); + if first <= 57 && first >= 48 + localpath = pwd; + cd(Path.data) + if exist(['d',File.data]) ~= 4 + copyfile(File.data,['d',File.data]) + end + cd(localpath) + File.data = ['d',File.data]; + end + exist(File.data(1:end-4)); + File.data = strrep(File.data,'.mdl','(mdl)'); + %end edit by S. Majid Shariatzadeh + + + % add by S. Majid Shariatzadeh + % suypport simulink SLX file + + elseif ~isempty(findstr(File.data,'.slx'))% add by s. Majid Shariatzadeh + % make sure that the file name does not start with a number + first = double(File.data(1)); % add by s. Majid Shariatzadeh + if first <= 57 && first >= 48 % add by s. Majid Shariatzadeh + localpath = pwd; % add by s. Majid Shariatzadeh + cd(Path.data)% add by s. Majid Shariatzadeh + if exist(['d',File.data]) ~= 4% add by s. Majid Shariatzadeh + copyfile(File.data,['d',File.data])% add by s. Majid Shariatzadeh + end% add by s. Majid Shariatzadeh + cd(localpath)% add by s. Majid Shariatzadeh + File.data = ['d',File.data];% add by s. Majid Shariatzadeh + end% add by s. Majid Shariatzadeh + exist(File.data(1:end-4));% add by s. Majid Shariatzadeh + File.data = strrep(File.data,'.slx','(slx)');% add by s. Majid Shariatzadeh + end + + + + + + + + File.data = strrep(File.data,'.m',''); + hdltext = findobj(Fig.main,'Tag','EditText9'); + set(hdltext,'String',File.data, ... + 'TooltipString',[Path.data,File.data]); + if ~isempty(findstr(File.data,'(mdl)')) + set(hdltext,'ForegroundColor',[0 0.592 0]) + elseif ~isempty(findstr(File.data,'(slx)')) % add by s. Majid Shariatzadeh + set(hdltext,'ForegroundColor',[0.2 0.442 0])% add by s. Majid Shariatzadeh + else + set(hdltext,'ForegroundColor',Theme.color07) + end + fm_disp(['Data file "',Path.data,File.data,'" set'],1) + Settings.init = 0; + end + if ishandle(Fig.plotsel), close(Fig.plotsel), end + + case 'setpert' + + Path.temp = Path.pert; + File.temp = File.pert; + + if ishandle(Fig.dir) + set(Fig.dir,'Name','Load Data File') + hdl = findobj(Fig.dir,'Tag','Pushbutton1'); + set(hdl,'String','Load','Callback','fm_dirset openfile') + hdl = findobj(Fig.dir,'Tag','Listbox2'); + set(hdl,'Max',0,'ButtonDownFcn','fm_dirset openfile','Value',1) + hdl = findobj(Fig.dir,'Tag','PopupMenu1'); + set(hdl,'Enbale','inactive','Value',3) + hdl = findobj(Fig.dir,'Tag','Pushbutton3'); + set(hdl,'Callback','fm_dirset cancel','String','Cancel') + else + fm_dir(2) + end + + uiwait(Fig.dir); + + if Path.temp == 0 + fm_disp('No perturbation file selected or file does not exist',2) + else + Path.pert = Path.temp; + File.pert = File.temp; + if strcmp(computer,'GLNX86'), + Path.pert = strrep(Path.pert,getenv('HOME'),'~'); + end + cd(Path.pert) + lfile = length(File.pert); + File.pert = File.pert(1:lfile-2); + if Settings.hostver >= 6 + Hdl.pert = str2func(File.pert); + else + Hdl.pert = File.pert; + end + cd(Path.local) + hdltext = findobj(Fig.main,'Tag','EditText10'); + set(hdltext,'String',File.pert, ... + 'ForegroundColor',Theme.color07, ... + 'TooltipString',[Path.pert,File.pert]); + fm_disp(['Perturbation file "',Path.pert,File.pert,'" set'],1) + end + + case 'command' + + hdl = findobj(gcbf,'Tag','EditCommand'); + stringa = get(hdl,'String'); + set(hdl,'String',''); + hdl = findobj(gcbf,'Tag','ListCommand'); + comandi = get(hdl,'String'); + if strcmp(comandi{1},''), + comandi{1,1} = stringa; + else, + comandi{end+1,1} = stringa; + end + if length(comandi) > 100, comandi(1) = []; end + set(hdl,'String',comandi,'Value',length(comandi)); + if strcmp(stringa,'command'), + fm_disp('Invalid command',2), + return, + end + if strcmp(stringa,''), return, end + try + try, + eval(['fm_set ',stringa]) + catch, + eval(stringa); + fm_disp(['Command "',stringa,'" executed.']) + end + catch + fm_disp(lasterr,2) + end + + case 'listcommand' + + if strcmp(get(Fig.main,'SelectionType'),'open') + hdl = findobj(gcbf,'Tag','ListCommand'); + stringa = get(hdl,'String'); + value = get(hdl,'Value'); + hdl = findobj(gcbf,'Tag','EditCommand'); + set(hdl,'String',stringa{value}); + fm_set('command') + end + + case 'lf' + + if isempty(File.data), + fm_disp('Set a data file before running Power Flow.',2), + return, + end + + if Settings.freq <= 0 + Settings.freq = 50; + if ishandle(Fig.main) + hdl = findobj(Fig.main,'Tag','EditText1'); + set(hdl,'String',num2str(Settings.freq)) + end + end + if Settings.mva <= 0 + Settings.mva = 100; + if ishandle(Fig.main) + hdl = findobj(Fig.main,'Tag','EditText2'); + set(hdl,'String',num2str(Settings.mva)) + end + end + + filedata = strrep([File.data,' '],'@ ',''); + + if ~isempty(findstr(filedata,'(mdl)')) + filedata1 = File.data(1:end-5); + open_sys = find_system('type','block_diagram'); + OpenModel = sum(strcmp(open_sys,filedata1)); + if OpenModel + if strcmp(get_param(filedata1,'Dirty'),'on') || ... + str2num(get_param(filedata1,'ModelVersion')) > Settings.mv, + check = sim2psat; + if ~check, return, end + end + end + end + try + cd(Path.data) + catch + fm_disp('Data folder does not exist (maybe it was removed).',2) + return + end + filedata = deblank(strrep(filedata,'(mdl)','_mdl')); + filedata = deblank(strrep(filedata,'(slx)','_slx')); % add by S. Majid Shariatzadeh + a = exist(filedata); + if ~a + fm_disp('Data file does not exist (maybe it was removed).',2) + cd(Path.local) + return + end + + if a == 2, + lasterr(''); + b = dir([filedata,'.m']); + %if ~strcmp(File.modify,b.date) || clpsat.readfile + if clpsat.readfile + try + fm_inilf + clear(filedata) + eval(filedata); + File.modify = b.date; + catch + fm_disp(lasterr), + fm_disp(['Something wrong with the data file "',filedata,'"']), + cd(Path.local) + return + end + end + else + fm_disp(['File "',filedata,'" not found or not an m-file'],2) + end + cd(Path.local) + + if Settings.static % do not use dynamic components + for i = 1:Comp.n + comp_con = [Comp.names{i},'.con']; + comp_ext = eval(['~isempty(',comp_con,')']); + if comp_ext && ~Comp.prop(i,6) + eval([comp_con,' = [];']); + end + end + end + + % the following code is needed for compatibility with older PSAT versions + + if isfield(Varname,'bus') + if ~isempty(Varname.bus) + Bus.names = Varname.bus; + Varname = rmfield(Varname,'bus'); + end + end + + if exist('Mot') + if isfield(Mot,'con') + Ind.con = Mot.con; + clear Mot + end + end + + % end of compatibility code % + + if ishandle(Fig.main) + hdl = findobj(Fig.main,'Tag','EditText3'); + time0 = str2num(get(hdl,'String')); + if time0 ~= Settings.t0, + set(hdl,'String',num2str(Settings.t0)), + fm_disp(['Initial simulation time "t0" set to ',num2str(Settings.t0),' s']) + end + hdl = findobj(Fig.main,'Tag','EditText4'); + timef = str2num(get(hdl,'String')); + if timef ~= Settings.tf, + set(hdl,'String',num2str(Settings.tf)), + fm_disp(['Final simulation time "tf" set to ',num2str(Settings.tf),' s']) + end + set(Fig.main,'Pointer','watch'); + end + + Settings.init = 0; + fm_spf + if ishandle(Fig.main), set(Fig.main,'Pointer','arrow'); end + SNB.init = 0; + LIB.init = 0; + CPF.init = 0; + OPF.init = 0; + + + % add by s. m. Shariatzadeh + % short circuit calculation + case 'sc' + + if isempty(File.data), + fm_disp('Set a data file before running Short Circuit.',2), + return, + end + + filedata = strrep(File.data,'@ ',''); + if Settings.init == 0, + fm_disp('Run power flow before Short Circuit.',2), + return, + end + %read Load Flow Data File + + symfault + + fm_disp(['Finished "',File.data,'" Short Circuit Calculations']), + + % --------------------------------------------------------------------------- + %case 'stabrep' + %for i = 1:Bus.n; [Istab(i),Vnew(i),angnew(i)]= fm_stab(i,0); + %end + %fid = fopen([Path.data,'vstab.txt'], 'wt'); + %count = fprintf(fid, 'Voltage Stability Index at Network + %Buses\n\n'); + %count = fprintf(fid, '#bus Index V phase\n\n'); + %for i = 1:Bus.n + % count = fprintf(fid,[fvar(Bus.names{i},12), + % fvar(Istab(i),12), ... + % fvar(Vnew(i),12), + % fvar(angnew(i),12),'\n']); + %end + %count = fclose(fid); + %fm_text(13,[Path.data,'vstab.txt']) + % --------------------------------------------------------------------------- + + case 'opf' + + if max(OPF.lmin) > OPF.lmax + fm_disp('Lambda_min must be less than Lambda_max.',2) + return + end + [ao,bo] = size(OPF.omega); + [al,bl] = size(OPF.lmin); + ao = ao*bo; + a1 = al*bl; + + switch OPF.type + case 1 + OPF.show = 1; + if ao > 1, + fm_disp(['Single OPF selected. Only the 1th value of ' ... + 'the weighting factor will be used.']) + end + if a1 > 1, + fm_disp(['Single OPF selected. Only the 1th value ' ... + 'of the min load parameter will be used.']) + end + OPF.w = OPF.omega(1); + OPF.lmin = OPF.lmin(1); + if ishandle(Fig.opf) + hdl_omeg = findobj(Fig.opf,'Tag','EditText1'); + hdl_lmin = findobj(Fig.opf,'Tag','EditText2'); + set(hdl_omeg,'String',num2str(OPF.omega_s)) + set(hdl_lmin,'String',num2str(OPF.lmin)) + end + if OPF.w == 0, + fm_opfm + else, + fm_opfsdr + end + case 2 + if ao == 1, + OPF.show = 1; + OPF.w = OPF.omega; + fm_disp(['The weighting factor is scalar. Single OPF will be ' ... + 'run.']) + if OPF.w == 0, + fm_opfm + else, + fm_opfsdr + end + else + OPF.fun = 'fm_opfsdr'; + fm_pareto + end + case 3, + uiwait(fm_choice('Sorry! Daily forecast not implemented yet ...',2)) + case 4, + fm_atc + case 5, + fm_atc + end + + case 'appendV' + + type = varargin{2}; + + if isempty(File.data), + fm_disp('No data file loaded.',2), + return, + end + filedata = strrep(File.data,'@ ',''); + if Settings.init == 0, + fm_disp('Run power flow before saving voltages.',2), + return, + end + + if isempty(strfind(filedata,'(mdl)')) + fid = fopen([Path.data,filedata,'.m'],'r+'); + count = fseek(fid,0,1); + switch type + case 'flat' + count = fprintf(fid, '\n\nBus.con(:,3) = 1;\n '); + count = fprintf(fid, 'Bus.con(:,4) = 0;\n '); + count = fprintf(fid, 'SW.con(:,10) = 0;\n '); + otherwise + count = fprintf(fid, '\n\n\nBus.con(:,3) = [...\n '); + for i = 1:Bus.n-1 + count = fprintf(fid,'%10.7f;',DAE.y(Bus.v(i))); + if rem(i,5) == 0; + count = fprintf(fid,'\n '); + end + end + count = fprintf(fid,'%10.7f];\n\n',DAE.y(Bus.v(Bus.n))); + count = fprintf(fid, 'Bus.con(:,4) = [...\n '); + for i = 1:Bus.n-1 + count = fprintf(fid, '%10.7f;',DAE.y(Bus.a(i))); + if rem(i,5) == 0; + count = fprintf(fid,'\n '); + end + end + count = fprintf(fid,'%10.7f];\n\n',DAE.y(Bus.a(Bus.n))); + for i = 1:SW.n + Pg = Settings.mva*Bus.Pg(SW.bus(i))/SW.con(i,2); + count = fprintf(fid,'SW.con(%d,10) = %10.7f;\n',i,Pg); + end + end + fclose(fid); + fm_disp(['Voltages appended in file "',Path.data,File.data,'"']) + else + % load Simulink Library and update Bus blocks + load_system('fm_lib'); + cd(Path.data); + filedata = filedata(1:end-5); + open_sys = find_system('type','block_diagram'); + if ~sum(strcmp(open_sys,filedata)) + open_system(filedata); + end + cur_sys = get_param(filedata,'Handle'); + blocks = find_system(gcs,'MaskType','Bus'); + if length(blocks) ~= Bus.n + fm_disp('The number of "Bus" blocks does not match current bus number',2) + return + end + switch type + case 'flat' + for i = 1:length(blocks) + set_param(blocks{i},'p3_4q','[1 0]') + end + otherwise + for i = 1:length(blocks) + set_param( ... + blocks{i}, 'p3_4q', ... + ['[',num2str([DAE.y(Bus.v(i)),DAE.y(Bus.a(i))]),']']) + end + end + cd(Path.local); + end + + otherwise + + error('The string is not a valid command') + +end From 68d8b432a7240cf828b52c8d580a9f5d6e2ea29e Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Wed, 24 Jun 2020 11:44:45 +0430 Subject: [PATCH 08/10] Add files via upload --- fm_simrep.m | 913 +++++++++++++++++++++++++++++++++++++++++++++++++++ fm_tviewer.m | 257 +++++++++++++++ symfault.m | 345 +++++++++++++++++++ zbuild.m | 106 ++++++ zbuildpi.m | 194 +++++++++++ 5 files changed, 1815 insertions(+) create mode 100644 fm_simrep.m create mode 100644 fm_tviewer.m create mode 100644 symfault.m create mode 100644 zbuild.m create mode 100644 zbuildpi.m diff --git a/fm_simrep.m b/fm_simrep.m new file mode 100644 index 0000000..d522a3e --- /dev/null +++ b/fm_simrep.m @@ -0,0 +1,913 @@ +function fm_simrep(varargin) +% FM_SIMREP generate data report in Simulink models +% +% FM_SIMREP(FLAG,FONTSIZE,FONTNAME) +% FLAG: 1 - set up voltage report on current loaded network +% 2 - wipe voltage report on current loaded network +% 3 - set up power flows on current loaded network +% 4 - wipe power flows on current loaded network +% 5 - hide component names except for buses +% 6 - show component names +% 7 - hide bus names +% 8 - show bus names +% 9 - set font name +% 10 - set font size +% 11 - save model diagram to eps file +% FONTSIZE: font size (integer) +% FONTNAME: font name (string) +% +%see also FM_LIB, FM_SIMSET +% +%Author: Federico Milano +%Date: 11-Nov-2002 +%Version: 1.0.0 +% +%E-mail: federico.milano@ucd.ie +%Web-site: faraday1.ucd.ie/psat.html +% +% Copyright (C) 2002-2019 Federico Milano + +fm_var + +global Settings + +type = 1; + +switch nargin + case 1 + flag = varargin{1}; + case 3 + flag = varargin{1}; + fontsize = varargin{2}; + fontname = varargin{3}; + case 4 + flag = varargin{1}; + maptype = varargin{2}; + type = varargin{3}; + method = varargin{4}; +end + +if isempty(File.data) && type, + fm_disp('No loaded system is present at the moment.',2), + return +end +%if isempty(strfind(File.data,'(mdl)')) && type %old code +if isempty(strfind(File.data,'(mdl)')) && isempty(strfind(File.data,'(slx)')) && type %change by S.M. Shariatzadeh + fm_disp('The actual data file is not generated from a Simulink model.',2), + return +end +%if ~Settings.init && ~strcmp(flag,{'mdl2eps','ViewModel','DrawModel'}) & type %old code +if ~Settings.init && ~any(strcmp(flag,{'mdl2eps','ViewModel','DrawModel'})>0) && type % modified by S. Majid SHariatzade + fm_disp('Perform Power Flow before using this utility.',2), + return +end + +lasterr(''); + +% load Simulink model +cd(Path.data); +filedata = File.data(1:end-5); +open_sys = find_system('type','block_diagram'); +if ~sum(strcmp(open_sys,filedata)) + try + if nargin > 3 + load_system(filedata) + else + open_system(filedata); + end + catch + fm_disp(lasterr,2) + return + end +end +cur_sys = get_param(filedata,'Handle'); +if ~strcmp(flag,'DrawModel'), set_param(cur_sys,'Open','on'), end +blocks = find_system(cur_sys,'Type','block'); +lines = find_system(cur_sys, ... + 'FindAll','on', ... + 'type','line'); +masks = get_param(blocks,'Masktype'); +nblock = length(blocks); + +switch flag + + case 'ViewModel' + + % view the current Simulink model. + hilite_system(cur_sys,'none') + + case 'DrawModel' + + maps = {'jet';'hot';'gray';'bone';'copper';'pink'; + 'hsv';'cool';'autumn';'spring';'winter';'summer'}; + + if ~method + switch type + case 0 % only one-line diagram + zlevel = 0; + case 1 % voltage magnitudes + zlevel = 1.025*max(DAE.y(Bus.v)); + case 2 % voltage phases + zmax = max(180*DAE.y(Bus.a)/pi); + if zmax >= 0 + zlevel = 1.1*zmax; + else + zlevel = 0.9*zmax; + end + case 3 % line flows + [sij,sji] = flows(Line,3); + zlevel = 1.1*max(sij); + case 4 % generator rotor angles + if ~Syn.n + if Settings.static + fm_disp('Currently, synchronous machines are not loaded.') + fm_disp('Uncheck the option "Discard dynamic data" and try again.') + else + fm_disp('There are no synchronous machines in the current system.',2) + end + return + end + zmax = max(180*DAE.x(Syn.delta)/pi); + if zmax >= 0 + zlevel = 1.1*zmax; + else + zlevel = 0.9*zmax; + end + case 5 % generator rotor speeds + if ~Syn.n + if Settings.static + fm_disp('Currently, synchronous machines are not loaded.') + fm_disp('Uncheck the option "Discard dynamic data" and try again.') + else + fm_disp('There are no synchronous machines in the current system.',2) + end + return + end + zlevel = 1.05*max(DAE.x(Syn.omega)); + case 6 % locational marginal prices + if ~OPF.init + fm_disp(['Run OPF before displaying Locational Marginal ' ... + 'Prices'],2) + return + end + LMP = OPF.LMP; + zlevel = 1.025*max(LMP); + case 7 % nodal congestion prices + if ~OPF.init + fm_disp(['Run OPF before displaying Nodal Congestion Prices'], ... + 2) + return + end + NCP = OPF.NCP(1:Bus.n); + zlevel = 1.025*max(NCP); + otherwise + zlevel = 0; + end + Varout.zlevel = zlevel; + end + + if ishandle(Fig.threed) && type + figure(Fig.threed) + elseif ishandle(Fig.dir) && ~type + figure(Fig.dir) + hdla = findobj(Fig.dir,'Tag','Axes1'); + cla(hdla) + else + figure + end + hold on + + if ~method + if type, colorbar, end + if ishandle(Fig.threed), cla(get(Fig.threed,'UserData')), end + lines = get_param(cur_sys,'Lines'); + end + + pos = get_param(cur_sys,'Location'); + xl = []; + yl = []; + + for i = 1:length(lines)*(~method) + z = zlevel*ones(length(lines(i).Points(:,1)),1); + plot3(lines(i).Points(:,1),lines(i).Points(:,2),z,'k') + xl = [xl; lines(i).Points([1 end],1)]; + yl = [yl; lines(i).Points([1 end],2)]; + end + + xb = []; + yb = []; + zb = []; + x_max = 0; + x_min = 2000; + y_max = 0; + y_min = 2000; + idx = 0; + idx_line = 0; + idx_gen = 0; + Compnames = cell(0,0); + Compidx = []; + ncomp = 0; + if ~method + switch type + case 3 + Varout.hdl = zeros(Line.n,1); + case {4,5} + Varout.hdl = zeros(Syn.n,1); + otherwise + Varout.hdl = zeros(Bus.n,1); + end + end + + for i = 1:length(blocks)*(~method) + + bmask = get_param(blocks(i),'MaskType'); + + jdx = strmatch(bmask,Compnames,'exact'); + if isempty(jdx) + ncomp = ncomp + 1; + Compnames{ncomp,1} = bmask; + Compidx(ncomp,1) = 0; + jdx = ncomp; + end + Compidx(jdx) = Compidx(jdx)+1; + + bpos = get_param(blocks(i),'Position'); + bidx = Compidx(jdx); %str2double(get_param(blocks(i),'UserData')); + borien = get_param(blocks(i),'Orientation'); + bports = get_param(blocks(i),'Ports'); + bvalues = get_param(blocks(i),'MaskValues'); + bin = sum(bports([1 6])); + bou = sum(bports([2 7])); + + switch bmask + case 'Varname' + % nothing to do! + x = cell(1,1); + y = cell(1,1); + s = cell(1,1); + x{1} = 0; + y{1} = 0; + s{1} = 'k'; + case 'Ltc' + bname = get_param(blocks(i),'NamePlacement'); + [x,y,s] = mask(eval(bmask),bidx,{borien;bname},bvalues); + case 'Line' + bdescr = get_param(blocks(i),'MaskDescription'); + [x,y,s] = mask(eval(bmask),bidx,borien,bdescr); + case 'PQ' + [x,y,s] = mask(eval(bmask),bidx,borien,'PQ'); + case 'PQgen' + [x,y,s] = mask(eval(bmask),bidx,borien,'PQgen'); + case 'Link' + + rot = strcmp(get_param(blocks(i),'NamePlacement'),'normal'); + + x = cell(6,1); + y = cell(6,1); + s = cell(6,1); + + x{1} = [0.45 0]; + y{1} = [0.5 0.5]; + s{1} = 'k'; + + x{2} = [1 0.55]; + y{2} = [0.5 0.5]; + s{2} = 'k'; + + x{3} = [0.45 0.55 0.55 0.45 0.45]; + y{3} = [0.45 0.45 0.55 0.55 0.45]; + s{3} = 'g'; + + x{4} = [0.5 0.5]; + y{4} = rot*0.45+[0.1 0.45]; + s{4} = 'g'; + + x{5} = [0.45 0.55 0.55 0.45 0.45]; + y{5} = rot*0.9+[0 0 0.1 0.1 0]; + s{5} = 'g'; + + x{6} = 1-rot; + y{6} = 1-rot; + s{6} = 'w'; + + [x,y] = fm_maskrotate(x,y,borien); + + case 'Link2' + + x = cell(10,1); + y = cell(10,1); + s = cell(10,1); + + x{1} = [0 0.45]; + y{1} = [0.5 0.5]; + s{1} = 'k'; + + x{2} = [0.5 0.5]; + y{2} = [0 0.4]; + s{2} = 'k'; + + x{3} = [0.5 0.5]; + y{3} = [0 0.4]; + s{3} = 'k'; + + x{4} = [0.5 1]; + y{4} = [0 0]; + s{4} = 'k'; + + x{5} = [0.5 0.5]; + y{5} = [0.6 1]; + s{5} = 'g'; + + x{6} = [0.5 0.9]; + y{6} = [1 1]; + s{6} = 'g'; + + x{7} = [0.9 0.985 0.985 0.9 0.9]; + y{7} = [0.1 0.1 -0.1 -0.1 0.1]+1; + s{7} = 'g'; + + x{8} = [0.45 0.55 0.55 0.45 0.45]; + y{8} = [0.6 0.6 0.4 0.4 0.6]; + s{8} = 'g'; + + x{9} = 0; + y{9} = -0.5; + s{9} = 'w'; + + x{10} = 0; + y{10} = 1.5; + s{10} = 'w'; + + [x,y] = fm_maskrotate(x,y,borien); + + otherwise + [x,y,s] = mask(eval(bmask),bidx,borien,bvalues); + end + + xt = []; + yt = []; + for j = 1:length(x) + xt = [xt, x{j}]; + yt = [yt, y{j}]; + end + + xmin = min(xt); + xmax = max(xt); + if xmax == xmin, xmax = xmin+1; end + ymin = min(yt); + ymax = max(yt); + if ymax == ymin, ymax = ymin+1; end + dx = bpos(3)-bpos(1); + dy = bpos(4)-bpos(2); + + xscale = dx/(xmax-xmin); + yscale = dy/(ymax-ymin); + + xcorr = -xscale*(xmax+xmin)/2 + 0.5*dx; + ycorr = -yscale*(ymax+ymin)/2 + 0.5*dy; + + xmean = bpos(1)+xcorr+xscale*(xmax+xmin)/2; + ymean = bpos(4)-ycorr-yscale*(ymax+ymin)/2; + + if strcmp(bmask,'Bus') + idx = idx + 1; + + if type == 1 || type == 2 || type == 6 || type == 7 + xb = [xb; bpos(1)+xcorr+xscale*xmax; xmean]; + yb = [yb; bpos(4)-yscale*ymax-ycorr; ymean]; + xb = [xb; bpos(1)+xcorr+xscale*xmin]; + yb = [yb; bpos(4)-yscale*ymin-ycorr]; + end + + %bcolor = get_param(blocks(i),'BackgroundColor'); + bname = get_param(blocks(i),'Name'); + + switch borien + case {'right','left'} + switch get_param(blocks(i),'NamePlacement') + case 'normal' + xtext = xmean; + ytext = bpos(4)-ycorr-yscale*ymin+7; + bha = 'center'; + bva = 'top'; + case 'alternate' + xtext = xmean; + ytext = bpos(4)-ycorr-yscale*ymax-7; + bha = 'center'; + bva = 'bottom'; + end + case {'up','down'} + switch get_param(blocks(i),'NamePlacement') + case 'normal' + xtext = bpos(1)+xcorr+xscale*xmax+7; + ytext = ymean; + bha = 'left'; + bva = 'middle'; + case 'alternate' + xtext = bpos(1)+xcorr+xscale*xmin-7; + ytext = ymean; + bha = 'right'; + bva = 'middle'; + end + end + + % write bus names + if type + h = text(xtext,ytext,zlevel,bname); + set(h,'HorizontalAlignment',bha,'VerticalAlignment',bva, ... + 'FontSize',8) + end + if type == 1 || type == 2 || type == 6 || type == 7 + switch type + case 1, zpeak = DAE.y(Bus.v(idx)); + case 2, zpeak = 180*DAE.y(Bus.a(idx))/pi; + case 6, zpeak = LMP(idx); + case 7, zpeak = NCP(idx); + end + Varout.hdl(idx) = plot3([xmean xmean],[ymean ymean], ... + [zlevel,zpeak],'k:'); + end + end + if strcmp(bmask,'Line') && type == 3 + idx_line = idx_line + 1; + + xb = [xb; bpos(1)+xcorr+xscale*xmax; xmean]; + yb = [yb; bpos(4)-yscale*ymax-ycorr; ymean]; + xb = [xb; bpos(1)+xcorr+xscale*xmin]; + yb = [yb; bpos(4)-yscale*ymin-ycorr]; + + Varout.hdl(idx_line) = plot3([xmean xmean],[ymean ymean],[zlevel,sij(idx_line)],'k:'); + + elseif strcmp(bmask,'Syn') && (type == 4 || type == 5) + + idx_gen = idx_gen + 1; + + xb = [xb; bpos(1)+xcorr+xscale*xmax; xmean]; + yb = [yb; bpos(4)-yscale*ymax-ycorr; ymean]; + xb = [xb; bpos(1)+xcorr+xscale*xmin]; + yb = [yb; bpos(4)-yscale*ymin-ycorr]; + + switch type + case 4 + zpeak = 180*DAE.x(Syn.delta(idx_gen))/pi; + case 5 + zpeak = DAE.x(Syn.omega(idx_gen)); + end + Varout.hdl(idx_gen) = plot3([xmean xmean],[ymean ymean], ... + [zlevel,zpeak],'k:'); + end + + switch borien + case 'right' + len = yscale*(ymax-ymin); + if bin, in_off = len/bin; end + if bou, ou_off = len/bou; end + for j = 1:bin + yi = bpos(4)-ycorr-yscale*ymin-in_off/2-in_off*(j-1); + xi = bpos(1)+xcorr+xscale*xmin; + [yf,xf] = closerline(yi,xi-5,yl,xl); + plot3([xi, xf],[yf, yf],[zlevel, zlevel],'k') + end + for j = 1:bou + yi = bpos(4)-ycorr-yscale*ymin-ou_off/2-ou_off*(j-1); + xi = bpos(1)+xcorr+xscale*xmax; + [yf,xf] = closerline(yi,xi+5,yl,xl); + plot3([xi, xf],[yf, yf],[zlevel, zlevel],'k') + end + case 'left' + len = yscale*(ymax-ymin); + if bin, in_off = len/bin; end + if bou, ou_off = len/bou; end + for j = 1:bin + yi = bpos(4)-ycorr-yscale*ymin-in_off/2-in_off*(j-1); + xi = bpos(1)+xcorr+xscale*xmax; + [yf,xf] = closerline(yi,xi+5,yl,xl); + plot3([xi, xf],[yf, yf],[zlevel, zlevel],'k') + end + for j = 1:bou + yi = bpos(4)-ycorr-yscale*ymin-ou_off/2-ou_off*(j-1); + xi = bpos(1)+xcorr+xscale*xmin; + [yf,xf] = closerline(yi,xi-5,yl,xl); + plot3([xi, xf],[yf, yf],[zlevel, zlevel],'k') + end + case 'up' + len = xscale*(xmax-xmin); + if bin, in_off = len/bin; end + if bou, ou_off = len/bou; end + for j = 1:bin + yi = bpos(4)-ycorr-yscale*ymin; + xi = bpos(1)+xcorr+xscale*xmin+in_off/2+in_off*(j-1); + [xf,yf] = closerline(xi,yi+5,xl,yl); + plot3([xf, xf],[yi, yf],[zlevel, zlevel],'k') + end + for j = 1:bou + yi = bpos(4)-ycorr-yscale*ymax; + xi = bpos(1)+xcorr+xscale*xmin+ou_off/2+ou_off*(j-1); + [xf,yf] = closerline(xi,yi-5,xl,yl); + plot3([xf, xf],[yi, yf],[zlevel, zlevel],'k') + end + case 'down' + len = xscale*(xmax-xmin); + if bin, in_off = len/bin; end + if bou, ou_off = len/bou; end + for j = 1:bin + yi = bpos(4)-ycorr-yscale*ymax; + xi = bpos(1)+xcorr+xscale*xmin+in_off/2+in_off*(j-1); + [xf,yf] = closerline(xi,yi-5,xl,yl); + plot3([xf, xf],[yi, yf],[zlevel, zlevel],'k') + end + for j = 1:bou + yi = bpos(4)-ycorr-yscale*ymin; + xi = bpos(1)+xcorr+xscale*xmin+ou_off/2+ou_off*(j-1); + [xf,yf] = closerline(xi,yi+5,xl,yl); + plot3([xf, xf],[yi, yf],[zlevel, zlevel],'k') + end + end + + for j = 1:length(x) + z = zlevel*ones(length(x{j}),1); + xx = bpos(1)+xcorr+xscale*(x{j}); + yy = bpos(4)-yscale*(y{j})-ycorr; + if ~type + if ~isempty(xx) + x_max = max(x_max,max(xx)); + x_min = min(x_min,min(xx)); + end + if ~isempty(yy) + y_max = max(y_max,max(yy)); + y_min = min(y_min,min(yy)); + end + end + plot3(xx,yy,z,s{j}) + end + x1 = [xlim]'; + x2 = [ylim]'; + x1mean = 0.5*(x1(1)+x1(2)); + x2mean = 0.5*(x2(1)+x2(2)); + xba = [xb;x1(1);x1(1);x1(2);x1(2);x1mean;x1mean;x1(1);x1(2)]; + yba = [yb;x2(1);x2(2);x2(1);x2(2);x2(1);x2(2);x2mean;x2mean]; + Varout.xb = xba; + Varout.yb = yba; + end + + if ~type % draw only one-line diagram + xframe = 0.05*(x_max-x_min); + yframe = 0.05*(y_max-y_min); + set(hdla,'XLim',[x_min-xframe, x_max+xframe],'YLim',[y_min-yframe, y_max+yframe]) + hold off + return + end + + x1 = [xlim]'; + x2 = [ylim]'; + + switch type + case 1 + zb = formz(DAE.y(Bus.v),Bus.n); + if abs(mean(DAE.y(Bus.v))-1) < 1e-3 + zba = [zb; 0.9999*ones(8,1)]; + else + zba = [zb; ones(8,1)]; + end + case 2 + zb = formz(180*DAE.y(Bus.a)/pi,Bus.n); + zba = [zb; mean(180*DAE.y(Bus.a)/pi)*ones(8,1)]; + case 3 + [sij,sji] = flows(Line,3); + zb = formz(sij,Line.n); + zba = [zb; mean(sij)*ones(8,1)]; + case 4 + zb = formz(180*DAE.x(Syn.delta)/pi,Syn.n); + zba = [zb; mean(180*DAE.x(Syn.delta)/pi)*ones(8,1)]; + case 5 + zb = formz(DAE.x(Syn.omega),Syn.n); + zba = [zb; 0.999*ones(8,1)]; + case 6 + zb = formz(LMP,Bus.n); + zba = [zb; mean(LMP)*ones(8,1)]; + case 7 + zb = formz(NCP,Bus.n); + zba = [zb; mean(NCP)*ones(8,1)]; + end + [XX,YY] = meshgrid(x1(1):5:x1(2),x2(1):5:x2(2)); + if length(zba) > length(Varout.xb) + zba = zba(1:length(Varout.xb)); + elseif length(zba) < length(Varout.xb) + zba = [zba, ones(1, length(Varout.xb)-length(zba))]; + end + ZZ = griddata(Varout.xb,Varout.yb,zba,XX,YY,'cubic'); + if method + zlevel = Varout.zlevel; + switch type + case 1 + for i = 1:Bus.n + set(Varout.hdl(i),'ZData',[zlevel,DAE.y(Bus.v(i))]); + end + case 2 + for i = 1:Bus.n + set(Varout.hdl(i),'ZData',[zlevel,180*DAE.y(Bus.a(i))/pi]); + end + case 3 + [sij,sji] = flows(Line,3); + for i = 1:Line.n + set(Varout.hdl(i),'ZData',[zlevel,sij(i)]); + end + case 4 + for i = 1:Syn.n + set(Varout.hdl(i),'ZData',[zlevel,180*DAE.x(Syn.delta(i))/pi]); + end + case 5 + for i = 1:Syn.n + set(Varout.hdl(i),'ZData',[zlevel,zlevel,DAE.x(Syn.omega(i))]); + end + case 6 + for i = 1:Bus.n + set(Varout.hdl(i),'ZData',[zlevel,zlevel,LMP(i)]); + end + case 7 + for i = 1:Bus.n + set(Varout.hdl(i),'ZData',[zlevel,zlevel,NCP(i)]); + end + end + delete(Varout.surf) + if strcmp(Settings.xlabel,'Loading Parameter \lambda (p.u.)') + xlabel([Settings.xlabel,' = ',sprintf('%8.4f',DAE.lambda)]) + else + xlabel([Settings.xlabel,' = ',sprintf('%8.4f',DAE.t)]) + end + Varout.surf = surf(XX,YY,ZZ); + alpha(Varout.alpha) + shading interp + axis manual + Varout.movie(end+1) = getframe(findobj(Fig.threed,'Tag','Axes1')); + %Varout.movie(end+1) = getframe(Fig.threed); + else + if type == 1 && Varout.caxis + caxis([0.9 1.1]) + else + caxis('auto') + end + Varout.surf = surf(XX,YY,ZZ); + axis auto + shading interp + alpha(Varout.alpha) + xlabel('') + % if Settings.hostver < 8.04 + % set(gca,'YDir','reverse') + % end + set(gca,'YDir','reverse') + % set(gca,'XDir','reverse') + % set(gca) + set(gca,'XTickLabel',[]) + set(gca,'YTickLabel',[]) + set(gca,'XTick',[]) + set(gca,'YTick',[]) + switch type + case 1 + zlabel('Voltage Magnitudes [p.u.]') + case 2 + zlabel('Voltage Angles [deg]') + case 3 + zlabel('Line Flows [p.u.]') + case 4 + zlabel('Gen. Rotor Angles [deg]') + case 5 + zlabel('Gen. Rotor Speeds [p.u.]') + case 6 + zlabel('Locational Marginal Prices [$/MWh]') + case 7 + zlabel('Nodal Congestion Prices [$/MWh]') + end + colormap(maps{maptype}) + colorbar('EastOutside') + xlim(x1) + box on + end + + hold off + + case 'VoltageReport' + + busidx = find(strcmp(masks,'Bus')); + for i = 1:Bus.n + valore = ['|V| = ', ... + fvar(DAE.y(i+Bus.n),7), ... + ' p.u.\n= 6 + if ~d1(3) + d2(2) = d1(6)-d1(2); + d2(4) = d1(6)-d1(2); + d2(1) = d1(5)-d1(2); + d2(3) = d1(5)+d1(1); + else + d2(2) = d1(6)+d1(2); + d2(4) = d1(6)-d1(1); + d2(1) = d1(5)-d1(1); + d2(3) = d1(5)-d1(1); + end + file{i-1} = sprintf('%4d %4d mt %4d %4d L',d2); + idx = [idx, i]; + end + end + end + if ~isempty(findstr(file{i}(max(1,end-1):end),'PO')) + d1 = str2num(strrep(file{i},'PO','')); + if ~isempty(findstr(file{i+1},'L')) + nextline = strrep(file{i+1},'L',''); + d2 = str2num(strrep(nextline,'mt','')); + if d1(4) == d2(2) + if d2(1) > d1(3); + d2(1) = d1(3)-d1(1); + else + d2(1) = d2(1)+d1(1)+abs(d1(3)-d2(1)); + end + else + if d2(2) > d1(4) + d2(2) = d1(4)-d1(2); + else + d2(2) = d2(2)+d1(2)+abs(d1(4)-d2(2)); + end + end + file{i+1} = sprintf('%4d %4d mt %4d %4d L',d2); + elseif ~isempty(findstr(file{i+2},'MP stroke')) + d2 = str2num(strrep(file{i+2},'MP stroke','')); + if d2(1) + d2(3) = d2(3)-d2(1); + if d2(1) < 0 + d2(3) = d2(3) - 4; + end + end + if d2(2) + d2(4) = d2(4)-d2(2); + if d2(2) < 0 + d2(4) = d2(4) - 4; + end + end + file{i+1} = sprintf('%4d %4d %4d %4d %4d MP stroke',d2); + end + idx = [idx, i]; + end + end + + file(idx) = []; + + fid = fopen(fileeps,'wt+'); + for i = 1:length(file) + fprintf(fid,'%s\n',file{i}); + end + fclose(fid); + cd(Path.local) + fm_disp(['PSAT model saved in ',Path.data,fileeps]) + + otherwise + + fm_disp('Unknown command for Simulink Settings GUI...',2) + +end + +cd(Path.local) + +% ------------------------------------------------------------------------- +function [xa,ya] = closerline(xa,ya,xl,yl) + +[err,idx] = min(abs(sqrt((xl-xa).^2+(yl-ya).^2))); +if err < 15 + xa = xl(idx); + ya = yl(idx); +end + +% ------------------------------------------------------------------------- +function zb = formz(vec,n) + +zb = zeros(3*n,1); +zb(1:3:3*n) = vec; +zb(2:3:3*n) = vec; +zb(3:3:3*n) = vec; diff --git a/fm_tviewer.m b/fm_tviewer.m new file mode 100644 index 0000000..c5bc2c2 --- /dev/null +++ b/fm_tviewer.m @@ -0,0 +1,257 @@ +function fig = fm_tviewer() +% FM_TVIEWER create GUI for text viewer selection +% +% HDL = FM_TVIEWER() +% +%Author: Federico Milano +%Date: 11-Nov-2002 +%Version: 1.0.0 +% +%E-mail: federico.milano@ucd.ie +%Web-site: faraday1.ucd.ie/psat.html +% +% Copyright (C) 2002-2019 Federico Milano + +global Settings Theme Fig + +if ishandle(Fig.tviewer), figure(Fig.tviewer), return, end + +unix_tv = {'cat'; + 'awk ''{print}'''; + 'emacs'; + 'nedit'; + 'gedit'; + 'netscape'; + 'firefox'; + 'dtpad'}; +linux_tv = {'cat'; + 'gawk ''{print}'''; + 'emacs'; + 'nautilus'; + 'netscape'; + 'gedit'; + 'nedit'; + 'mozilla'; + 'firefox'; + 'xedit'; + 'gless'; + 'kedit'; + 'kwrite'}; +%win_tv = {'type'; +% 'notepad'; +% 'write'; +% 'uedit32'; +% 'explorer'; +% 'firefox'}; + +win_tv = {'edit'; % modified by S.M.SHariatzadeh for win matlab editor compatibility + 'type'; + 'notepad'; + 'write'; + 'uedit32'; + 'explorer'; + 'firefox'}; + + +h0 = figure('Color',Theme.color01, ... + 'Units', 'normalized', ... + 'ColorMap', [], ... + 'CreateFcn','Fig.tviewer = gcf;', ... + 'DeleteFcn','Fig.tviewer = -1;', ... + 'FileName','fm_tviewer', ... + 'MenuBar','none', ... + 'Name','Text Viewer', ... + 'NumberTitle','off', ... + 'PaperPosition',[18 180 576 432], ... + 'PaperType','A4', ... + 'PaperUnits','points', ... + 'Position',sizefig(0.4,0.4), ... + 'RendererMode','manual', ... + 'ToolBar','none'); +h1 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'ForegroundColor',Theme.color03, ... + 'Position',[0.05 0.05 0.9 0.9], ... + 'Style','frame', ... + 'Tag','Frame1'); +h1 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.tviewer = [''!'',popupstr(gcbo),'' ''];', ... + 'ForegroundColor',Theme.color05, ... + 'Position',[0.1089 0.5737+0.03 0.3985 0.07], ... + 'String',unix_tv, ... + 'Style','popupmenu', ... + 'Tag','PopupMenu1'); +h2 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.tviewer = [''!'',popupstr(gcbo),'' ''];', ... + 'ForegroundColor',Theme.color05, ... + 'Position',[0.1089 0.3323+0.03 0.3985 0.07], ... + 'String',linux_tv, ... + 'Style','popupmenu', ... + 'Tag','PopupMenu2'); +h3 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color04, ... + 'Callback','Settings.tviewer = [''!'',popupstr(gcbo),'' ''];', ... + 'ForegroundColor',Theme.color05, ... + 'Position',[0.1089 0.0909+0.03 0.3985 0.07], ... + 'String',win_tv, ... + 'Style','popupmenu', ... + 'Tag','PopupMenu3'); + +h13 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.1089 0.2038 0.3985 0.07], ... + 'String','Windows Text Viewers', ... + 'Style','text', ... + 'Tag','StaticText3'); +h12 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.1089 0.4451 0.3985 0.07], ... + 'String','Linux Text Viewers', ... + 'Style','text', ... + 'Tag','StaticText2'); +h11 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'HorizontalAlignment','left', ... + 'Position',[0.1089 0.6865 0.3985 0.07], ... + 'String','Unix Text Viewers', ... + 'Style','text', ... + 'Tag','StaticText1'); + +h4 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment','left', ... + 'Position',[0.1089 0.8 0.4885 0.1003], ... + 'String',['Computer type: ', computer], ... + 'Style','text', ... + 'Tag','StaticText4'); +h4 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'ForegroundColor',Theme.color05, ... + 'HorizontalAlignment','left', ... + 'Position',[0.6114 0.8 0.2847 0.1003], ... + 'String','Output Format', ... + 'Style','text', ... + 'Tag','StaticText5'); + +ht1 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'CData', fm_mat('view_latex'), ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_text(14)', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.6163 0.3574-0.08-0.025 0.2847 0.1129+0.025], ... + 'Style','toggle', ... + 'Tag','PushTEX'); +ht2 = uicontrol('Parent',h0, ... + 'CData', fm_mat('view_ascii'), ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_text(14)', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.6163 0.5016-0.08-0.025 0.2847 0.1129+0.025], ... + 'Style','toggle', ... + 'Tag','PushTXT'); +ht3 = uicontrol('Parent',h0, ... + 'CData', fm_mat('view_excel'), ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_text(14)', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.6163 0.6489-0.08-0.025 0.2847 0.1129+0.025], ... + 'Style','toggle', ... + 'Tag','PushXLS'); +ht4 = uicontrol('Parent',h0, ... + 'CData', fm_mat('view_html'), ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_text(14)', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.6163 0.7962-0.08-0.025 0.2847 0.1129+0.025], ... + 'Style','toggle', ... + 'Tag','PushHTM'); + +if isunix + if strcmp(Settings.export,'xls') + Settings.export = 'txt'; + end + set(ht3,'Enable','off') +end + +switch Settings.export +case 'tex' + set(ht1,'Value',1); +case 'xls' + set(ht3,'Value',1); +case 'html' + set(ht4,'Value',1); +case 'txt' + set(ht2,'Value',1); +end + +h4 = uicontrol('Parent',h0, ... + 'Units', 'normalized', ... + 'BackgroundColor',Theme.color03, ... + 'Callback','close(gcf);', ... + 'FontWeight','bold', ... + 'ForegroundColor',Theme.color09, ... + 'Position',[0.6163 0.1223-0.025 0.2847 0.1129+0.025], ... + 'String','OK', ... + 'Style','pushbutton', ... + 'Tag','Pushbutton1'); + +a = []; +switch computer + case 'GLNX86', + h = [h1, h11, h3, h13]; + for i = 1:length(linux_tv) + if findstr(Settings.tviewer,linux_tv{i}), + a = i; + break, + end + end + if isempty(a), + a = 1; + end + set(h2,'Value',a) +% case 'PCWIN', %old Line + case {'PCWIN' , 'PCWIN64' } % modified by S.M.SHariatzadeh for win64 compatibility + h = [h1, h11, h2, h12]; + for i = 1:length(win_tv) + if findstr(Settings.tviewer,win_tv{i}), + a = i; + break, + end + end + if isempty(a), a = 1; end + set(h3,'Value',a) + otherwise, + h = [h2, h12, h3, h13]; + for i = 1:length(unix_tv) + if findstr(Settings.tviewer,unix_tv{i}), + a = i; + break, + end + end + if isempty(a), + a = 1; + end + set(h1,'Value',a) +end + +set(h,'Enable','off') + +if nargout > 0, fig = h0; end diff --git a/symfault.m b/symfault.m new file mode 100644 index 0000000..240fcf8 --- /dev/null +++ b/symfault.m @@ -0,0 +1,345 @@ +% The program symfault is designed for the balanced three-phase +% fault analysis of a power system network. +% +% Input: +% 1)The program requires the bus impedance matrix Zbus. +% Zbus may be defined by the +% user, obtained by the inversion of Ybus or it may be +% determined either from the function Zbus = zbuild(zdata) +% or the function Zbus = zbuildpi(linedata, gendata, yload). +% +% The program prompts the user to enter the faulted bus number +% and the fault impedance Zf. +% +% The prefault bus voltages are defined by the reserved Vector V. +% The array V may be defined or it is returned from the power flow +% programs. If V does not exist the prefault bus voltages +% are automatically set to 1.0 per unit. +% +% output: +% The program obtains the total fault current, the postfault bus voltages +% and line currents. +% +% Copyright (C) 1998 H. Saadat +% edit By S. Majid Shariatzadeh +% + +%function symfault(zdata, Zbus, V) +function symfault () % no input argument + +fm_var % define PSAT global variables such as setting + +%if ~autorun('Short Circuit Analysis',0) +% return +%end + +if isempty(Syn.con) + fm_disp('No generator found', 2) + return +else + genData=Syn.con; +end + +nbus = Bus.n; +if isempty(Fault.con) + fm_disp('Short Circuit calculations is performed for each bus', 2) + FaultIfm=zeros(1,nbus); + FaultIfmang=zeros(1,nbus); + Fault.bus=1:nbus ; % simulate fault in all bus + Faultn=nbus; + %return +else + FaultIfm=zeros(1,Fault.n); % simulate fault in all faulty bus + FaultIfmang=zeros(1,Fault.n); + Faultn=Fault.n; %number of fault in circuit +end + +% +% if exist('V') == 1 +% if length(V) == nbus +% V0 = V; +% end +% else +% V0 = ones(nbus, 1) + j*zeros(nbus, 1); +% end + +zdata = Line.con; +yload =Pl ; +[Zbus, zdata]= zbuildpi(zdata,genData ,yload); + +nl = zdata(:,1); +nr = zdata(:,2); +R = zdata(:,3); +X = zdata(:,4); +nc = length(zdata(1,:)); +if nc > 4 + BC = zdata(:,11); +elseif nc == 4 + BC = zeros(length(zdata(:,1)), 1); +end +ZB = R + j*X + +nbr = length(zdata(:,1)); +%nbus = max(max(nl), max(nr)); + +if exist('V') == 1 + if length(V) == nbus + V0 = V; + end +else + V0 = ones(nbus, 1) + j*zeros(nbus, 1); +end + +fprintf('\nThree-phase balanced fault analysis \n') + +for ff = 1:Faultn + + nf = Fault.bus(ff); + faultbusname=Bus.names{nf}; + fprintf('\n\n\n\Faulted bus = %s \n',faultbusname ) + if isempty(Fault.con) + Zf = 0.001; + else + Zf = Fault.con(ff,7) + j*Fault.con(ff,8); + end + + fprintf('\nFault Impedance Zf = R + j*X = ') + fprintf('%8.5f + j(%8.5f) \n', real(Zf), imag(Zf)) + busname=Bus.names{nf}; + fprintf('Balanced three-phase fault at %s\n\n', busname) + + If = V0(nf)/(Zf + Zbus(nf, nf)); + Ifm = abs(If); + Ifmang = angle(If)*180/pi; + fprintf('Total fault current = %8.4f per unit \n\n\n\n', Ifm) + fprintf('Calculations Detali:\n\n') + fprintf('Bus Voltages during fault in per unit \n\n') + fprintf(' Bus Voltage Angle\n') + fprintf(' No. Magnitude degrees\n') + + for n = 1:nbus + if n == nf + Vf(nf) = V0(nf)*Zf/(Zf + Zbus(nf,nf)); + Vfm = abs(Vf(nf)); + angv = angle(Vf(nf))*180/pi; + else + Vf(n) = V0(n) - V0(n)*Zbus(n,nf)/(Zf + Zbus(nf,nf)); + Vfm = abs(Vf(n)); + angv=angle(Vf(n))*180/pi; + end + fprintf(' %7s', Bus.names{n}), fprintf('%13.4f', Vfm),fprintf('%13.4f\n', angv) + end + + fprintf(' \n') + + fprintf('Line currents for fault at %s\n\n', faultbusname) + fprintf(' From To Current Angle\n') + fprintf(' Bus Bus Magnitude degrees\n') + + for n = 1:nbus + %Ign=0; + for I = 1:nbr + if nl(I) == n || nr(I) == n + if nl(I) == n + k = nr(I); + elseif nr(I) == n + k = nl(I); + end + if k==0 + Ink = (V0(n) - Vf(n))/ZB(I); + Inkm = abs(Ink); + th = angle(Ink); + %if th <= 0 + if real(Ink) > 0 + fprintf(' G '), fprintf('%7s',Bus.names{n}), fprintf('%12.4f', Inkm) + fprintf('%12.4f\n', th*180/pi) + elseif real(Ink) ==0 && imag(Ink) < 0 + fprintf(' G '), fprintf('%7s',Bus.names{n}), fprintf('%12.4f', Inkm) + fprintf('%12.4f\n', th*180/pi) + end + Ign = Ink; + elseif k ~= 0 + Ink = (Vf(n) - Vf(k))/ZB(I)+BC(I)*Vf(n); + %Ink = (Vf(n) - Vf(k))/ZB(I); + Inkm = abs(Ink); th=angle(Ink); + %Ign=Ign+Ink; + %if th <= 0 + if real(Ink) > 0 + fprintf('%7s', Bus.names{n}) + fprintf('%10g', k), + fprintf('%12.4f', Inkm) + fprintf('%12.4f\n', th*180/pi) + elseif real(Ink) ==0 && imag(Ink) < 0 + fprintf('%7s', Bus.names{n}) + fprintf('%10g', k), + fprintf('%12.4f', Inkm) + fprintf('%12.4f\n', th*180/pi) + end + end + end + end + + if n == nf % show Fault Current + fprintf('%7s',Bus.names{n}) + fprintf(' F') + fprintf('%12.4f', Ifm) + fprintf('%12.4f\n', Ifmang) + FaultIfm(n)=Ifm; + FaultIfmang(n)=Ifmang; + end + end + resp=0; + %while strcmp(resp, 'n')~=1 && strcmp(resp, 'N')~=1 && strcmp(resp, 'y')~=1 && strcmp(resp, 'Y')~=1 + %resp = input('Another fault location? Enter ''y'' or ''n'' within single quote -> '); + %if strcmp(resp, 'n')~=1 && strcmp(resp, 'N')~=1 && strcmp(resp, 'y')~=1 && strcmp(resp, 'Y')~=1 + %fprintf('\n Incorrect reply, try again \n\n'), end + %end + %if resp == 'y' || resp == 'Y' + nf = 999; + %else + ff = 0; + %end + +end % end for while + +%% generate report + +fprintf(' \n') +if isempty(Fault.con) + fprintf('-----------------------------------\n') + fprintf('Bus currents for fault at each bus:\n\n') + + fprintf(' From To Current Angle\n') + fprintf(' Bus Bus Magnitude degrees\n') + + for n = 1:nbus + faultbusname=Bus.names{n}; + fprintf('%7s', faultbusname); + fprintf(' Ground'); + fprintf('%12.4f', FaultIfm(n)); + fprintf('%12.4f\n', FaultIfmang(n)); + + end + +else + + nfault=Fault.n; + fprintf('-----------------------------------\n') + fprintf('Bus currents for fault at selected bus:\n\n') + + fprintf(' From To Current Angle\n') + fprintf(' Bus Bus Magnitude degrees\n') + + for ff = 1:Fault.n; + nf = Fault.bus(ff); + for n = 1:nbus + if n==nf + faultbusname=Bus.names{n}; + fprintf('%7s',faultbusname); + fprintf(' Ground'); + fprintf('%12.4f', FaultIfm(n)); + fprintf('%12.4f\n', FaultIfmang(n)); + end + end + end + + +end +fm_disp(['--']), + + + + % initialize report structures + Header{1,1}{1,1} = 'PSAT+'; + Header{1,1}{2,1} = 'SHORT CIRCUIT REPORT'; + Header{1,1}{3,1} = ' '; + Cols{1,1}{1,1}= ' '; %no other data + Rows{1,1}{1,1} =' ';%no other data + Matrix{1,1} = ' ';%no other data + +% % Header{1,1}{3,1} = ['P S A T + ',Settings.version]; + Header{1,1}{4,1} = ' '; + Header{1,1}{5,1} = 'Author: Majid Shariatzadeh, (c) 2018-2020'; + Header{1,1}{6,1} = 'e-mail: m.shariatzadeh@yahoo.com'; + % Header{1,1}{7,1} = 'website: faraday1.ucd.ie/psat.html'; + Header{1,1}{8,1} = ' '; + Header{1,1}{9,1} = ['File: ', Path.data,strrep(File.data,'(mdl)','.mdl')]; + Header{1,1}{10,1} = ['Date: ',datestr(now,0)]; + + + +% writing data as a matrix... +% +% MATRIX Matrix to write to file +% Cell array for multiple matrices. +% HEADER String of header information. +% Cell array for multiple header. +% COLNAMES (Cell array of strings) Column headers. +% One cell element per column. +% ROWNAMES (Cell array of strings) Row headers. +% One cell element per row. + +% fm_write(Matrix,Header,Cols,Rows) +%fm_write(Matrix,Header,Cols,Rows) + +if isempty(Fault.con) + Header{2,1}{1,1}= '-----------------------------------'; + Header{2,1}{2,1}= 'Bus currents for fault at each bus:'; + Header{2,1}{3,1}= ' '; + + + Cols{2,1}{1,1}= 'From Bus'; + Cols{2,1}{1,2}= 'To Bus'; + Cols{2,1}{1,3}= 'Current (PU)'; + Cols{2,1}{1,4}= 'Angle degrees'; + + for n = 1:nbus + nf = n; + ff=n; + faultbusname=Bus.names{n}; + Rows{2,1}{ff,1}= faultbusname; + Rows{2,1}{ff,2}= 'Ground'; + MatrixOut(ff,1)= FaultIfm(n); + MatrixOut(ff,2)= FaultIfmang(n); + + end + Matrix {2,1}=MatrixOut; +else + + nfault=Fault.n; + Header{2,1}{1,1}= '-----------------------------------'; + Header{2,1}{2,1}= 'Bus currents for fault at selected bus:'; + Header{2,1}{3,1}= ' '; + % MatrixOut=zeros(nbus,4); + Cols{2,1}{1,1}= 'From Bus'; + Cols{2,1}{1,2}= 'To Bus'; + Cols{2,1}{1,3}= 'Current (PU)'; + Cols{2,1}{1,4}= 'Angle degrees'; + for ff = 1:Fault.n; + nf = Fault.bus(ff); + for n = 1:nbus + if n==nf + faultbusname=Bus.names{n}; + Rows{2,1}{ff,1}= faultbusname; + Rows{2,1}{ff,2}= 'Ground'; + MatrixOut(ff,1)= FaultIfm(n); + MatrixOut(ff,2)= FaultIfmang(n); + end + end + end + Matrix {2,1}=MatrixOut; + + +end +fm_write(Matrix,Header,Cols,Rows) ; + + + + + + +end % end of function + + + + diff --git a/zbuild.m b/zbuild.m new file mode 100644 index 0000000..40b3de7 --- /dev/null +++ b/zbuild.m @@ -0,0 +1,106 @@ +% This program forms the complex bus impedance matrix by the method +% of building algorithm. Bus zero is taken as reference. +% Copyright (c) 1998 by H. Saadat +% + +% Update By s.m. Shariatzadeh For Psat Data Format + +function [Zbus] = zbuild(linedata) + +nl = linedata(:,1); +nr = linedata(:,2); + +R = linedata(:,8); +X = linedata(:,9); + +nbr = length(linedata(:,1)); +nbus = max(max(nl), max(nr)); + +for k=1:nbr + if R(k) == inf || X(k) == inf + R(k) = 99999999; + X(k) = 99999999; + end +end + +ZB = R + j*X; +Zbus = zeros(nbus, nbus); +tree = 0; %%%%new + +% Adding a branch from a new bus to reference bus 0 +for I = 1:nbr + ntree(I) = 1; + if nl(I) == 0 || nr(I) == 0 + if nl(I) == 0 + n = nr(I); + elseif nr(I) == 0 + n = nl(I); + end + if abs(Zbus(n, n)) == 0 + Zbus(n,n) = ZB(I); + tree = tree + 1; %%new + else + Zbus(n,n) = Zbus(n,n)*ZB(I)/(Zbus(n,n) + ZB(I)); + end + ntree(I) = 2; + end +end + +Zbus + +% Adding a branch from new bus to an existing bus +while tree < nbus %%% new + + for n = 1:nbus + nadd = 1; + if abs(Zbus(n,n)) == 0 + for I = 1:nbr + if nadd == 1; + if nl(I) == n || nr(I) == n + if nl(I) == n + k = nr(I); + elseif nr(I) == n + k = nl(I); + end + %if abs(Zbus(k,k)) ~= 0 + for m = 1:nbus + if m ~= n + Zbus(m,n) = Zbus(m,k); + Zbus(n,m) = Zbus(m,k); + end + end + Zbus(n,n) = Zbus(k,k) + ZB(I); tree=tree+1; %%new + nadd = 2; ntree(I) = 2; + %else, end + end + end + end + end + end + +end %%%%%%new + +% Adding a link between two old buses +for n = 1:nbus + for I = 1:nbr + if ntree(I) == 1 + if nl(I) == n || nr(I) == n + if nl(I) == n + k = nr(I); + elseif nr(I) == n + k = nl(I); + end + DM = Zbus(n,n) + Zbus(k,k) + ZB(I) - 2*Zbus(n,k); + for jj = 1:nbus + AP = Zbus(jj,n) - Zbus(jj,k); + for kk = 1:nbus + AT = Zbus(n,kk) - Zbus(k, kk); + DELZ(jj,kk) = AP*AT/DM; + end + end + Zbus = Zbus - DELZ; + ntree(I) = 2; + end + end + end +end diff --git a/zbuildpi.m b/zbuildpi.m new file mode 100644 index 0000000..18e974b --- /dev/null +++ b/zbuildpi.m @@ -0,0 +1,194 @@ +% +% This program forms the complex bus impedance matrix by the method +% of building algorithm. Bus zero is taken as reference. +% This program is compatible with power flow data. +% +% Copyright (C) 1998 by H. Saadat. + +function [Zbus, linedata] = zbuildpi(linedata, gendata, yload) + +% INPUT: +% +% linedata: +% linedata is consistent with the data required for the +% power flow solution. Columns 1 and 2 are the line bus numbers. +% Columns 3 through 5 contain line resistance, reactance, and +% one-half of the total line charging susceptance in per unit on +% the specified MVA base. The last column is for the transformer +% tap setting +% +% gendata: +% +% The generator reactances are not included in the linedata of +% the power flow program and must be specified separately as +% required by the gendata in the second argument. +% gendata is an ng x 4 matrix, where each row contains +% bus 0, generator bus number, resistance and reactance. +% +% yload: +% +% % The last argument, yload is optional. +% This is a two-column matrix containing bus number and the complex +% load admittance. + + + +% gendata generator data syn.con +if isempty(gendata) + ng = 0; + nlg = 0; + nrg = 0; + zg = 0; +else + ng = length(gendata(:,1)); + nlg = gendata(:,1); + nrg = zeros(size(gendata(:,1))); + zg = gendata(:,7) + j*gendata(:,6); +end + + + +nl = linedata(:,1); +nr = linedata(:,2); + +R = linedata(:,8); +X = linedata(:,9); +ZB = R + j*X; + +nbr = length(linedata(:,1)); +nbus = max(max(nl), max(nr)); +nc = length(linedata(1,:)); + +BC = 0.5*linedata(:,10); +yc = zeros(nbus,1); +nlc = zeros(nbus,1); +nrc = zeros(nbus,1); + +for n = 1:nbus + yc(n) = 0; + nlc(n) = 0; + nrc(n) = n; + for k = 1:nbr + if nl(k) == n || nr(k) == n + yc(n) = yc(n) + j*BC(k); + end + end +end + +% % % % % % % if exist('yload') == 1 +% % % % % % % yload = yload.'; +% % % % % % % yc = yc + yload; +% % % % % % % end + +m = 0; +havecc = 0; % have cc ? + +for n = 1:nbus + if abs(yc(n)) ~=0 + m = m + 1; + nlcc(m) = nlc(n); + nrcc(m) = nrc(n); + zc(m) = 1/yc(n); + havecc = 1; + end +end + +if havecc == 1 + nlcc = nlcc'; + nrcc = nrcc'; + zc = zc.'; + nl = [nlg; nlcc; nl]; + nr = [nrg; nrcc; nr]; + ZB = [zg; zc; ZB]; +else + nl = [nlg; nl]; + nr = [nrg; nr]; + ZB = [zg; ZB]; +end + +% standard line data consist of line generator capacitor of line model and load +linedata = [nl nr real(ZB) imag(ZB)]; +nbr = length(nl); +Zbus = zeros(nbus, nbus); +tree = 0; %%%%new + +% Adding a branch from a new bus to reference bus 0 +for I = 1:nbr + ntree(I) = 1; + if nl(I) == 0 || nr(I) == 0 + if nl(I) == 0 + n = nr(I); + elseif nr(I) == 0 + n = nl(I); + end + if n>0 + if abs(Zbus(n, n)) == 0 + Zbus(n,n) = ZB(I); + tree = tree+1; %%new + else + Zbus(n,n) = Zbus(n,n)*ZB(I)/(Zbus(n,n) + ZB(I)); + end + ntree(I) = 2; + end + end +end + +% Adding a branch from new bus to an existing bus +while tree < nbus %%% new + + for n = 1:nbus + nadd = 1; + if abs(Zbus(n,n)) == 0 + for I = 1:nbr + if nadd == 1 + if nl(I) == n || nr(I) == n + if nl(I) == n + k = nr(I); + elseif nr(I) == n + k = nl(I); + end + if abs(Zbus(k,k)) ~= 0 + for m = 1:nbus + if m ~= n + Zbus(m,n) = Zbus(m,k); + Zbus(n,m) = Zbus(m,k); + end + end + Zbus(n,n) = Zbus(k,k) + ZB(I); + tree=tree+1; %%new + nadd = 2; + ntree(I) = 2; + end + end + end + end + end + end +end %%%%%%new + +% Adding a link between two old buses +for n = 1:nbus + for I = 1:nbr + if ntree(I) == 1 + if nl(I) == n || nr(I) == n + if nl(I) == n + k = nr(I); + elseif nr(I) == n + k = nl(I); + end + DM = Zbus(n,n) + Zbus(k,k) + ZB(I) - 2*Zbus(n,k); + for jj = 1:nbus + AP = Zbus(jj,n) - Zbus(jj,k); + for kk = 1:nbus + AT = Zbus(n,kk) - Zbus(k, kk); + DELZ(jj,kk) = AP*AT/DM; + end + end + Zbus = Zbus - DELZ; + ntree(I) = 2; + end + end + end +end + +disp('end of zbus build') From 54bf021d5ef298a3f7c2c9835cc2657aac2a71a1 Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:08:24 +0330 Subject: [PATCH 09/10] Add files via upload --- psat-mat/psat/fm_main.m | 78 +++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/psat-mat/psat/fm_main.m b/psat-mat/psat/fm_main.m index f1e795f..23293f0 100644 --- a/psat-mat/psat/fm_main.m +++ b/psat-mat/psat/fm_main.m @@ -323,6 +323,12 @@ 'Label','Optimal Power Flow', ... 'Tag','ViewOPF', ... 'Accelerator','o'); + +h2 = uimenu('Parent',h1, ... + 'Callback','fm_set sc', ... + 'Label','Short Circuit', ... + 'Tag','RunSC'); % add By s.M.Shariatzadeh + h2 = uimenu('Parent',h1, ... 'Callback','fm_n1cont', ... 'Label','N-1 Contingency Analysis', ... @@ -512,19 +518,19 @@ 'Position',[0.35345 0.26324 0.16379 0.068536], ... 'String','Power Flow', ... 'Tag','Pushbutton1'); -h1 = uicontrol('Parent',h0, ... +h1 = uicontrol('Parent',h0, ... 'changed by Majid Shariatzadeh 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... - 'Callback','fm_setting', ... + 'Callback','fm_set savesys', ... 'Position',[0.7968 0.26324 0.16379 0.068536], ... - 'String','Settings', ... + 'String','Save System', ... 'Tag','Pushbutton5'); -h1 = uicontrol('Parent',h0, ... +h1 = uicontrol('Parent',h0, ... 'changed by Majid Shariatzadeh 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... - 'Callback','fm_set opensys', ... + 'Callback','fm_set sc', ... 'Position',[0.57512 0.18847 0.16379 0.068536], ... - 'String','Load System', ... + 'String','Short Circuit', ... 'Tag','Pushbutton4', ... 'UserData','[ ]'); h1 = uicontrol('Parent',h0, ... @@ -550,20 +556,28 @@ 'Position',[0.7968 0.18847 0.16379 0.068536], ... 'String','Plot', ... 'Tag','Pushbutton6'); +%h1 = uicontrol('Parent',h0, ... +% 'Units','normalized', ... +% 'BackgroundColor',Theme.color02, ... +% 'Callback','fm_set close', ... +% 'Position',[0.7968 0.11371 0.16379 0.068536], ... +% 'String','Close', ... +% 'Tag','PushClose'); % edit By Majid Shariatzadeh (convert close Icon To Static report) h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... - 'Callback','fm_set close', ... + 'Callback','fm_stat', ... 'Position',[0.7968 0.11371 0.16379 0.068536], ... - 'String','Close', ... - 'Tag','PushClose'); + 'String','Static Report', ... + 'Tag','PushstatRep'); % edit By Majid Shariatzadeh (convert close Icon To Static report) + h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... - 'Callback','fm_set savesys', ... + 'Callback','fm_eigfig', ... 'Position',[0.57512 0.11371 0.16379 0.068536], ... - 'String','Save System', ... - 'Tag','Pushbutton10'); + 'String','Eigenvalue', ... + 'Tag','Pushbutton10'); % edit By Majid Shariatzadeh (convert Savesystem Icon To Eigenvalue) h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... @@ -986,62 +1000,74 @@ 'Position',[0.0379*3 0.9375 0.0379 0.05], ... 'TooltipString','Open Perturbation File', ... 'Tag','Pushbutton8'); + h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_settings'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_setting', ... - 'Position',[0.0379*4+0.0190 0.9375 0.0379 0.05], ... + 'Position',[0.0379*4+0.0190-0.01 0.9375 0.0379 0.05], ... 'TooltipString','Settings', ... - 'Tag','Pushbutton4'); + 'Tag','Pushbutton4'); % modified By s.m. Shariatzadeh, add(-0.01) to position h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_save'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_set savesys', ... - 'Position',[0.0379*5+0.0190 0.9375 0.0379 0.05], ... + 'Position',[0.0379*5+0.0190-0.01 0.9375 0.0379 0.05], ... 'TooltipString','Save System', ... - 'Tag','Pushbutton4'); + 'Tag','Pushbutton4'); % modified By s.m. Shariatzadeh, add(-0.01) to position h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_exit'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_set close', ... - 'Position',[0.0379*6+0.0190 0.9375 0.0379 0.05], ... + 'Position',[0.0379*6+0.0190-0.01 0.9375 0.0379 0.05], ... 'TooltipString','Close window or stop process', ... - 'Tag','Pushbutton4'); + 'Tag','Pushbutton4'); % modified By s.m. Shariatzadeh, add(-0.01) to position h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_sym'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback',fmlib, ... - 'Position',[0.0379*7+0.0379 0.9375 0.0379 0.05], ... + 'Position',[0.0379*7+0.0379-0.017 0.9375 0.0379 0.05], ... 'TooltipString','Open PSAT Simulink Library', ... - 'Tag','Pushbutton8'); + 'Tag','Pushbutton8');% modified By s.m. Shariatzadeh, add(-0.017) to position + +h1 = uicontrol('Parent',h0, ... + 'CData',fm_mat('main_curntsym'), ... + 'Units','normalized', ... + 'BackgroundColor',Theme.color02, ... + 'Callback','fm_simrep(''ViewModel'',0,0)', ... + 'Position',[0.0379*7+1.5*0.0379 0.9375 0.0379 0.05], ... + 'TooltipString','Open Current Simulink Model', ... + 'Tag','Pushbutton800'); % add By s.m. Shariatzadeh new Icon for "Current Simulink Model" + + h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_lf'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_set lf', ... - 'Position',[0.0379*8+0.0569 0.9375 0.0379 0.05], ... + 'Position',[0.0379*8+0.0569+0.01 0.9375 0.0379 0.05], ... 'TooltipString','Solve Power Flow', ... - 'Tag','Pushbutton1'); + 'Tag','Pushbutton1'); % modified By s.m. Shariatzadeh add(+0.01) to position h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_cpf'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_cpf(''main'');', ... - 'Position',[0.0379*9+0.0569 0.9375 0.0379 0.05], ... + 'Position',[0.0379*9+0.0569+0.01 0.9375 0.0379 0.05], ... 'TooltipString','Continuation Power Flow', ... - 'Tag','Pushbutton4'); + 'Tag','Pushbutton4');% modified By s.m. Shariatzadeh add(+0.01) to position h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_opf'), ... 'Units','normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_set opf', ... - 'Position',[0.0379*10+0.0569 0.9375 0.0379 0.05], ... + 'Position',[0.0379*10+0.0569+0.01 0.9375 0.0379 0.05], ... 'TooltipString','Optimal Power Flow', ... - 'Tag','Pushbutton4'); + 'Tag','Pushbutton4');% modified By s.m. Shariatzadeh add(+0.01) to position h1 = uicontrol('Parent',h0, ... 'CData',fm_mat('main_eigen'), ... 'Units','normalized', ... From a0cfcadcde66d00b79f26c6bf19c35c3fb88b8c2 Mon Sep 17 00:00:00 2001 From: smshariatzadeh <54735737+smshariatzadeh@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:12:45 +0330 Subject: [PATCH 10/10] Add files via upload --- psat-mat/psat/fm_set.m | 56 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/psat-mat/psat/fm_set.m b/psat-mat/psat/fm_set.m index 60dcfc3..86f71ed 100644 --- a/psat-mat/psat/fm_set.m +++ b/psat-mat/psat/fm_set.m @@ -13,7 +13,8 @@ function fm_set(varargin) %Date: 11-Nov-2002 %Update: 10-Feb-2003 %Update: 27-Feb-2003 -%Version: 1.0.2 +%Update: 19-Jul-2023 by smshariatzadeh@yahoo.com +%Version: 1.0.2+ % %E-mail: federico.milano@ucd.ie %Web-site: faraday1.ucd.ie/psat.html @@ -500,13 +501,42 @@ function fm_set(varargin) end exist(File.data(1:end-4)); File.data = strrep(File.data,'.mdl','(mdl)'); - end + %end edit by S. Majid Shariatzadeh + + + % add by S. Majid Shariatzadeh + % suypport simulink SLX file + + elseif ~isempty(findstr(File.data,'.slx'))% add by s. Majid Shariatzadeh + % make sure that the file name does not start with a number + first = double(File.data(1)); % add by s. Majid Shariatzadeh + if first <= 57 && first >= 48 % add by s. Majid Shariatzadeh + localpath = pwd; % add by s. Majid Shariatzadeh + cd(Path.data)% add by s. Majid Shariatzadeh + if exist(['d',File.data]) ~= 4% add by s. Majid Shariatzadeh + copyfile(File.data,['d',File.data])% add by s. Majid Shariatzadeh + end% add by s. Majid Shariatzadeh + cd(localpath)% add by s. Majid Shariatzadeh + File.data = ['d',File.data];% add by s. Majid Shariatzadeh + end% add by s. Majid Shariatzadeh + exist(File.data(1:end-4));% add by s. Majid Shariatzadeh + File.data = strrep(File.data,'.slx','(slx)');% add by s. Majid Shariatzadeh + end + + + + + + + File.data = strrep(File.data,'.m',''); hdltext = findobj(Fig.main,'Tag','EditText9'); set(hdltext,'String',File.data, ... 'TooltipString',[Path.data,File.data]); if ~isempty(findstr(File.data,'(mdl)')) set(hdltext,'ForegroundColor',[0 0.592 0]) + elseif ~isempty(findstr(File.data,'(slx)')) % add by s. Majid Shariatzadeh + set(hdltext,'ForegroundColor',[0.2 0.442 0])% add by s. Majid Shariatzadeh else set(hdltext,'ForegroundColor',Theme.color07) end @@ -644,6 +674,7 @@ function fm_set(varargin) return end filedata = deblank(strrep(filedata,'(mdl)','_mdl')); + filedata = deblank(strrep(filedata,'(slx)','_slx')); % add by S. Majid Shariatzadeh a = exist(filedata); if ~a fm_disp('Data file does not exist (maybe it was removed).',2) @@ -725,6 +756,27 @@ function fm_set(varargin) CPF.init = 0; OPF.init = 0; + + % add by s. m. Shariatzadeh + % short circuit calculation + case 'sc' + + if isempty(File.data), + fm_disp('Set a data file before running Short Circuit.',2), + return, + end + + filedata = strrep(File.data,'@ ',''); + if Settings.init == 0, + fm_disp('Run power flow before Short Circuit.',2), + return, + end + %read Load Flow Data File + + symfault + + fm_disp(['Finished "',File.data,'" Short Circuit Calculations']), + % --------------------------------------------------------------------------- %case 'stabrep' %for i = 1:Bus.n; [Istab(i),Vnew(i),angnew(i)]= fm_stab(i,0);