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

I cannot run examples in the reference book/ users Guide

I cannot run examples in the reference book/ users Guide

Hi,
I am getting started with OpenModelica. I have installed the last version but since three days (!!!), I am not able to run the simplest examples in the reference book ( Peter Fritzson, Principles of Object-Oriented Modeling and Simulation with Modelica). In particaul, the following commands:

class HelloWorld
   real x(start=1);
parameter Real a = 1;
equation
   der(x)=-a*x;
end HelloWorld;
simulate(HelloWorld, stopTime = 2)
plot (x)

I always get this error:
Error occured building AST
Syntax Error
[<interactive>:7:1-7:8:writable] Error: Parser error: Unexpected token near: simulate (IDENT)

Please, does some body have an idea. I can't run neither examples in the Users' guide.

I am a former user of VBA and Matlab.

Windows 7
OpenModelica 1.8.0

Re: I cannot run examples in the reference book/ users Guide

How do you enter the commands and in what tool? If you enter the simulate and plot commands in the same command in OMNotebook/OMShell, note that you need a semicolon after the simulate command.

Re: I cannot run examples in the reference book/ users Guide

Thank you sjoelund.se. It now works.

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