System modeling workflow example

Hi,
I have some experience in Simulink but I want to do stuff in Julia (ModelingToolkit).
I’m searching for examples of simple system models for example two water tanks and pump or something similar in complexity. I would like to see and learn how structure of that system looks like and how to connect componets of modeling system in organised manner. I can’t find any example of workflow that contains few components conected together in one consistent model.
Thanks for help.

1 Like

Hello, there is a JuliaCon video about component-based RC circuit modeling. The copy-pastable code is here in the ModelingToolkit.jl docs. Hope this helps.

1 Like

Let me state, that coming from Simulink, you should be aware of a complete change of the modeling approach. The modeling approach followed by Simulink is called causal (also assignment-based). Simulink actually models signal flows (every block in the Simulink block diagram produces an output signal in response to an input signal). On the other hand, ModelingToolkit follows (similarly as (Open)Modelica and Modelica-inspired Julia package Modia) the so-called acausal (also equation-based) approach, where you do not have to classify the signals/variables as inputs or outputs. This turns out very useful for modeling complex interconnected systems. Well, for a couple of years even Simulink users can enjoy the latter modeling approach through the the extension library called Simscape. Besides possible ModelingToolkit examples and tutorials, some intro to (Open)Modelica or Modia can make your transition easier, because it is really a transion from one mental framework to another rather than just a switch from one software to another.

5 Likes

Thank you for the valuable informations. I will check out all and do further study. I will appreciate it, if someone has and could share more code examples like the one above.

There is also Causal.jl, which is pretty much Simulink.

1 Like

And BlockSystem.jl

1 Like