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

• 

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

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 set to true:

A:-GetParametersallparams=true

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 set to true:

A:-GetParametersallremaining=true

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:-GetParametersparams=R

R=1

(6)

See Also

MapleSim

MapleSim[LinkModel]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam