Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Modelica - problems in the commands

Modelica - problems in the commands

Hello everybody!

I have a problem with command

Code:

plotParametric

:

Code:

lotParametric(x,y, stoptime=25)

Error: Class plotParametric not found in scope <global scope> (looking for a function or record).

Re: Modelica - problems in the commands

plotParametric doesn't have any stoptime argument. This should work,

Code:

plotParametric(x,y);

Adeel.

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.

Re: Modelica - problems in the commands

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?

There are 0 guests and 0 other users also viewing this topic
You are here: