How to interface pscad with matlab?

48 visualizzazioni (ultimi 30 giorni)
sivaranjani sivalingam
sivaranjani sivalingam il 1 Feb 2016
Modificato: ahmed ali il 18 Nov 2024
how to interface pscad with matlab?

Risposte (2)

Walter Roberson
Walter Roberson il 1 Feb 2016
Modificato: Walter Roberson il 12 Dic 2019

ahmed ali
ahmed ali il 18 Nov 2024
This is achieved by calling a special Fortran subroutine MLAB_INT from within a standard component in PSCAD.
Just remember MATLAB must be installed on your computer first not to use the online veersion in order to use the interface. Additionally, the interface is not compatible with the GFortran compiler, you should use one of the supported commercial compilers to do so.
This routine is included in the main EMTDC library and may, therefore be called from any user-defined component.
Argument
SUBROUTINE MLAB_INT(MPATH, MFILE, INPUTS, OUTPUTS)
On the other side, PSCAD interfaces to Simulink through a single Fortran subroutine called 'SIMULINK_INT'
Argument
SUBROUTINE SIMULINK_INT(MPATH, MFILE INPUTS)
It is worth noting that enabling and using the interfaces in PSCAD should be done by first setting up the MATLAB version you are using along with its path to the installation library directory, to do this as follows:
  1. Go to the File --> Application Options dialog --> under the Dependencies section.
  2. On the right side of the pop-up window, hover over MATLAB and set the configuration file of type (.xml).
  3. You must enable the interface in your case Project Settings by right click in your canvas and hit Project Settings, under the Simulation tab, head down to MATLAB and tick “Link this simulation with the currently installed MATLAB libraries”.
Hope that helps
  1 Commento
ahmed ali
ahmed ali il 18 Nov 2024
Modificato: ahmed ali il 18 Nov 2024
I forgot to mention that you can present the output of the values of any graph by copying and pasting directly from the graph of the PSCAD, then creating a text file in the same path as your project then loading it into MATLAB. (you may change the extension of the file to .m if it is necessary to do so.
Alternatively, right-click on your canvas and hit Project Settings, under the Runtime tab, change the drop-down list of the Save channels to Legacy (*. Out) instead of NO, and you may name the output file as well.
You can run the file directly into MATLAB

Accedi per commentare.

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by