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

Read values from submodels without connector

Read values from submodels without connector

Hey, it is my first time in this forum and I hope someone can help me.

I have built a ship simulation model in dymola with a lot submodels. At the main diagram I have models like "Atmosphere" and "Ship".

The atmosphere model contains all necessary parameters for the air (air density, air temperature, ...). The ship model contains further submodels like "propulsor" and "rudder".

The problem is the atmosphere parameters are needed for all other submodels and it is not usefull to connect all these submodels with connectors.

My idea is to save the parameters in a "store" and all submodels just need to read the necessary parameters out of the store.

My first idea was a function but it does not work. Have someone any ideas?

Thanks for the help!

Edited by: tobi_lui - Jun-23-16 12:32:57

Re: Read values from submodels without connector

See inner/outer or expandable connectors:
https://www.modelica.org/documents/Mode … ision1.pdf

Edited by: adrpo - Jun-22-16 14:16:56

Re: Read values from submodels without connector

Thanks for the fast answer!

the inner/outer way was new and I have tried it. So, if am I right the inner variable must be in the main model and you can "read" this variable from the submodels. But I need to read variables between two submodels.

Here is a simplified example:

model A
  Submodel2 submodel2_1
 
  Submodel1 submodel1_1

end A;


I am using expandable connectors (the signal bus from the standard library) but you need to connect the submodels. Or is there a way without a connector?

to specifiy what I need: I would like to have a model like the system model from the standard library (path: modelica.fluid.system)

Thanks a lot

Edited by: tobi_lui - Jun-23-16 13:59:04
There are 0 guests and 0 other users also viewing this topic
You are here: