User`s guide

Release 7.5 MADYMO Coupling Manual
Solver Platformid MATLAB build MATLAB test
em64t-win R2009a R2009a
win32p R2009a R2009a
linux26-x86_64 R14SP3 R2009a
The coupling is tested using MATLAB version R2009a on newer platforms. Known compati-
bility problems are noted on the linux operating systems. Depending on the linux version the
coupling either can or can not run, if this is the case a different version of the linux operating
system, MADYMO or MATLAB is needed.
9.2 Interfacing MADYMO with MATLAB/ Simulink
The interface between MATLAB/ Simulink and MADYMO is defined in both the Simulink
and the MADYMO model. To set up a coupled simulation, perform the following steps:
1. Link both input and output ports by defining SIGNAL.EXTERNAL_INPUT and SIG-
NAL.EXTERNAL_OUTPUT in the MADYMO model to Mux and Demux blocks in the
Simulink model file.
2. Select the time integration method ’MATLAB’/’EULER’ in the MADYMO model.
3. The simulation time and solver options in the Simulink model are selected via the Simu-
link graphical user interface shown in Fig.
9.2.
4. The integration time step should be set equal in both programmes.
All MADYMO functionality is available within MATLAB/ Simulink by means of a S-function
called madymo3d_server. One or more instances of such block(s) can be defined in a Simulink
model. An S-function is shown in Fig.
9.3, in which the parameters represent the following:
1. Command to be executed when the Simulink model is started. This character string
normally ends with the MADYMO model XML-filename.
2. Number of ’continuous’ states to be integrated by the MATLAB Solver, using INT_-
MTH="MATLAB" under CONTROL_ANALYSIS.TIME.
This number should be greater than or equal to the maximum number of first order dif-
ferential equations in the MADYMO model.
Select ’0’ when the states are integrated by MADYMO (INT_MTH="EULER").
3. Input port dimension, largest EXTERNAL_REF defined for SIGNAL.EXTERNAL_IN-
PUT. The value -1 represents dynamically sized.
4. Output port dimension, largest EXTERNAL_REF defined for SIGNAL.EXTERNAL_-
OUTPUT. The value -1 represents dynamically sized.
5. Server port number, value of HOST_PORT. MADYMO connects to this port.
52