Vous êtes sur la page 1sur 3

Basic Instructions for PSCAD-MATLAB interfacing

Page |1

IwouldliketoreferyoutoPSCADUsersGuideorPSCADOnlinehelp,whichcanbeaccessedby pressingF1inthePSCADworkspace.UnderContents\PSCADManual\MATLAB/Simulink,youcan findtheinstructionsforusingtheMatlabinterfacefunction.

Beforefurtherdescriptions,pleaseverifywhetherthefollowingrequisitesaremetonyourmachine: 1 MATLABhastobeinstalledpriortoPSCAD.YoumayneedtoreinstallPSCADtomakeit recognizethelinksanddependenciestoMATLAB,itslibrariesandpaths. 2 TheMATLABinterfacefeatureisnotsupportedbytheGNUFortrancompiler,whichisprovided withyourPSCADpackage.IrecommendthatyouinstallCompaqVisualFortran6.0orhigher,or IntelFortranCompiler. 3 PleasenoticethattheuserhastocreateauserdefinedcomponenttousetheMATLABinterface feature;i.e.youwillnotfindaMATLABInterfacecomponentintheMasterLibraryinPSCAD. 4 CreatingnewcomponentsrequiresanEducationaloraProfessionallicense. BeforestartingtorunaMATLABinterfacesimulation,youshoulddirectPSCADtoMATLABsshared libraryfolder.ThesharedlibrariesofMATLABR200Xarelocatedat: %MatlabRoot%\extern\lib\win32\microsoft InordertospecifythispathforPSCAD,selectVersion5underWorkspaceSettings|MATLAB|Installed Version.Thenenterthecompletepathofthesharedlibraries(e.g.C:\Program files\Matlab\R2008a\extern\lib\win32\microsoft)underLibraryPath. Also,ifyouarecreatinganewmodel,whichusestheMATLABinterfacefunction,youhavetolinkyour modeltotheinstalledMATLABlibrariesbyactivatingthecorrespondingcheckboxonProjectSettings| Link:

Basic Instructions for PSCAD-MATLAB interfacing

Page |2

Thishasalreadybeenactivatedintheexamplesin%PSCADfolder%\examples\matlab. Afewexamplesareprovidedin%PSCADFOLDER%\examples\matlab.Ineachofthosecases,locatea blockspecifiedasNewMatlabInterface.ByrightclickingonthecomponentandselectingtheEdit Definitionoption(asshownbelow),youwillbeabletoexplorethewaytheinterfacehasbeen designedineachparticularexample.

Basic Instructions for PSCAD-MATLAB interfacing

Page |3

YouwillseethePSCADScriptcodeofeachblockontheScriptpaneofthecomponentdefinition window:

ThekeysubroutineforusingtheMATLABinterfacefeatureisMLAB_INT(seePSCAD/EMTDCUsers Guide).Also,properuseofSTORFandSTORIisrequiredforexchangingvariablesbetweenEMTDCand theMATLABworkspace. IpersonallyfoundtheusersguideandtheprovidedexamplesveryhelpfulwhenIwastryingtocreate myfirstMATLABInterfacecase.So,pleasefirsttrytheinstructionsandexamples.Irecommendthatyou explorethecorrespondingscriptcodeblocksinthegivenexamples.Ifyoustillencounterambiguities, wewillbegladtoassistyou.

Vous aimerez peut-être aussi