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
  • » Allen
  • » Profile

Posts

Posts

May-09-17 14:35:29
please help why I see this command line error

Can anyone help me to fix this to run using command line
To give you an idea,
- I have a package named Package
- With in it there is a an experiment called System
- my model uses four data files (a two column, and n number of rows). The files are AWCD.txt, DWCD.txt, popmillion.txt, and air.txt

I created mos file (mosfile.mos) as follows:

Code:


loadModel(Modelica);
loadFile("F:/0000_Apps/MODELICA/Test/Package.mo"); getErrorString();
loadFile("F:/0000_Apps/MODELICA/Test/Data/AWCD.txt"); getErrorString();
loadFile("F:/0000_Apps/MODELICA/Test/Data/DWCD.txt"); getErrorString();
loadFile("F:/0000_Apps/MODELICA/Test/Data/popmillion.txt"); getErrorString();
loadFile("F:/0000_Apps/MODELICA/Test/Data/air.txt"); getErrorString();
simulate(System, startTime = 0, stopTime = 1, numberOfIntervals = 500, tolerance = 0.0001, method = "dassl", outputFormat = "csv"); getErrorString();

And my batch file is :

Code:


c:/OpenModelica1.9.3Nightly/bin/omc.exe mosfile.mos
pause

After launching the cmd file using batch file, I got this errors:

Code:


F:\0000_Apps\MODELICA\Test>c:/OpenModelica1.9.3Nightly/bin/omc.exe mosfile.mos
"F:/0000_Apps/MODELICA/Test"
true
true
"[F:/0000_Apps/MODELICA/Test/Package.mo:356:73-356:77:writable] Warning: Lexer treating \ as \\, since \_ is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:356:73-356:88:writable] Warning: Lexer treating \ as \\, since \M is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:356:73-356:97:writable] Warning: Lexer treating \ as \\, since \W is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:356:73-356:106:writable] Warning: Lexer treating \ as \\, since \D is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:356:73-356:111:writable] Warning: Lexer treating \ as \\, since \w is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:532:73-532:77:writable] Warning: Lexer treating \ as \\, since \_ is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:532:73-532:88:writable] Warning: Lexer treating \ as \\, since \M is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:532:73-532:97:writable] Warning: Lexer treating \ as \\, since \W is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:532:73-532:106:writable] Warning: Lexer treating \ as \\, since \D is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:532:73-532:111:writable] Warning: Lexer treating \ as \\, since \p is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:630:73-630:77:writable] Warning: Lexer treating \ as \\, since \_ is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:630:73-630:88:writable] Warning: Lexer treating \ as \\, since \M is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:630:73-630:97:writable] Warning: Lexer treating \ as \\, since \W is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:630:73-630:106:writable] Warning: Lexer treating \ as \\, since \D is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:630:73-630:111:writable] Warning: Lexer treating \ as \\, since \D is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:653:73-653:77:writable] Warning: Lexer treating \ as \\, since \_ is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:653:73-653:88:writable] Warning: Lexer treating \ as \\, since \M is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:653:73-653:97:writable] Warning: Lexer treating \ as \\, since \W is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:653:73-653:106:writable] Warning: Lexer treating \ as \\, since \D is not a valid Modelica escape sequence.
[F:/0000_Apps/MODELICA/Test/Package.mo:653:73-653:111:writable] Warning: Lexer treating \ as \\, since \A is not a valid Modelica escape sequence.
"
false
"[F:/0000_Apps/MODELICA/Test/Data/AWCD.txt:1:0-1:0:writable] Error: Lexer failed to recognize '#1
double '
"
false
"[F:/0000_Apps/MODELICA/Test/Data/DWCD.txt:1:0-1:0:writable] Error: Lexer failed to recognize '#1
double '
"
false
"[F:/0000_Apps/MODELICA/Test/Data/popmillion.txt:1:0-1:0:writable] Error: Lexer failed to recognize '#1
double '
"
false
"[F:/0000_Apps/MODELICA/Test/Data/air.txt:1:0-1:0:writable] Error: Lexer failed to recognize '#1
double '
"
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 0.0001, method = 'dassl', fileNamePrefix = 'System', options = '', outputFormat = 'csv', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "Simulation Failed. Model: System does not exist! Please load it first before simulation.",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;
""

F:\0000_Apps\MODELICA\Test>pause
Appuyez sur une touche pour continuer...

Could you please guide me how to fix this problem?

The batch file approach and the mos file format without using external files (on a simple test model) works without any issue.  However, with this model, it doesn't work. Maybe there is another way to call the data files? Or any error that I didn't pay attention?

Many thanks in advance

May-06-17 10:59:59
Call full path of a Modelica library into a Modelica Script file
Category: Programming

Can anyone know how to call the full path of a Modelica library, in this case a combi table library, into a modelica script file?

May-01-17 14:20:44
How to create .mos file manually or through OpenModelica
Category: Programming

Dears,

Is it possible to create .mos file using OpenModelica?
If yes, how can I do that from within OpenModelica?

if not, can anyone tell me how to create .mos file for the following modelica package structure:

myMainPackage
    - InterfacePackage
    - ConnectorsPackage
    - ComponentsPackage
    myExperiment


I would like to run myExperiment using .mos file.  I would like to note that, this model (experiment) reads time series file (series.txt) which is located in the same folder as the main package myMainPackage.mo

I had tried the following but I couldn't find it working:

Code:


// -start script
cd();  // display the current directory
loadFile("C:\\MOD\\myMainPackage.mo"); getErrorString();
simulate(myExperiment, startTime = 0, stopTime = 1, numberOfIntervals = 500, tolerance = 0.0001, method = "dassl", outputFormat = "csv"); getErrorString();
// -end script

I admint that I do not know where to place the time series file (series.txt)


Can anyone help me

Apr-16-17 11:28:52
Is it possible to click on on component icon to open external application

Hi Modelica group,

I would be glad if anyone ever know / or if it is possible to click on the icon of any modelica component in order to open external application, such as notebook or any any other exe application

Many thanks,
Allen

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