Opened 6 years ago

Closed 6 years ago

#5388 closed defect (invalid)

set non constant (time-dependant) parameter value in a mos file

Reported by: yulu.dong@… Owned by: Willi Braun
Priority: high Milestone: 1.14.0
Component: Run-time Version: v1.12.0
Keywords: scripting, non constant parameter sweep Cc:

Description

I'm looking for a way to do parameter sweep in a .mos file with non constant parameter value.
Currently I'm able to give a constant value to a certain parameter using this command line:
simulate(test,startTime = 0, stopTime=10, outputFormat = "csv", simflags="-overrideFile=parameter_value.txt", );

and in parameter_value.txt file I have something like : k = 15.

But what I need to do is to set k = 0 for t= 0 - 10s, then set k = 15 from t = 10s during the simulation. And I'm using mos file to do the parameter sweep because I'm using python to automatically launch multiple simulations while change parameter values for each scenario.

So in this case I would like to know how to set time-dependant parameter value in the mos file. Thanks a lot!!!

Change History (2)

comment:1 by Adeel Asghar, 6 years ago

Component: OMEditRun-time
Milestone: Future1.14.0
Owner: changed from Adeel Asghar to Willi Braun
Status: newassigned

I think you need csvinput instead of parameter sweep.

Create a csv file with time and K values and pass it to the simulate command via simflags.

comment:2 by Francesco Casella, 6 years ago

Resolution: invalid
Status: assignedclosed

In fact, there is no such thing as a time-dependent parameter in Modelica, see Section 4.4.4 of the Modelica 3.4 specification:

A variable vc declared with the parameter or constant prefixes remains constant during transient analysis

The suggestion by @adeas31 is good, you may try that out.

Note: See TracTickets for help on using tickets.