GetParameters

get the parameters of the active MapleSim subsystem in SI units

Parameters

 options - (optional) equation(s) of the form name = value

Returns

 • list : list of the active subsystem's parameters or a list of the specific parameters

Options

 • toplevel : true or false
 Specifies whether the top-level parameters should be returned regardless of the active subsystem setting. Default is false.
 • allparams : true or false
 Specifies whether all the parameters of the active subsystem, not just those explicitly defined, should be returned. The output also depends on the setting of the codegenonly option. Default is false.
 • codegenonly : true or false
 Specifies whether only the parameters that can be left symbolic during code generation should be returned. The output also depends on the setting of the allparams option. Default is true.
 • allremaining : true or false
 Specifies whether all parameters that remain in the equations and initial equations should be returned. When the option is set to true the settings of the allparams option is ignored. Default is false.
 • nosubs : true or false
 True means name substitutions are not applied to the parameters. Default is false.
 • params : list of strings or names
 Specifies the parameters for which the query is requested. When this  option is used, the parameter values are returned in the units that are displayed in the MapleSim GUI (they are not converted to SI). The parameters can be given as Maple names or strings.

Description

 • A:-GetParameters returns a list of parameters from A's active subsystem. If no subsystem is active, or if the option toplevel is specified, the command returns the parameters defined for the entire model.
 • Unless the option allparams is specified, only parameters that are explicitly defined for the active subsystem are shown.  Explicitly defined parameters are those that are defined in the parameter view of the subsystem or the subsystem's parameter blocks.
 • The A:-GetParameters command currently returns only parameters of the type float.
 • Unless the option params is specified, all parameters are returned in SI units. By default, only the parameters that can be left symbolic in code generation tools are returned. These are the parameters that do not appear in piecewise functions or event handling definitions: _msim_initial, _msim_sample, _msim_edge, _msim_change, _msim_pre, _msim_reinit, _msim_terminate, msim/SEQ, and msim/WHEN. Use the codegenonly option to change the default behavior.
 • The A := MapleSim:-LinkModel() statement needs to be run prior to successfully using any of the ModelObject A's export functions.

Examples

 > $A≔\mathrm{MapleSim}:-\mathrm{LinkModel}\left('\mathrm{filename}'=\mathrm{cat}\left(\mathrm{kernelopts}\left('\mathrm{toolboxdir}'=\mathrm{MapleSim}\right),"/data/examples/RLCcircuit.msim"\right)\right):$

Getting the parameters of the active subsystem (you are at the top level):

 > $A:-\mathrm{GetParameters}\left(\right)$
 $\left[{}\right]$ (1)

Compare to the output when the allparams option is set to true:

 > $A:-\mathrm{GetParameters}\left(\mathrm{allparams}=\mathrm{true}\right)$
 $\left[{C}{=}{1}{,}{L}{=}{1}{,}{\mathrm{R1_T_ref}}{=}\frac{{6003}}{{20}}{,}{\mathrm{R1_alpha}}{=}{0}{,}{R}{=}{1}{,}{\mathrm{S1_amplitude}}{=}{1}{,}{\mathrm{S1_freqHz}}{=}{1}{,}{\mathrm{S1_offset}}{=}{0}{,}{\mathrm{S1_phase}}{=}{0}\right]$ (2)

Compare to the output when the codegenonly option set to false:

 > $A:-\mathrm{GetParameters}\left(\mathrm{allparams}=\mathrm{true},\mathrm{codegenonly}=\mathrm{false}\right)$
 $\left[{\mathrm{Main.RLC.C1.C}}{=}{1}{,}{C}{=}{1}{,}{\mathrm{Main.RLC.I1.L}}{=}{1}{,}{L}{=}{1}{,}{\mathrm{Main.RLC.R1.R}}{=}{1}{,}{\mathrm{R1_T_ref}}{=}\frac{{6003}}{{20}}{,}{\mathrm{Main.RLC.R1.T}}{=}\frac{{6003}}{{20}}{,}{\mathrm{R1_alpha}}{=}{0}{,}{\mathrm{Main.RLC.R1.useHeatPort}}{=}{\mathrm{false}}{,}{R}{=}{1}{,}{\mathrm{S1_amplitude}}{=}{1}{,}{\mathrm{S1_freqHz}}{=}{1}{,}{\mathrm{S1_offset}}{=}{0}{,}{\mathrm{S1_phase}}{=}{0}{,}{\mathrm{S1_startTime}}{=}{0}\right]$ (3)

Some of the returned parameters will not appear in the equations or the initial equations. These parameters often have symbolic expressions in terms of other parameters as their values.

Compare to the output when the allremaining option is set to true:

 > $A:-\mathrm{GetParameters}\left(\mathrm{allremaining}=\mathrm{true}\right)$
 $\left[{C}{=}{1}{,}{L}{=}{1}{,}{\mathrm{R1_T_ref}}{=}\frac{{6003}}{{20}}{,}{\mathrm{R1_alpha}}{=}{0}{,}{R}{=}{1}{,}{\mathrm{S1_amplitude}}{=}{1}{,}{\mathrm{S1_freqHz}}{=}{1}{,}{\mathrm{S1_offset}}{=}{0}{,}{\mathrm{S1_phase}}{=}{0}\right]$ (4)

In this example the output is the same as when allparams = true and codegenonly = true (default). However, it is not the case in general. Setting the codegenonly option to true may eliminate some parameters from the output that would otherwise appear when the allremaining option is set to true.

Setting the active subsystem as the RLC circuit subsystem:

 > $A:-\mathrm{SetSubsystemName}\left("RLC"\right)$

Getting the parameters of the RLC subsystem:

 > $A:-\mathrm{GetParameters}\left(\right)$
 $\left[{C}{=}{1}{,}{L}{=}{1}{,}{R}{=}{1}\right]$ (5)
 > $A:-\mathrm{GetParameters}\left(\mathrm{params}=\left[R\right]\right)$
 $\left[{R}{=}{1}\right]$ (6)