Closed RobertoHRO closed 3 years ago
What variables do you want to set in fmi2SetReal(…)
in your proposed sequence, inputs and/or parameters?
Both, inputs and parameters.
A system which just outputs a parameter or input, should do this also at t=0.
Having direct feedthrough at t=0 would if only be possible of the inputs of the underlying s-function would have the HasDirecththrough property. This will cause Simulink to localize lots of algebraic loops and cause much pain. Even though it is not nice, outputs start values have to be taken from parameters where there is no such problem.
Fortunately my initial outputs are so trivial that I can set them with FMIKit.setStartValue before the simulation. I would appreciate it if at least the parameters in the initialization of CoSimulation models would have a direct feedthrough.
I would appreciate it if at least the parameters in the initialization of CoSimulation models would have a direct feedthrough.
This should be the case. Can you provide steps to reproduce the problem?
I have built a minimum example based Testmodel1.slx. - The CoSimulation GRT fmu gives 0 on all outputs at t=0. feedthrough_test.zip
This should be fixed with 0f3821d078744adc8d2483f83bc9563521d6ba62
Hello Torsten,
in CoSimulation mode the S-function sfun_fmurun.* initialises the outputs to 0 - always. Can you adapt sfun_fmurun so that the outputs can be initialised correctly? In my opinion, it basically means that at least during initialisation the inputs can have direct feedthrough to the outputs also in CoSimulation mode.
I have built a minimum example based Testmodel1.slx. - This shows that sfun_fmurun in CoSimulation fmus gives a wrong result after the zero time step. On your request I will eMail it to you.
Suggested solution: Instead of the sequence:
you could implement this sequence:
Unfortunately this exceeds my CPP skills. At the end I would like to say thank you for this great tool. thank you!
Best regards Robert