# FAST-Simulink tranform

**URL:** <https://forums.nlr.gov/t/fast-simulink-tranform/162>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [February 4, 2009, 11:57pm UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162 "2009-02-04T23:57:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam.Pechner](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Adam.Pechner](https://forums.nlr.gov/u/Adam.Pechner)\
**Post date:** [February 4, 2009, 11:57pm UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/1 "2009-02-04T23:57:44Z")

</div>

I am a UC Davis student who is introducing myself to the functionality of the FAST system. I want to be able to run the FAST model inside of Simulink running either Matlab 7.14 or 2007a, and am continually finding compatibility issues even after following the prescribed changes as provided by the NREL pdfl. While I am getting the .mex error as discussed in the following link, [[FAST S-Func MEXing process](http://forums.nlr.gov/t/fast-s-func-mexing-process/143/1)), I was wondering anybody was successfully able to get the crossover to work without having to recompile the code to alleviate the .mex error. For those who have had success in getting FAST to run within Simulink, I was wondering if I could get a mostly step-by-step procedure for doing the same.

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [February 5, 2009, 4:41pm UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/2 "2009-02-05T16:41:31Z")

</div>

Dear Adam,

The FAST\_SFunc.mexw32 that is contained in [wind.nrel.gov/public/jjonkman/FA … \_2007a.zip](http://wind.nrel.gov/public/jjonkman/FAST/Files_2007a.zip) should work with MATLAB v2007a (and newer) without recompiling. Is this the version you are using?

Best regards,

---

<div class="post-metadata">

**Author:** ![Adam.Pechner](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Adam.Pechner](https://forums.nlr.gov/u/Adam.Pechner)\
**Post date:** [February 7, 2009, 2:52am UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/3 "2009-02-07T02:52:23Z")

</div>

Jason,

Thanks for the FAST response, pardon the horrible pun. In response to your question I am using matlab v. 7.4, which does translate to 2007a so the new mex files do work. My problem is even more simplistic in that I cannot get a test file, such as test 13, to be configured correctly to run inside simulink regardless of the .mex issue. I have seen it work before and know that I will eventually run into that problem, but in terms of file setup, I am still having trouble from square one. If I could get more of a step-by-step approach for configuration based on the test 13 case included in the software, I think this will be enough of a base for then implementing the .mex solution and fully utilizing simulink.

Thanks.

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [February 9, 2009, 6:29pm UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/4 "2009-02-09T18:29:03Z")

</div>

Adam,

It’s difficult for me to help without knowing more about the problem you are running into.

The only change that must be made to test 13 to get the model to run in MATLAB/Simulink is to set ADAMSPrep to 1 in Test13.fst (the input file provided has ADAMSPrep set to 3). Have you made this change?

Are you following the other instructions from the “Simulink Interface” chapter of the FAST User’s Guide?

What error is MATLAB/Simulink giving you when you try to run the simulation?

Best regards,

---

<div class="post-metadata">

**Author:** ![Adam.Pechner](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Adam.Pechner](https://forums.nlr.gov/u/Adam.Pechner)\
**Post date:** [May 13, 2009, 4:50am UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/5 "2009-05-13T04:50:05Z")

</div>

Jason,

I am sorry it has taken me months to get back to you about the error. Now that I have a working computer and working errors I have enough information to ask for help. For some background: I have the path for the two .dll’s added to the pathway of the matlab file and I am working with Test13.fst with ADAMSPREP set to 1. Also the folder also contains Wind/AWT27/Shr12\_30.wnd.

FAST certification Test #13: WindPACT 1.5 MW Baseline with many DOFs with VS and VP and FF turbulence.  
Running FAST (v6.02c-jmj, 02-Feb-2007)-Compiled as S-Function for Simulink.

When I input the file into MATLAB’s prompt I do get the message that is compiles for the S-function but when I try and run the OpenLoop.mdl I get the following errors from the console and error output files.

[size=75]Error in ‘OpenLoop/FAST Nonlinear Wind Turbine/S-Function’ while executing FORTRAN MEX S-function ‘FAST\_SFunc’, flag = 3 (output), at time 0.[/size]

FAST certification Test #13: WindPACT 1.5 MW Baseline with many DOFs with VS  
and VP and FF turbulen

Heading of the aerodyn.ipt file :  
1.5 MW baseline aerodynamic parameters for FAST certification test #13.

Could not find hub-height wind file:  
“Wind\WP\_Baseline\84m\_12mps”

Could not find full-field wind file:  
“Wind\WP\_Baseline\84m\_12mps.wnd”"

Could not find coherent turbulence wind parameter file:  
“Wind\WP\_Baseline\84m\_12mps.ctp”"

Could not find 4D-wind parameter file:  
“Wind\WP\_Baseline\84m\_12mps.fdp”"

Check your AeroDyn input for proper wind file name.

* * *

FATAL ERROR in Subroutine CheckWindType.  
Error reading wind file name. Could not find HH, FF, 4D, or CT file.

* * *

0 warnings recorded in error.log file for this simulation.  
1 errors recorded in error.log file for this simulation.

Simulation Error # 1  
Simulation Time = 0 seconds.  
Error detected in Subroutine CheckWindType.  
Error reading wind file name. Could not find HH, FF, 4D, or CT file.

FATAL ERROR. SIMULATION ABORTED.

While I think this may be a file issue, any help would be appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [May 13, 2009, 3:56pm UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/6 "2009-05-13T15:56:06Z")

</div>

Dear Adam,

That error is from AeroDyn and is telling you that it cannot find any wind file with root name “84m\_12mps” in the “Wind\WP\_Baseline” directory. The wind file(s) to be used by AeroDyn, including a relative path to its(their) location, is input in AeroDyn’s primary input file, which for FAST certification test #13 is called Test13\_AD.inp in FAST’s CertTest folder. FAST’s CertTest folder includes a Wind\WP\_Baseline directory containing the wind files 84m\_12mps.sum and 84m\_12mps.wnd. Are you modeling Test13.fst from within the CertTest folder? If yes, are the wind files there? If not (e.g., because you copied Test13.fst and Test13\_AD.inp to another folder), did you copy the wind files / directories to that folder also? You must ensure that all input files, including their relative paths, are correct.

I hope that helps.

Best regards,

---

<div class="post-metadata">

**Author:** ![Adam.Pechner](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@Adam.Pechner](https://forums.nlr.gov/u/Adam.Pechner)\
**Post date:** [May 16, 2009, 1:08am UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/7 "2009-05-16T01:08:43Z")

</div>

Jason,

Thanks for the help from the previous post, working now on a windows machine. I was wondering if it was possible to get the make\_SFunction or the .mex file from the above link work on another operating system. At this point I get back to the same error as above when trying to run FAST through MATLAB in mac osx matlab 2007a. I was wondering if this was possible since the mex file is designed for dos.

Thanks

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [May 18, 2009, 6:36pm UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/8 "2009-05-18T18:36:28Z")

</div>

Adam,

The FAST\_SFunc.mexw32 only works on 32-bit Windows platforms (this is what the “w32” in the mex name stands for). This mex file will not work on a Mac OS X.

I don’t run a Mac myself, so, I can’t help you out much. But the post found here: [[FAST S-Func MEXing process](http://forums.nlr.gov/t/fast-s-func-mexing-process/143/1)) describes how to compile the FAST\_SFunc.mexw32 file. Hopefully with the information found in that post, as well as with the MATLAB documentation, you can learn what you need to in order to compile it for a Mac OS X. If you succeed, please post on what you find out so that you can help other users with similar problems.

Best regards,

---

<div class="post-metadata">

**Author:** ![Oriol.Segarra](https://avatars.discourse-cdn.com/v4/letter/o/aeb1de/32.png) [@Oriol.Segarra](https://forums.nlr.gov/u/Oriol.Segarra)\
**Post date:** [April 9, 2014, 10:33am UTC](https://forums.nlr.gov/t/fast-simulink-tranform/162/9 "2014-04-09T10:33:51Z")

</div>

Hi everyone,

I’m also trying to run FAST through a MacOSX Matlab version (R2013\_a) did anyone get successfully finally? I am a industrial engineer student and I don’t have a lot of knowledge in programming either with Matlab, Fortran. I have some basics of C, python and web programming, do you think I can succeed trying to compile the "make\_FAST\_S\_function? Any little help would be appreciable.

Thanks in advance.
