open-simulation-platform / libcosim

OSP C++ co-simulation library
https://open-simulation-platform.github.io/libcosim
Mozilla Public License 2.0
61 stars 10 forks source link

inject_system_structure() is too strict about which variables can be initialised #742

Closed kyllingstad closed 9 months ago

kyllingstad commented 1 year ago

cosim::inject_system_structure() only allows setting custom initial values for parameter and input variables. For other variables, it throws an "invalid system structure" exception. This is too strict and not in accordance with the FMI spec. For example, FMI 2 allows any variable with variability != constant to be set with fmi2SetXxx() prior to entering initialisation mode. (The full set of rules is given in section 2.2.7 of the FMI2 spec.)