- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Getting different simulation results...
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.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Getting different simulation results...