The only high priority target the model has ist not met

1 回表示 (過去 30 日間)
Christian
Christian 2020 年 12 月 18 日
コメント済み: Luke Halberstadt 2020 年 12 月 22 日
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 Center および File ExchangeVariable Initialization についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by