Is it possible to create global parameters? For example, when modeling a gas or fluid, it would be convenient to define them globally, similar to how is done in SimScape with a domain definition.
I attempted to create an ODESystem with my fluid parameters and then pass this named system to other systems that rely on the fluid properties. This works, but my “fluid” ODESystem then becomes a subsystem of each component ODESystem, and now if I want to change density (i.e. fluid.rho_0
), I need to set it in many places.
For example, if I look at the parameters of my system sys
, then fluid
is defined multiple times…
julia> parameters(sys)
12-element Vector{Any}:
i4sim₊f₊vSA₊fluid₊rho_0
i4sim₊f₊vSA₊fluid₊bulk
i4sim₊f₊vBR₊fluid₊rho_0
i4sim₊f₊vBR₊fluid₊bulk
i4sim₊piston₊v1₊fluid₊rho_0
i4sim₊piston₊v1₊fluid₊bulk
i4sim₊piston₊v2₊fluid₊rho_0
i4sim₊piston₊v2₊fluid₊bulk
i4sim₊piston₊m₊g
i4sim₊piston₊m₊m
i4sim₊p_s₊p_source
i4sim₊p_r₊p_source
Is there a way to define a global parameter that doesn’t need to be added as a sub-system or parameter to each ODESystem component?