Opened 10 years ago

Closed 5 years ago

#3202 closed defect (fixed)

world.g override does not propagate

Reported by: crupp@… Owned by: Adrian Pop
Priority: high Milestone: Future
Component: Frontend Version: trunk
Keywords: Cc:

Description

When overriding world.g, the override does not propagate to models from Modelica.Mechanics.MultiBody. Consider this example:

loadModel(Modelica);

simulate(Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum, simflags="-override world.g=1.0");

// Override works here
val(world.g, 0);
// Does not work here, should also be 1.0
val(body.g_0[2], 0);

The defect seems to stem from the replaceable function gravityAcceleration in MultiBody.Parts.Body. If this function is replaced with world.g*world.n then the override works as expected.

Tested in r24986.

Change History (2)

comment:1 by Adrian Pop, 10 years ago

Component: UnknownFrontend
Owner: changed from somebody to Adrian Pop
Status: newaccepted

Yes. Unfortunately in some cases we replace the parameter with its value even if we should do that only for structural parameters (array sizes, conditions of conditional components, etc).

comment:2 by crupp@…, 5 years ago

Resolution: fixed
Status: acceptedclosed

Seems to be working now. I'll close it so that you don't need to worry about it any more.

Note: See TracTickets for help on using tickets.