Opened 6 years ago

Closed 5 years ago

#5378 closed enhancement (fixed)

Enhancements required for multi-simulation scenarios

Reported by: prateek.gupta@… Owned by: arunkumar palanisamy
Priority: high Milestone:
Component: OMPython Version:
Keywords: Cc:

Description

Using getXXXX() method from ModelicaSystem class loads the results and parameter values from the resultant MAT file with the default name "model_name_res.mat". But if the same model has to be simulated multiple times by changing certain parameters, the resulting MAT file gets overwritten for each simulation iteration and comparing the results with the previous simulations is not possible. Therefore I would like to suggest following two enhancements in the existing OMPython library and in particular ModelicaSystem class:

  1. Allow the user to provide a name or suffix for the generated resultant MAT file
  2. Allow the user to define the path to the MAT file from which they want to read the results or parameters using getXXXX()/getXXXX(S) method.

Change History (3)

comment:1 by arunkumar palanisamy, 5 years ago

Owner: changed from Alachew Mengist to arunkumar palanisamy
Status: newaccepted

comment:2 by arunkumar palanisamy, 5 years ago

This feature is now implemented, You can update OMPython and test it
Now you can specify your own result file using the following getXXX method

omc.simulate(resultfile="tmpres.mat")`
omc.getSolutions("time", resultfile="tmpres.mat")

If the result file is not specified the default resultfilename is used on both the API calls

However, for comparison of different result file you can use getSolutions () something thing like below, You can also use getSolution() method to directly read a result file, if the resultfile is available in some location.

omc.getSolutions("time", resultfile="tmpres1.mat")
omc.getSolutions("time", resultfile="tmpres2.mat")

comment:3 by arunkumar palanisamy, 5 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.