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

 • 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.
 • 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.
 • 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.
 • filter : string, set, or list
 Patterns used to select parameters. Each string is a wildcard pattern, see StringTools[WildcardMatch] for the format.  If filter is a set or list, then any parameter that matches any of the patterns is accepted. Matching is made both before and after substitution; parameters that match either are accepted. This option is not used with the params option. See also ignorecase. The default is "*", which matches all parameters.
 • ignorecase : true or false
 True means ignore case in both the parameters and the patterns in filter. Used only when filter is supplied. The default is false.
 • noerror : true or false
 True means no error is raised if a requested parameter does not exist; the missing parameters are not included in the returned equations. Only used with the params option. The 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. The parameters can be given as Maple names or strings.
 • toplevel : true or false
 Specifies whether the top-level parameters should be returned regardless of the active subsystem setting. Default is false.

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.
 • 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 passed:

 > $A:-\mathrm{GetParameters}\left('\mathrm{allparams}'\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 passed:

 > $A:-\mathrm{GetParameters}\left('\mathrm{allremaining}'\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)

Use allparams and the filter option with a wildcard to return all parameters that start with R:

 > $A:-\mathrm{GetParameters}\left('\mathrm{allparams}','\mathrm{filter}'="R*"\right)$
 $\left[{\mathrm{R1_T_ref}}{=}\frac{{6003}}{{20}}{,}{\mathrm{R1_alpha}}{=}{0}{,}{R}{=}{1}\right]$ (7)