The only high priority target the model has ist not met

1 次查看(过去 30 天)
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 个评论
Christian
Christian 2020-12-18
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 2020-12-22
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Variable Initialization 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by