Possible to do real-time simulation of Modelica/FMU and UE4?

End Goal: To create a real-time simulator and/or visualization tool for Modelica/FMU results.

Question: Is that possible with Unreal Engine (could be via python, C++, or preferably the FMI standard)?

More Detailed Goals:
I create multiphysics models in Modelica (an acausal ODE modeling language). I would like to first start making snazzy visuals for my results leveraging the various animation tools. For example, create a power plant and have pipe temperatures and water flow rate change as a funtion of what the Modelica spits out. Another example would be a car moving (wheels, driveshafts, etc.) moving in accordance with the Modelica results.

The first milestone would be able to simulate the Modelica model (typically only takes on the order of seconds to minutes) and then post-simulation, generate the visualization within a few seconds-minutes later without the need for anything but a simple PC for simple visuals.

The second milestone would be to export the Modelica model as an FMU into Unreal Engine (or vice-versa) and generate a real time simulation results (i.e., very little lag between model results and visual update).

The third milestone and end game would be to create an interactive simulator which couples the dynamics of Modelica with the visualization of Unreal Engine.

More Detailed Question:
I have no idea if any of this is even possible with Unreal Engine. I started playing with blender, found some nice python-blender things. But quickly found that rendering super simple things was destroying my life. I’m really trying to get an idea if this is just not what Unreal Engine should be used for or if I’m scratching at the right thing. Any insight, guidance, alternative recommendations would be great.

As always, thank you for your time and sharing your knowledge with us lower level mages.

1 Like

Hi, I’m in a similar situation. Were you able to find any clues of how to make the link between Unreal and any FMI compliant model?

No not yet. I think it is entirely achievable I just haven’t had the time to delve into it yet. Maybe someday! If you work on this I’d be happy to test your work.

Hi ,

Any update on how to do real-time simulation of Modelica/FMU and UE4? Can we make use of PyFMI or FMPy python packages… ???

Nope. Not at this time.

I got a project to look at this. I got something working and hope to make it available on Github in the next month. I’m not promised a finished professional project, but definitely been able to have user interaction, multiple FMUs, and some other basic controls. When I release it I’ll post an answer.

I got a project to look at this. I got something working and hope to make it available on Github in the next month. I’m not promised a finished professional project, but definitely been able to have user interaction, multiple FMUs, and some other basic controls. When I release it I’ll post an answer.

With the help of a couple others, I was able to get bring FMU into Unreal Engine. Feel free to check it out: GitHub - ORNL-Modelica/UnrealEngine-FMIPlugin

Hey! I am in a similar situation where I have to create a plugin in Unreal Engine. I have gone through your code on github already. I have a few questions about how did you create the plugin? For example. Since unreal engine works with C++, did you use already create C++ FMI plugin to integrate FMI into the engine or did you make it through scratch. I have to develop a FMI plugin that can import the FMU containing 3D models and then I can simulate them in the Scene of Unreal.