GetVariables

Get the variables of the active MapleSim subsystem

Parameters

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

Returns

 • list : list of the active subsystem/s variables.

Options

 • toplevel : true or false
 Specifies whether the top-level variables should be returned regardless of the active subsystem setting. Default is false.
 • daeonly : true or false
 Specifies whether to return variables appearing only in the core continuous equations ("daes"). See MapleSim[LinkModel][GetEquations] for more details. Default is true.
 • nosubs : true or false
 Specifies whether variable substitutions will be applied to the returned variable set.  Default is false.
 • filter : string, set, or list
 Patterns used to select the desired variables. Each string is a wildcard pattern, see StringTools[WildcardMatch] for the pattern format.  If filter is a set or list, then any variable that matches any of the patterns is accepted. Matching is made both before and after substitution; parameters that match either are accepted. See also ignorecase. The default is "*", which matches all variables.
 • ignorecase : true or false
 True means ignore case in both the variables and the patterns in filter. Used only when filter is supplied. The default is false.
 • inputs : set or list of variables
 Specifies which variables should be treated as inputs when equations are simplified. Used with subsystems with acausal ports when $\mathrm{daeonly}=\mathrm{true}$ because changing which variables are treated as inputs may affect the core DAE equations, and, hence, the variables that appear in it. Input signal port variables are always treated as inputs. In addition, by default, the across (potential) variables of acausal ports are treated as inputs. If the inputs option is passed, only the signal inputs and the variables specified by inputs are treated as inputs.
 • params : one of the following: set, list or 'all'
 Specifies which parameters to leave symbolic when determining a core DAE system. This option is needed only when $\mathrm{daeonly}=\mathrm{true}$ because the choice of which parameters are left symbolic may affect the resulting core DAE system, and , hence, the variables in it. By default, only parameters explicitly defined on the active subsystem are left symbolic.

Description

 • A:-GetVariables returns a list of A's active subsystem's variables. If no subsystem is active, or the option toplevel is specified, the command returns the variables defined for the entire model.
 • 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 variables of the active subsystem:

 > $A:-\mathrm{GetVariables}\left(\right)$
 $\left[{\mathrm{C1_p_i}}{}\left({t}\right){,}{\mathrm{I1_p_i}}{}\left({t}\right){,}{\mathrm{SC1_v}}{}\left({t}\right)\right]$ (1)

Use the filter option with a wildcard to return all variables that start with a C

 > $A:-\mathrm{GetVariables}\left('\mathrm{filter}'="C*"\right)$
 $\left[{\mathrm{C1_p_i}}{}\left({t}\right)\right]$ (2)