New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equation Structure depending on runtime evaluation #588
Comments
Modified by choeger on 5 Jul 2011 09:18 UTC |
Modified by hansolsson on 28 Sep 2011 13:08 UTC |
Comment by choeger on 28 Sep 2011 19:31 UTC |
Modified by stefanv on 28 Sep 2011 19:46 UTC |
Comment by hansolsson on 29 Sep 2011 07:47 UTC It was on the list of tickets for spec 3.3 not handled by spec updates and that unresolved list includes (the names are not the official ones): On the other hand the ones closed by the updates were: |
Comment by hansolsson on 28 Feb 2012 11:51 UTC Consider instead
If indexFoo({1,2,3,4})={1,2,3,4} then x=time*{1,2,3,4}
Could potentially also have index-reduction depending on the values of indexFoo (no example added for this yet). Conclusion: |
Comment by dietmarw on 15 Aug 2012 08:22 UTC |
Comment by hansolsson on 30 Mar 2016 09:46 UTC
Propose: In section 1.2 add: (The initial part is due to #588.) This allows a tool to reject too many models, but without specifying the exact structural analysis it is difficult to be more specific. The "due to calls of external functions" was added so that tools may not reject every model. In general it should only be "non-real parameter expressions" - but "if p>0 then" means that in order to evaluate the non-real parameter expression "p>0" we have to evaluate the real parameter "p". In addition "p*der(x)" means that we assume that "p" is (in most cases) non-zero. |
Changelog removed by hansolsson on 30 Mar 2016 09:46 UTC |
Comment by hansolsson on 1 Apr 2016 13:46 UTC |
Comment by hansolsson on 20 Jun 2016 12:58 UTC (Reference to #588 above is probably an error, will try to figure out which one it was.) |
Comment by fcasella on 20 Jun 2016 17:52 UTC I tried out this model in Dymola and OpenModelica and obtained the same (expected) result.
In this case, the model is well-posed because, once it has been causalized, the indexing expressions with discrete-time variability are on the right hand side of the assignments. Is this model legal? What should the spec say in general about models with discrete-type variability expressions used for indexing? |
Comment by sjoelund.se on 20 Jun 2016 19:21 UTC
It is OK; the dependency is |
Comment by hansolsson on 23 Jun 2016 11:40 UTC |
Comment by hansolsson on 23 Sep 2016 10:08 UTC |
Reported by choeger on 5 Jul 2011 07:53 UTC
In Modelica there is at least one possible kind of expressions that yield unknowns (one element of higher order models): Although unknowns are ususally named and directly referenced, the index expression in an array subscription might not be evaluated at compile time. Consider the following (extreme) example:
Depending on the function indexFoo, the body of the for equation contains different unknowns. The resulting system might be easily solvable (if, e.g. indexFoo was the identity function) or singular (if it was constant).
It is currently (in general) impossible to evaluate an index expression at compile time (external functions are just one simple example for the problem). On the other hand, the fact, that a Compile does not know the structure of every equation might yield all kinds of problems for usual optimizations (causalization, index reduction etc.).
Does anyone have an opinion on that topic?
Migrated-From: https://trac.modelica.org/Modelica/ticket/588
The text was updated successfully, but these errors were encountered: