Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

share parameters in modelica

share parameters in modelica

hello

 
  I want to share parameters beetwen functions in modelica, like in matlabe with GLOBAL instruction
 
  can anyone help me, please?

Edited by: Abderezakabidi - Sep-20-19 15:39:07

Re: share parameters in modelica

Hello Abderezakabidi,

If what you refer to as 'functions' are really Modelica functions (and not models) then you need to pass the global parameters as arguments to the function.

If you simply need to share information across various components/systems (like an ambient temperature) then you can declare this "global variable" in the model containing your instatiated components/subsystems. See for example how Modelica.Fluid.System is used.

I recommend you take a look at Mike Tillers online Modelica book: https://mbe.modelica.university/

Best regards,
Rene Just Nielsen

There are 0 guests and 0 other users also viewing this topic
You are here: