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
  • Index
  • » Users
  • » larry84
  • » Profile

Posts

Posts

Mar-10-12 13:31:01
Syntax error in HelloWorld class

I've tried in OMShell pendulum's exercise.
Simulation ok, but when I write plot(vx), OMShell give "true" but nothing happens.

Mar-10-12 01:24:24
Syntax error in HelloWorld class

same problem....

trying new exercise from Fritzon book, "pendulum":


Simulation failed for model: pendulum
ERROR: system(OPENMODELICAHOME=\"$OPENMODELICAHOME\" /opt/openmodelica/share/omc/scripts/Compile pendulum ) failed: Interrupted system call
Error: Error building simulator. Buildlog: \"perl\" /opt/openmodelica/share/omc/scripts/convert_lines.pl pendulum.cpp pendulum.conv.cpp.tmp
g++ -I. -o pendulum pendulum.conv.cpp pendulum_functions.cpp -L\"/Users/lorenzotrombetta/Desktop/Modelica\"   -lsim -linteractive -I\"/opt/openmodelica/include/omc\" -msse2 -mfpmath=sse  -L/opt/openmodelica/lib -arch x86_64 -lsendData -lQtNetwork -lQtCore -lQtGui -lpthread -L\"/opt/openmodelica/lib/omc\" -lc_runtime -lf2c pendulum_records.c

Error: Error building simulator. Buildlog: command g++ not found. Check $OPENMODELICAHOME
Error: Error building simulator. Buildlog: command \"/opt/openmodelica/share/omc/scripts/Compile\" not found. Check $OPENMODELICAHOME

Mar-09-12 22:40:42
Syntax error in HelloWorld class

I tried but OMEdit gives me same error.

I'm sad, becaus I don't want to use Windows....

What is login/logout?

Mar-09-12 22:29:10
Syntax error in HelloWorld class

lorenzotrombetta$ ls -lH /usr/bin/g++
lrwxr-xr-x  1 root  wheel  7  8 Mar 19:26 /usr/bin/g++ -> g++-4.2


lorenzotrombetta$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So, what's the matter?

Mar-09-12 21:09:21
Syntax error in HelloWorld class

lorenzotrombetta$ ls -l /usr/bin/{gcc,cc,g++,c++,clang,clang++}

ls: /usr/bin/clang: No such file or directory
ls: /usr/bin/clang++: No such file or directory
lrwxr-xr-x  1 root  wheel  7  8 Mar 19:26 /usr/bin/c++ -> c++-4.2
lrwxr-xr-x  1 root  wheel  7  8 Mar 19:26 /usr/bin/cc -> gcc-4.2
lrwxr-xr-x  1 root  wheel  7  8 Mar 19:26 /usr/bin/g++ -> g++-4.2
lrwxr-xr-x  1 root  wheel  7  8 Mar 19:26 /usr/bin/gcc -> gcc-4.2

Mar-08-12 21:48:30
Syntax error in HelloWorld class

Hi,
I installed XCode 3.2 for OS X Snow Leopard.
I tried to simulate this model:

model MassaForza "Massa spinta da una forza costante"
  parameter Real m = 2 "Massa del blocco";
  parameter Real f = 6 "Forza applicata";
  Real s "Posizione del blocco";
  Real v "Velocità del bloco";

equation
  v = der(s);
  m * der(v) = f;
end MassaForza;

Then I simulated, so plotting, but selecting variables nothing happens, it doesn't appear any graphs.

So I ri-pushed simulate and OMEdit gives it:

---- Error 2 : 19:42:42 ----
Unable to simulate the Model 'MassaForza'
Following Error has occurred.

Simulation failed for model: MassaForza
ERROR: system(OPENMODELICAHOME=\"$OPENMODELICAHOME\" /opt/openmodelica/share/omc/scripts/Compile MassaForza ) failed: Interrupted system call
Error: Error building simulator. Buildlog: \"perl\" /opt/openmodelica/share/omc/scripts/convert_lines.pl MassaForza.cpp MassaForza.conv.cpp.tmp
g++ -I. -o MassaForza MassaForza.conv.cpp MassaForza_functions.cpp -L\"/Users/lorenzotrombetta/Desktop/Modelica\"   -lsim -linteractive -I\"/opt/openmodelica/include/omc\" -msse2 -mfpmath=sse  -L/opt/openmodelica/lib -arch x86_64 -lsendData -lQtNetwork -lQtCore -lQtGui -lpthread -L\"/opt/openmodelica/lib/omc\" -lc_runtime -lf2c MassaForza_records.c

Error: Error building simulator. Buildlog: command g++ not found. Check $OPENMODELICAHOME
Error: Error building simulator. Buildlog: command \"/opt/openmodelica/share/omc/scripts/Compile\" not found. Check $OPENMODELICAHOME

Any suggests,
Lorenzo

Mar-06-12 22:33:00
Syntax error in HelloWorld class

Hi

I'm at home with my MacBook Pro, Mac OS X V. 10.6.8 and OM 1.6.0.
I've tried to simulate Hello World in OMShell and it doesn't work.

I post the result


class HelloWorld
   Real x(start=1);
parameter Real a = 1;
equation
   der(x)=-a*x;
end HelloWorld;
{HelloWorld}

>> simulate(HelloWorld)
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'HelloWorld', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*'",
    messages = "Simulation failed for model: HelloWorld
Error: Error building simulator. Buildlog: /opt/openmodelica/share/omc/scripts/Compile: line 2: make: command not found

Error: Error building simulator. Buildlog: command g++ not found. Check $OPENMODELICAHOME
Error: Error building simulator. Buildlog: command \"/opt/openmodelica/share/omc/scripts/Compile\" not found. Check $OPENMODELICAHOME
",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;

Changed OS, new nightmare.
Please, help me....

Mar-06-12 19:23:42
Syntax error in HelloWorld class

So, I have the same problem with Mac.
At home I'll try nightly version.

Mar-06-12 19:09:05
Syntax error in HelloWorld class

Good Job!!!!

It works!!!!!

Thank you very much!

Lorenzo

Mar-06-12 18:57:03
Syntax error in HelloWorld class

Do I uninstall older version before install nightly?

Thanks,
Lorenzo

Mar-06-12 18:23:52
Syntax error in HelloWorld class

Hi Adrian

Windows SP3 on job desk with OpenModelica 1.8.0 (r10584)
at home MacPro 10.6.

What's the OM nightly version?

Regards,
Lorenzo

Mar-06-12 18:14:14
Syntax error in HelloWorld class

Per,
Also I tried OMEdit but I don't go so far....

I write my model, play simulate but nothing happens.
If I push Plotting button, there isn't any graph or any variables to select.

Sorry, I've searched on web but I haven't found anything.

Mar-06-12 18:06:11
Syntax error in HelloWorld class

Hi Adeel
I tried but it's the result:

class HelloWorld
   Real x(start=1);
parameter Real a = 1;
equation
   der(x)=-a*x;
end HelloWorld;
{HelloWorld}

>> simulate(HelloWorld)
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'HelloWorld', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = ''",
    messages = "Simulation failed for model: HelloWorld
",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;


Thank you very much for your help, Per too.

Lorenzo

Mar-06-12 17:09:37
Syntax error in HelloWorld class

Hi,
I'm new italian openmodelica user.
I've bought Peter Fritzson principles of object-oriented modeling and simulation with modelica, that proposes some easy exercise, like HelloWorld.

The first question is:
where do I have to insert script? In OMEdit Text View or in OMShell?

So, when I insert this script:

class HelloWorld
   Real x(start=1);
parameter Real a = 1;
equation
   der(x)=-a*x;
end HelloWorld;

simulate(HelloWorld);

plot(x)


OMEdit gives back this error message:


Syntax    14:24:31        8:1-8:8    Parser error: Unexpected token near: simulate (IDENT)

I haven't any ideas, so please help me.

Regards,
Lorenzo

  • Index
  • » Users
  • » larry84
  • » Profile
You are here: