GetParameters - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim : MapleSim Application Programming Interface : API Commands : MapleSim/LinkModel/GetParameters

GetParameters

get the parameters of the active MapleSim subsystem in SI units

 

Calling Sequence

Parameters

Returns

Options

Description

Examples

Calling Sequence

A := MapleSim:-LinkModel();

A:-GetParameters(options)

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

Linking to a MapleSim model (located in .msim file):

AMapleSim:-LinkModel'filename'=catkernelopts'toolboxdir'=MapleSim,/data/examples/RLCcircuit.msim:

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

A:-GetParameters

(1)

Compare to the output when the allparams option is passed:

A:-GetParameters'allparams'

C=1,L=1,R1_T_ref=600320,R1_alpha=0,R=1,S1_amplitude=1,S1_freqHz=1,S1_offset=0,S1_phase=0

(2)

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

A:-GetParametersallparams=true,codegenonly=false

Main.RLC.C1.C=1,C=1,Main.RLC.I1.L=1,L=1,Main.RLC.R1.R=1,R1_T_ref=600320,Main.RLC.R1.T=600320,R1_alpha=0,Main.RLC.R1.useHeatPort=false,R=1,S1_amplitude=1,S1_freqHz=1,S1_offset=0,S1_phase=0,S1_startTime=0

(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:-GetParameters'allremaining'

C=1,L=1,R1_T_ref=600320,R1_alpha=0,R=1,S1_amplitude=1,S1_freqHz=1,S1_offset=0,S1_phase=0

(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:-SetSubsystemNameRLC

Getting the parameters of the RLC subsystem:

A:-GetParameters

C=1,L=1,R=1

(5)

A:-GetParameters'params'=R

R=1

(6)

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

A:-GetParameters'allparams','filter'=R*

R1_T_ref=600320,R1_alpha=0,R=1

(7)

See Also

MapleSim

MapleSim[LinkModel]