Matlab Code Linkage

Hi everyone,
I’m doing my research on optimization of wind turbine and I have a Matlab code that dose this process. I wanted to ask if there any way that I can make this Matlab code to run on FAST or to be linked with it to be able to use FAST output data in optimization process and to create input data to FAST ? I hope that any one can help me with that.

Thanks in advance for your effort.
Khaled Yassin.
[size=85]Researcher, Faculty of Engineering, Ain Shams University, Cairo,Egypt.[/size]

Hello Khaled,

of course, it is possible to run the FAST executable from MATLAB. In Windows, change your working directory to the FAST path and use the following command:

system('FAST_win32.exe YourCertTest.fst')

The simulation output will be displayed in the MATLAB command window then.

Reading output and writing input data from/to FAST is also no big deal, you can modifiy those M-files that are supplied in the FAST Directory \ Utilities folder for this purpose.

Best regards,

Jan

Hello Jan,

Thank you very much for your reply. The problem that I have is that I want to embed FAST inside a Matlab code because my MAtlab code performs a loop that necessitates running FAST model several times automatically to optimize the wind turbine. other wise I will have to link inputs and outputs of these two programs to complete the loop. My question is: Is it possible to embed FAST into Matlab or I will have to go to the second option mentioned above?.

Best Regards,
Khaled Yassin.
[size=85]Researcher, Faculty of Engineering, Ain Shams University, Cairo, Egypt.[/size]

Dear Khaled,

FAST v7 is a Fortran-based code (FAST v8 also includes some C). It is possible to link a Fortran-based code with MATLAB code by compiling the Fortran code as a mex function–similar to how our FAST-Simulink interface works. However, developing a new mex function to support the data you need to share between FAST and MATLAB may take quite a bit of work. I think for starters, it would be easier to do as Jan suggested and simply call the FAST executable from within MATLAB and share data only through writing/reading FAST input and output files.

Best regards,