Hopsan / hopsan

Hopsan is a free multi-domain system simulation tool developed at the division of Fluid and mechatronic systems at Linköping university.
Apache License 2.0
162 stars 44 forks source link

In programmed subsystems, internal ports connected to "interface" systemport that are not externally connected, will get startvalue overwritten by 0 #388

Open hopsan-bot opened 6 years ago

hopsan-bot commented 6 years ago

Author Name: Peter Nordin (@peterNordin) Original Redmine Issue: 388, https://flumes.iei.liu.se/redmine/issues/388 Original Date: 2012/01/11 Original Assignee: Peter Nordin


When external creating components in components required systemports can be left unconnected. If the internal connection is done.

This means that any internal components will get zero input from the externally not connected ports. Default parameter values will be overwritten by zero from the internal node.

hopsan-bot commented 6 years ago

Original Redmine Comment Author Name: Peter Nordin (@peterNordin) Original Date: 2013/06/25 08:33:07 +0200


To clarify, this is system ports in system components being programmed manually. Used by AC System ports should be replaced by interface ports or similar

hopsan-bot commented 6 years ago

Original Redmine Comment Author Name: Peter Nordin (@peterNordin) Original Date: 2016/01/18 10:13:10 +0100


The description here, is very unclear, and the behavior may have changed, needs more investigation.

hopsan-bot commented 6 years ago

Original Redmine Comment Author Name: Sergey Parfenyuk (Sergey Parfenyuk) Original Date: 2016/07/02 19:38:39 +0200


For ver. 0.7.6 I get start values overwritten even if systemport is connected.

To reproduce I created a simple model: one Translational Mass and two Force_Sources, connected to ports P1 and P2 of mass. I set one Force_Source F = 10 N, and for other Force Source I set position to 0.5 m. After simulation on graph for Force_Source_1 I get position start from start value 0.5m.

After I created a subsystem, cut and paste Force_Source_1 from model to sybsystem, create SystemPort, connect Force_Source_1 to SystemPort, close subsystem and returned to model. Connect port P2 of Translational_Mass to subsystem. From this point I expect that simulation result must be the same, but now on graph I getting position for Force_Source_1 starting from 0 instead of 0.5 m as was before. Doing some research I could say that only Generated Force setting don't overwritten.

More to say, then in model without subsystem I set velocity only for one Force_Source, I get an error ( Error: Initialize was stopped or aborted for some reason) as expected, but if I do the same in subsystem - I get no error (I suppose due to start value overwritting).

hopsan-bot commented 6 years ago

Original Redmine Comment Author Name: Peter Nordin (@peterNordin) Original Date: 2016/07/02 22:37:21 +0200


The subsystem ports (what I call interface ports) have their own start values that will override the internal startvalues in the ports connected to the systemports. So that the subsystem looks lik an "atomic component" from the outside.

You need to set the start value in the subsystem, (right-click -> properties)