How can explain the relation between mdlDerivatives output and mdlOutputs in S-function simulink

3 次查看(过去 30 天)
I am new in Simulink and have a model which is used the S-function. I can not understand how the output of the mdlDerivatives relates to the outputs of the mdlOutputs? In another word, If I want to write a mfile(without using Simulink) what are the states and what are the outputs? I want to write a mfile and find ddq, dq and q but do not get how states in these two parts make the output?(file attached)

回答(1 个)

Nick Choi
Nick Choi 2017-11-14
As described in this documentation link, 'mdlDerivatives' is an optional method that can be used to compute the derivatives for the continuous states of an S-function at each time step:
'mdlOutputs' is a required method that computes the outputs for an S-function block at each time step
Regarding how the sections of an S-function relate to each other, the following documentation page provides some useful information on how S-functions work and it also describes how the inputs, outputs and states of a block are related:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by