-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement support for stateful systems #8
Comments
For the discrete state, it is also important to specify the sample time of the period update connected to the discrete state update. See https://it.mathworks.com/help/simulink/sfg/sample-times-cpp.html#f4-33929 for a description of this concept in the Simulink docs, and https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_leaf_system.html#a262f71637a37127840acefca3bda8897 for the related API in Drake's System API. |
Related to that, for properly describing this in FMUs it is necessary to wait for FMI 3. See modelica/fmi-standard#353 and http://www.ep.liu.se/ecp/132/057/ecp17132507.pdf . |
Still related to stateful systems, it is relevant to mention that simStateCompliance should be properly set in Simulink:
At the moment, it is set to USE_CUSTOM_SIM_STATE . This means (see https://it.mathworks.com/help/simulink/sfg/s-function-compliance-with-the-simstate.html) that the S-Function "has mdlGetSimState and mdlSetSimState methods", that are not implemented in the existing BlockFactory S-Function.
|
That part of S-Function code is a very old heritage (from first versions of WBI-Toolbox I think). All of them would need a refreshing, not only this one. |
cc @fjandrad |
This is probably a long term goal, but for now let's collect some possible basic steps:
BlockInformation
BlockInformation
SimulinkBlockInformation
(probably usingssGetContStates
)SimulinkBlockInformation
(probably usingssGetDiscStates
)CoderBlockInformation
CoderBlockInformation
mdlDerivatives
in the BlockFactory S-Function:blockfactory/sources/Mex/src/BlockFactory.cpp
Line 317 in 78a8723
ssSetInputPortDirectFeedThrough
and https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_system.html thedrake::systems::System<T>::xxxDirectFeedthrough
methods for an inspiration related to the corresponding Drake API . At the moment this is hardcoded at Simulink level inblockfactory/sources/Mex/src/SimulinkBlockInformationImpl.cpp
Line 173 in 78a8723
The text was updated successfully, but these errors were encountered: