You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to know if FMIFlux can currently chain multiple FMUs and NNs together. For example, I have constructed a circuit system in OpenModelica that includes a voltage source and a resistor. Using OpenModelica, I split this system into three subsystems (voltage source, resistor, and ground), and exported each as an independent FMU. I then tried importing these three subsystem FMUs into OpenModelica and connecting their inputs/outputs for simulation. Unsurprisingly, the simulation results were the same as the original circuit system.
Diagram as follow, from left to right, it sequentially shows the Voltage Source FMU, Resistor FMU, and Ground FMU:
Now, I want to know two things:
Is it possible to achieve the same functionality described above in FMIFlux or other FMI packages?
Is it possible in FMIFlux to chain NNs and multiple FMUs together? For example, I want to replace the original linear resistor with an NN and use training data to simulate a nonlinear resistor.
Current Attempts:
I found that FMIFlux currently supports using Parallel to chain multiple FMUs and NNs (via Chain). However, after looking into it in detail, I discovered that the Parallel function allows multiple FMUs to run concurrently and produce results. We can then concatenate the results or perform other operations like summation. However, this is different from sequentially chaining multiple subsystem FMUs as I intend.
If there is any misunderstanding on my part, please correct me. Thank you.
The text was updated successfully, but these errors were encountered:
Exactly, there are two to different operation modes:
"co-simulation" which uses different solvers to solve the models independently of each other and syncs signals after every time step
"model integration" which actually combines the two ODE systems (or ME-FMUs) into a single one and then solves the combined system.
As you correctly noticed, the parallel example simulates the FMUs in CS-mode.
From the text, it sounds like you want to do "model-integration", but importing FMUs in OpenModelica and simulate them together sounds like co-simulation to me....
Can you specify:
(a) if you want to operate in CS or ME mode?
(b) if ME: if you want to use the same solver for both FMUs (model integration) or different solvers for every FMU.
(c) do you want to connect states/state derivatives or inputs/outputs
In any case I think there is a solution for your problem, but it is easier to discuss if we further specify.
Best regards!
PS: I convert this to discussion :-)
Repository owner
locked and limited conversation to collaborators
Jul 11, 2024
Problem Description:
I want to know if FMIFlux can currently chain multiple FMUs and NNs together. For example, I have constructed a circuit system in OpenModelica that includes a voltage source and a resistor. Using OpenModelica, I split this system into three subsystems (voltage source, resistor, and ground), and exported each as an independent FMU. I then tried importing these three subsystem FMUs into OpenModelica and connecting their inputs/outputs for simulation. Unsurprisingly, the simulation results were the same as the original circuit system.
Diagram as follow, from left to right, it sequentially shows the Voltage Source FMU, Resistor FMU, and Ground FMU:
Now, I want to know two things:
Current Attempts:
I found that FMIFlux currently supports using Parallel to chain multiple FMUs and NNs (via Chain). However, after looking into it in detail, I discovered that the Parallel function allows multiple FMUs to run concurrently and produce results. We can then concatenate the results or perform other operations like summation. However, this is different from sequentially chaining multiple subsystem FMUs as I intend.
If there is any misunderstanding on my part, please correct me. Thank you.
The text was updated successfully, but these errors were encountered: