Help - Search - Members - Calendar
Full Version: uniqness of the solution
Modelica Forum > Modelica > Modelica
daniel@ka
Hello,

I am quite new to modelica, so I tryed to figure out
what corner cases of the modeling should be better
avoided or can lead to undesired results.

I could come up with 2 examples where the solution
would not be unique.

I admit the example is more a mathematical construction than
a physik model of a system.

Real a,b,c,x;
a*x^2+b*x+c = 0;

Quick test with dymola showed one solution, while
skiping the second one. (positiv discriminant)
In the case of negative discriminant the solver stops.

The other case that would lead to 2 solutions is ...
Real x,y;
x + y = f(time);
x = g(time);
y = .. unique

Chaning this into ..
x + abs(y) = f(time);
x = g(time);
y1 = .. the old one
y2 = -y1

Certainly there are more situations where one should
be careful .. and right now I don't have the whole picture.

I would like to learn from experts
What are the common pitfalls and how to avoid them?

Regards, Daniel
smoss
Are you asking how to limit the domain so that you get a unique solution?

If so, you could use if-then-else conditional expressions like

y=if v>limit then limit else v;


From memory, both of the modelica books (one by Fritzson the other by Tiller) use the parameterized diode model as an example of a conditional model, which you might find useful.

(not sure this answers your question though?)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.