How to interface pscad with matlab?
37 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how to interface pscad with matlab?
0 commentaires
Réponses (2)
ahmed ali
le 18 Nov 2024 à 20:49
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:
- Go to the File --> Application Options dialog --> under the Dependencies section.
- On the right side of the pop-up window, hover over MATLAB and set the configuration file of type (.xml).
- 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 commentaire
ahmed ali
le 18 Nov 2024 à 20:50
Modifié(e) : ahmed ali
le 18 Nov 2024 à 20:54
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
Voir également
Catégories
En savoir plus sur MATLAB Compiler dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!