12.07.2015 Views

Using the AMESim MATLAB/Simulink Interface - NUPET

Using the AMESim MATLAB/Simulink Interface - NUPET

Using the AMESim MATLAB/Simulink Interface - NUPET

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> <strong>the</strong> <strong>AMESim</strong> <strong>MATLAB</strong>/<strong>Simulink</strong> <strong>Interface</strong>automatically:• The manual way is to type "clear mex" or "clear xxxx_" where xxxx is <strong>the</strong><strong>AMESim</strong> system name. This needs to be done before each new simulation starts (orafter each simulation).• In <strong>Simulink</strong> version 2 and higher it is possible to specify a command to be executedafter each simulation. Taking <strong>the</strong> <strong>Simulink</strong> system in Figure 10: The system ready torun. as an example we can type:set_param('skyhook/S-Function','StopFcn','clear skyhook_')at <strong>the</strong> Matlab command prompt. This makes <strong>Simulink</strong> unload <strong>the</strong> <strong>AMESim</strong> mexfunction after each simulation, and thus forcing it to be reloaded when a new simulationis run.If <strong>the</strong> Java interface (Matlab 6 or higher) is used, a menu item File Model propertiesexists in <strong>the</strong> <strong>Simulink</strong> menu bar that does <strong>the</strong> same thing as <strong>the</strong> set_param command. In <strong>the</strong>Simulation stop function zone add <strong>the</strong> expression "clear xxxx_" where xxxx is <strong>the</strong><strong>AMESim</strong> system name. Click on <strong>the</strong> Apply button. Save <strong>the</strong> <strong>Simulink</strong> model so thatmodifications are definitely taken into account.28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!