- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelica - problems in the commands
Modelica - problems in the commands
Re: Modelica - problems in the commands
plotParametric doesn't have any stoptime argument. This should work,
Code:
plotParametric(x,y);
Adeel.
- adeas
- 454 Posts
Re: Modelica - problems in the commands
Thanks a lot, BUT the result is not as it is expected
Code:
model VanderPol "Van der Pol oscilator model"
Real x(start = 1) "Descriptive string for x";
// x starts at 1
Real y(start = 1) "Descriptive string for y";
// y starts at 1
parameter Real lambda = 0.3;
equation
der(x) = y;
// this is the first equation
der(y) = -x + lambda * (1 - x * x) * y;
/*The 2nd differencial equation*/
end VanderPol;
And after that book says that I should type the following:
Code:
simulate (VanderPol, stoptime=25)
plotParametric(x,y, stoptime=25)
and get some kind of spiraloid. Insead of that I get only a simple plot. Iа I change the time of simulation, nothing happens.
Re: Modelica - problems in the commands
Because you haven't simulated the model long enough. Its,
Code:
simulate (VanderPol, stopTime=25)
not
Code:
simulate (VanderPol, stoptime=25)
Notice the capital T in stopTime.
After simulate command send plotParametric,
Code:
plotParametric(x,y)
Adeel.
- adeas
- 454 Posts
Re: Modelica - problems in the commands
- sjoelund.se
- 1700 Posts
Re: Modelica - problems in the commands
Thanks a lot!!!
Everything works as at the picture http://dev.openmodelica.org/~marsj/forums/vanderpol.png
Only one question remains - How can I link a picture to my post?
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelica - problems in the commands