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

Getting different simulation results based on user input

Getting different simulation results based on user input

Hello
I am looking for an answer of following question:

I want to develop a simple simulation program working with user input as some required parameters. I mean i want to make a test.exe that generates simulation results based on user input. How I can do this? I stated that I just looking for a simple program with one or two parameters. Parameters can be typed by user or retrieved from a text file.

I will be very thankful for any help to show me how OpenModelica deals with parameters

Re: Getting different simulation results based on user input

Hi,

When you compile a Modelica model in OpenModelica you get a set of files including the $Modelname$_init.txt file that contains the defined parameters in your model.
Every time the $Modelname$.exe file is executed the init-file is read.
You can change the parameter values before a new simualtion.

Best Regards
Mohsen

Re: Getting different simulation results based on user input

Thank you mohsen for you great answer. I have another question please:

How the OpenModelica generates the $Modelname$_init.txt file and retrieve the parameters from it?
Does it have a standard mechanism for sequencing the values?
Are the values sequence is based on their definition or calling sequence in the simulation code? 

Thank you very much.

Re: Getting different simulation results based on user input

The sequence is random. You need to parse the file to realize what line to update.

Re: Getting different simulation results based on user input

@sjoelund.se: thank you very much

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