The only high priority target the model has ist not met

1 view (last 30 days)
Hello,
I have a translational model that has only one variable which shall have a specified initial condition (start position). It is set to high priority and the tick mark for override in the variable section of my custom block ist set.
All other variables of the model are set to have priority. Nonetheless the model initializes and ignores the target I set. I get a warning that the states may deviate from the requested initial conditions. In the variable viewer the start position is marked as not satisfied.
I noticed that another variable - the position of the center of gravity, which is simply a constant offset in a variable direction - is set to initial values even when its priority is set to none. It seems that this variable is somehow pinned to a higher priority which overrides the other variable.
I hope my problem becomes clear and that somebody might point me into the right direction to find the cause. Sadly I can't (not allowed to) attach the model. So feel free to ask further questions that may help.
# Edit:
Things I tried:
1) Setting every variable of the whole model to priority low (even none), except the desired one. Initial value is ignored.
2) Set variable to private, but with priority=priority.high with value=startPosition and a parameter startPosition. Same behavior.
3) Changes in the position of the center of gravity (priority=priority.none) is respected. The Variable Viewer still complains that target value of the only variable of priority=priority.high is not satisfied.
  2 Comments
Christian
Christian on 18 Dec 2020
I now changed the center of gravity position variable (and two other ones) to be an intermediates, since I didn't really need them as output.
Since this is only a workaround, I keep this question open in case somebody finds a solution for the original problem. Probably me or someone else will stumble over this kind of problem again one day.
Luke Halberstadt
Luke Halberstadt on 22 Dec 2020
This sounds like an overconstrained system. Perhaps the equations/parameters implicitly require the position to have a particular value, but provide flexibility to the position of the center of gravity. If you isolate the problem component and use the simplest possible case, can you find a set of variable values that satifies all equations and the initial conditions outside of Simscape?
Depending on how many algebraic and differential variables you have, this may help you find the constraint.

Sign in to comment.

Answers (0)

Categories

Find more on Variable Initialization in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!