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

HOW TO WRITE .mos COMMAND AND WHERE?

HOW TO WRITE .mos COMMAND AND WHERE?

Hi,
Can you help me to out my problem like" How to write .mos command and where can i write it, and how can i simulate .mos command ?" In short, give me the whole discription of .mos command and related documentation.
My second question is " what are the use of .mat and .plt file output format and how can i open it and in which other software?"
Hope with positive reply.
Best regards,
Jitesh.

Edited by: 20088921 - Aug-08-15 06:26:37

Re: HOW TO WRITE .mos COMMAND AND WHERE?

Hi,

I do have the same problem. Does any one could help us on this? I tried to right some command lines (from the user guide to be sure of their quality) in a basic text editor and then save the file as a <*.mos> flie. I saved it in different sub-folders of %OPENMODELICAHOME% folder and tried to run the command:
[ > %OPENMODELICAHOME%\bin\omc myScript.mos ] in the Windows command shell. However, I obtained an error message.

So, I would like to know what is the right process to generate a .mos file and execute it.

Thanks in advance,
Pierre.

Re: HOW TO WRITE .mos COMMAND AND WHERE?

What error-message did you get? This is very important in order to figure out what you did wrong. Also, what was the contents of the mos-file?

Re: HOW TO WRITE .mos COMMAND AND WHERE?

Thanks for your quick answer!

My precise approach was:

-> in the windows text editor, enter the following commands:

Code:

loadModel(Modelica); 

loadFile("C:/OpenModelica1.9.2/share/doc/omc/testmodels/dcmotor.mo");
simulate(dcmotor,startTime=0.0,stopTime=10.0);
plot({load.w,load.phi})

-> save as: "myScript.mos" in C:\OpenModelica1.9.2\bin
->  run the windows cmd.exe
-> check the %OPENMODELICAHOME% path
----> execute > echo %OPENMODELICAHOME%
-----> obtain: C:\OpenModelica1.9.2\-> try to run the script:
----> execute >%OPENMODELICAHOME%\bin\omc myScript.mos
----> obtain:
"File does not exist: myScript.mos
# Error encountered! Existing...
# Please check the error message and the flags.

Excution failed!"

Re: HOW TO WRITE .mos COMMAND AND WHERE?

You need to either "cd %OPENMODELICAHOME%\bin\" or run the command %OPENMODELICAHOME%\bin\omc %OPENMODELICAHOME%\bin\myScript.mos

Re: HOW TO WRITE .mos COMMAND AND WHERE?

It worked! Thank you a lot for this help.

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