SimulateFMU - Maple Help

FMUTester

 SimulateFMU
 simulate an FMU

 Calling Sequence SimulateFMU(fmu, options)

Parameters

 fmu - string; FMU name with .fmu extension

 Returns Simulation results in the format specified by returntype.

Options

 • returntype = list(identical('plot', 'Matrix', 'python'))
 Specifies the type of returned data. If returntype = Matrix, the first row of the returned Matrix will be a header with the time and output variable names. The default value is ["plot"].
 • plotcolor = one of "mono" or "random"
 Specifies the color scheme for the returned plots when returntype = "plot". If plotcolor = "random", the output plot(s) will have randomly picked colors. If plotcolor = "mono", the output plot(s) will have the default plot color. This is useful for visual testing purposes, where plot comparisons need to be deterministic. The default value is ["random"].
 • plotcolumns = posint
 Specifies the number of columns used to display the returned plots. The default value is 1.
 • validateFMU = true or false
 Specifies whether the FMU's model description XML syntax will be validated before simulating the FMU. The default value is true.
 • starttime = numeric or NULL
 Specifies the simulation start time. If starttime is not specified, the default experiment value is used as start time. If no default experiment is found in the FMU, the start time is set to zero. The default value is NULL.
 • stoptime = numeric or NULL
 Specifies the simulation stop time. If stoptime is not specified, the default experiment value is used as stop time. If no default experiment is found in the FMU, the stop time is set to 1 second after the start time. The default value is NULL.
 • solverme = one of "Euler" or "CVode"
 Specifies the solver to use for ModelExchange" ("ME") FMUs. The default value is "CVode".
 • stepsize = numeric or NULL
 Specifies the step size for the "Euler" solver. The default value is NULL.
 • tolerance = numeric or NULL
 Specifies the relative tolerance for the "CVode" solver. If the FMU is a 2.0 "CoSimulation" ("CS"), it specifies the relative tolerance of the CoSimulation solver. The default value is NULL.
 • sampleinterval = numeric or NULL
 Specifies the interval for sampling the output. The default value is NULL.
 • eventsme = true or false
 Specifies whether outputs at events will be recorded for "ModelExchange" ("ME") FMUs. The default value is true.
 • fmitype = one of "CoSimulation", "ModelExchange" or NULL
 Specifies the FMI type for the simulation. If fmitype is not specified, it is determined from the FMU model description. The default value is NULL.
 • initialvalues = set or list of equations name = numeric
 Specifies the start values for model variables as: variable name = variable initial value. The default value is an empty set.
 • usedefaultics = true or false
 Specifies whether the initial values from the model description will be used. The default value is false.
 • inputfile = string or NULL
 Specifies the name of the CSV file that contains the FMU model input. The default value is NULL.
 • outputvars = list(string)
 List of variables that will be returned as simulation results. If outputvars is not specified, only the FMU outputs are returned. The default value is an empty list.
 • maxtime = numeric or NULL
 Specifies the timeout for the simulation. The default value is NULL.
 • debuglog = true or false
 Specifies whether the FMU's debug logging will be enabled. The default value is false.

Description

 • The SimulateFMU procedure simulates the FMU, and returns the simulation results as a Maple plot, a Maple Matrix, or a Python data structure (numpy array of tuples).

Examples

 > $\mathrm{with}\left(\mathrm{FMUTester}\right):$
 > $\mathrm{fmuname}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{kernelopts}\left('\mathrm{datadir}'\right),"FMUs","CoupledClutches.fmu"\right]\right):$
 > $\mathrm{inputcsv}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{kernelopts}\left('\mathrm{datadir}'\right),"FMUs","CoupledClutches_in.csv"\right]\right):$
 > $\mathrm{SimulateFMU}\left(\mathrm{fmuname},'\mathrm{inputfile}'=\mathrm{inputcsv},'\mathrm{plotcolumns}'=2\right)$

 > $\mathrm{res}≔\mathrm{SimulateFMU}\left(\mathrm{fmuname},'\mathrm{inputfile}'=\mathrm{inputcsv},'\mathrm{returntype}'=\left["Matrix"\right]\right)$
 ${{\mathrm{_rtable}}}_{{36893627928443864956}}$ (1)
 > 

Compatibility

 • The FMUTester[SimulateFMU] command was introduced in Maple 2019.