Help - Search - Members - Calendar
Full Version: connect-statement replaceable by its equations?
Modelica Forum > Modelica > Modelica
Hannes
Hi there!

Motivated by the last topic, I'd like to start a separate topic about whether connect-statements can be manually replaced by the equations they stand for.

Physical connector classes based on energy flow contain pairs of flow-variable and potential-variable, right? Examples:

Electrical: flow=SI.Current, potential=SI.Voltage
Hydraulic: flow=SI.VolumeFlowRate, potential=SI.Pressure

When I have a pin (an instance of a connector-class) as interface of my model and connect it to a corresponding pin of a neighbor model, then
(1) flow-variables (positive INTO each model) on the "connection-line" (drawn by mouse normally) are add up to zero while
(2) potential variables are all equal.

This "add up to zero" and this "all equal" are the equations a connect-statement stands for.

So in my state of knowledge it should be possible to type these single equations manually into the source-code of the "above-model" containing the models which shall be connected - instead of using the connect-statement.
Undoubtedly, the simplier way to do this is to drawn the "connection-lines" by mouse which creates the connect-statements in the source-code. But my hope is that with the manual equations I could manually multiply current and voltage separately between an inner TwoPin and an outer TwoPin.

Or:

Is there anything further that is realized by a connect-statement (appart from the graphical thing when done by mouse)? Maybe a thought I forgot in my train of thoughts?

Thanks for answers!

Hannes
Roland
Hello Hannes,

as you wrote, "flow-variables [...] are add up to zero". This is also true for flow-variables in unconnected connectors. So if you don't use the connect-statement but just equations you always get an additional equation for each flow-variable setting it to zero. If you provide another equation for the variable, this will just be one too many.

What you could do of course is to not use connectors. Then you obviously can not use connect-statements and have to use equations. But I don't think this would make your model better wink.gif

I hope this helps,
Roland
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.