SetSubstitutions

set the default variable and parameter substitutions

Parameters

 substitutions - set ; set of the system's variable and parameter substitutions options - (optional) equation(s) of the form name = value

Returns

 • none

Options

 • savewithmodel : true or false
 Specifies whether the substitutions should be saved with the .msim model. Default is true.
 • forcereset : true or false
 Specifies whether the given substitutions should overwrite any stored substitutions. Default is false.

Description

 • A:-SetSubstitutions sets the variable and parameter substitutions.  If only a subset of the variables and parameters are defined, these values will be added to the currently stored set.  If no values were previously stored, any missing values will be automatically generated.
 • If there were already some substitutions set, calling A:-SetSubstitutions again does not remove them. If the stored substitutions and the passed substitutions contain the same variable, the passed substitutions overwrite the stored ones, unless the forcereset option is set to true.
 • In order to reset all of the currently stored substitutions, pass an empty set with the forcereset option set to true.
 • 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 substitutions that are applied to variable and parameter names in other API function calls:

 > $A:-\mathrm{GetSubstitutions}\left(\right)$
 $\left\{{\mathrm{Main.RLC.C}}{=}{C}{,}{\mathrm{Main.RLC.C1.i}}{=}{\mathrm{C1_i}}{,}{\mathrm{Main.RLC.C1.n.i}}{=}{\mathrm{C1_n_i}}{,}{\mathrm{Main.RLC.C1.n.v}}{=}{\mathrm{C1_n_v}}{,}{\mathrm{Main.RLC.C1.p.i}}{=}{\mathrm{C1_p_i}}{,}{\mathrm{Main.RLC.C1.p.v}}{=}{\mathrm{C1_p_v}}{,}{\mathrm{Main.RLC.C1.v}}{=}{\mathrm{C1_v}}{,}{\mathrm{Main.RLC.G2.p.i}}{=}{\mathrm{G2_p_i}}{,}{\mathrm{Main.RLC.G2.p.v}}{=}{\mathrm{G2_p_v}}{,}{\mathrm{Main.RLC.I1.i}}{=}{\mathrm{I1_i}}{,}{\mathrm{Main.RLC.I1.n.i}}{=}{\mathrm{I1_n_i}}{,}{\mathrm{Main.RLC.I1.n.v}}{=}{\mathrm{I1_n_v}}{,}{\mathrm{Main.RLC.I1.p.i}}{=}{\mathrm{I1_p_i}}{,}{\mathrm{Main.RLC.I1.p.v}}{=}{\mathrm{I1_p_v}}{,}{\mathrm{Main.RLC.I1.v}}{=}{\mathrm{I1_v}}{,}{\mathrm{Main.RLC.L}}{=}{L}{,}{\mathrm{Main.RLC.NP1.i}}{=}{\mathrm{NP1_i}}{,}{\mathrm{Main.RLC.NP1.v}}{=}{\mathrm{NP1_v}}{,}{\mathrm{Main.RLC.NP2.i}}{=}{\mathrm{NP2_i}}{,}{\mathrm{Main.RLC.NP2.v}}{=}{\mathrm{NP2_v}}{,}{\mathrm{Main.RLC.PP1.i}}{=}{\mathrm{PP1_i}}{,}{\mathrm{Main.RLC.PP1.v}}{=}{\mathrm{PP1_v}}{,}{\mathrm{Main.RLC.PP2.i}}{=}{\mathrm{PP2_i}}{,}{\mathrm{Main.RLC.PP2.v}}{=}{\mathrm{PP2_v}}{,}{\mathrm{Main.RLC.PP3.i}}{=}{\mathrm{PP3_i}}{,}{\mathrm{Main.RLC.PP3.v}}{=}{\mathrm{PP3_v}}{,}{\mathrm{Main.RLC.PS1.y}}{=}{\mathrm{PS1_y}}{,}{\mathrm{Main.RLC.R}}{=}{R}{,}{\mathrm{Main.RLC.R1.i}}{=}{\mathrm{R1_i}}{,}{\mathrm{Main.RLC.R1.n.i}}{=}{\mathrm{R1_n_i}}{,}{\mathrm{Main.RLC.R1.n.v}}{=}{\mathrm{R1_n_v}}{,}{\mathrm{Main.RLC.R1.p.i}}{=}{\mathrm{R1_p_i}}{,}{\mathrm{Main.RLC.R1.p.v}}{=}{\mathrm{R1_p_v}}{,}{\mathrm{Main.RLC.R1.v}}{=}{\mathrm{R1_v}}{,}{\mathrm{Main.RLC.SC1.i}}{=}{\mathrm{SC1_i}}{,}{\mathrm{Main.RLC.SC1.v}}{=}{\mathrm{SC1_v}}{,}{\mathrm{Main.S1.freqHz}}{=}{\mathrm{S1_freqHz}}{,}{\mathrm{Main.S1.offset}}{=}{\mathrm{S1_offset}}{,}{\mathrm{Main.S1.phase}}{=}{\mathrm{S1_phase}}{,}{\mathrm{Main.S1.y}}{=}{\mathrm{S1_y}}{,}{\mathrm{Main.Probe1.Vout}}{=}{\mathrm{Vout}}{,}{\mathrm{Main.RLC.InputSignal}}{=}{\mathrm{InputSignal}}{,}{\mathrm{Main.RLC.OutputSignal}}{=}{\mathrm{OutputSignal}}{,}{\mathrm{Main.RLC.PS1.p.i}}{=}{\mathrm{PS1_p_i}}{,}{\mathrm{Main.RLC.PS1.p.v}}{=}{\mathrm{PS1_p_v}}{,}{\mathrm{Main.RLC.R1.LossPower}}{=}{\mathrm{R1_LossPower}}{,}{\mathrm{Main.RLC.R1.R_actual}}{=}{\mathrm{R1_R_actual}}{,}{\mathrm{Main.RLC.R1.T_heatPort}}{=}{\mathrm{R1_T_heatPort}}{,}{\mathrm{Main.RLC.R1.T_ref}}{=}{\mathrm{R1_T_ref}}{,}{\mathrm{Main.RLC.R1.alpha}}{=}{\mathrm{R1_alpha}}{,}{\mathrm{Main.RLC.SC1.n.i}}{=}{\mathrm{SC1_n_i}}{,}{\mathrm{Main.RLC.SC1.n.v}}{=}{\mathrm{SC1_n_v}}{,}{\mathrm{Main.RLC.SC1.p.i}}{=}{\mathrm{SC1_p_i}}{,}{\mathrm{Main.RLC.SC1.p.v}}{=}{\mathrm{SC1_p_v}}{,}{\mathrm{Main.S1.amplitude}}{=}{\mathrm{S1_amplitude}}{,}{\mathrm{Main.S1.startTime}}{=}{\mathrm{S1_startTime}}\right\}$ (1)

Setting the default variable and parameter substitution:

 > $A:-\mathrm{SetSubstitutions}\left(\left\{\mathrm{Main.RLC.C}=\mathrm{C_new}\right\}\right)$

Getting the new set of substitutions:

 > $A:-\mathrm{GetSubstitutions}\left(\right)$
 $\left\{{\mathrm{Main.RLC.C}}{=}{\mathrm{C_new}}{,}{\mathrm{Main.RLC.C1.i}}{=}{\mathrm{C1_i}}{,}{\mathrm{Main.RLC.C1.n.i}}{=}{\mathrm{C1_n_i}}{,}{\mathrm{Main.RLC.C1.n.v}}{=}{\mathrm{C1_n_v}}{,}{\mathrm{Main.RLC.C1.p.i}}{=}{\mathrm{C1_p_i}}{,}{\mathrm{Main.RLC.C1.p.v}}{=}{\mathrm{C1_p_v}}{,}{\mathrm{Main.RLC.C1.v}}{=}{\mathrm{C1_v}}{,}{\mathrm{Main.RLC.G2.p.i}}{=}{\mathrm{G2_p_i}}{,}{\mathrm{Main.RLC.G2.p.v}}{=}{\mathrm{G2_p_v}}{,}{\mathrm{Main.RLC.I1.i}}{=}{\mathrm{I1_i}}{,}{\mathrm{Main.RLC.I1.n.i}}{=}{\mathrm{I1_n_i}}{,}{\mathrm{Main.RLC.I1.n.v}}{=}{\mathrm{I1_n_v}}{,}{\mathrm{Main.RLC.I1.p.i}}{=}{\mathrm{I1_p_i}}{,}{\mathrm{Main.RLC.I1.p.v}}{=}{\mathrm{I1_p_v}}{,}{\mathrm{Main.RLC.I1.v}}{=}{\mathrm{I1_v}}{,}{\mathrm{Main.RLC.L}}{=}{L}{,}{\mathrm{Main.RLC.NP1.i}}{=}{\mathrm{NP1_i}}{,}{\mathrm{Main.RLC.NP1.v}}{=}{\mathrm{NP1_v}}{,}{\mathrm{Main.RLC.NP2.i}}{=}{\mathrm{NP2_i}}{,}{\mathrm{Main.RLC.NP2.v}}{=}{\mathrm{NP2_v}}{,}{\mathrm{Main.RLC.PP1.i}}{=}{\mathrm{PP1_i}}{,}{\mathrm{Main.RLC.PP1.v}}{=}{\mathrm{PP1_v}}{,}{\mathrm{Main.RLC.PP2.i}}{=}{\mathrm{PP2_i}}{,}{\mathrm{Main.RLC.PP2.v}}{=}{\mathrm{PP2_v}}{,}{\mathrm{Main.RLC.PP3.i}}{=}{\mathrm{PP3_i}}{,}{\mathrm{Main.RLC.PP3.v}}{=}{\mathrm{PP3_v}}{,}{\mathrm{Main.RLC.PS1.y}}{=}{\mathrm{PS1_y}}{,}{\mathrm{Main.RLC.R}}{=}{R}{,}{\mathrm{Main.RLC.R1.i}}{=}{\mathrm{R1_i}}{,}{\mathrm{Main.RLC.R1.n.i}}{=}{\mathrm{R1_n_i}}{,}{\mathrm{Main.RLC.R1.n.v}}{=}{\mathrm{R1_n_v}}{,}{\mathrm{Main.RLC.R1.p.i}}{=}{\mathrm{R1_p_i}}{,}{\mathrm{Main.RLC.R1.p.v}}{=}{\mathrm{R1_p_v}}{,}{\mathrm{Main.RLC.R1.v}}{=}{\mathrm{R1_v}}{,}{\mathrm{Main.RLC.SC1.i}}{=}{\mathrm{SC1_i}}{,}{\mathrm{Main.RLC.SC1.v}}{=}{\mathrm{SC1_v}}{,}{\mathrm{Main.S1.freqHz}}{=}{\mathrm{S1_freqHz}}{,}{\mathrm{Main.S1.offset}}{=}{\mathrm{S1_offset}}{,}{\mathrm{Main.S1.phase}}{=}{\mathrm{S1_phase}}{,}{\mathrm{Main.S1.y}}{=}{\mathrm{S1_y}}{,}{\mathrm{Main.Probe1.Vout}}{=}{\mathrm{Vout}}{,}{\mathrm{Main.RLC.InputSignal}}{=}{\mathrm{InputSignal}}{,}{\mathrm{Main.RLC.OutputSignal}}{=}{\mathrm{OutputSignal}}{,}{\mathrm{Main.RLC.PS1.p.i}}{=}{\mathrm{PS1_p_i}}{,}{\mathrm{Main.RLC.PS1.p.v}}{=}{\mathrm{PS1_p_v}}{,}{\mathrm{Main.RLC.R1.LossPower}}{=}{\mathrm{R1_LossPower}}{,}{\mathrm{Main.RLC.R1.R_actual}}{=}{\mathrm{R1_R_actual}}{,}{\mathrm{Main.RLC.R1.T_heatPort}}{=}{\mathrm{R1_T_heatPort}}{,}{\mathrm{Main.RLC.R1.T_ref}}{=}{\mathrm{R1_T_ref}}{,}{\mathrm{Main.RLC.R1.alpha}}{=}{\mathrm{R1_alpha}}{,}{\mathrm{Main.RLC.SC1.n.i}}{=}{\mathrm{SC1_n_i}}{,}{\mathrm{Main.RLC.SC1.n.v}}{=}{\mathrm{SC1_n_v}}{,}{\mathrm{Main.RLC.SC1.p.i}}{=}{\mathrm{SC1_p_i}}{,}{\mathrm{Main.RLC.SC1.p.v}}{=}{\mathrm{SC1_p_v}}{,}{\mathrm{Main.S1.amplitude}}{=}{\mathrm{S1_amplitude}}{,}{\mathrm{Main.S1.startTime}}{=}{\mathrm{S1_startTime}}\right\}$ (2)

Resetting the set of substitutions:

 > $A:-\mathrm{SetSubstitutions}\left(\varnothing ,\mathrm{forcereset}\right)$

Checking that the substitutions were reset:

 > $A:-\mathrm{GetSubstitutions}\left(\right)$
 $\left\{{\mathrm{Main.RLC.C}}{=}{C}{,}{\mathrm{Main.RLC.C1.i}}{=}{\mathrm{C1_i}}{,}{\mathrm{Main.RLC.C1.n.i}}{=}{\mathrm{C1_n_i}}{,}{\mathrm{Main.RLC.C1.n.v}}{=}{\mathrm{C1_n_v}}{,}{\mathrm{Main.RLC.C1.p.i}}{=}{\mathrm{C1_p_i}}{,}{\mathrm{Main.RLC.C1.p.v}}{=}{\mathrm{C1_p_v}}{,}{\mathrm{Main.RLC.C1.v}}{=}{\mathrm{C1_v}}{,}{\mathrm{Main.RLC.G2.p.i}}{=}{\mathrm{G2_p_i}}{,}{\mathrm{Main.RLC.G2.p.v}}{=}{\mathrm{G2_p_v}}{,}{\mathrm{Main.RLC.I1.i}}{=}{\mathrm{I1_i}}{,}{\mathrm{Main.RLC.I1.n.i}}{=}{\mathrm{I1_n_i}}{,}{\mathrm{Main.RLC.I1.n.v}}{=}{\mathrm{I1_n_v}}{,}{\mathrm{Main.RLC.I1.p.i}}{=}{\mathrm{I1_p_i}}{,}{\mathrm{Main.RLC.I1.p.v}}{=}{\mathrm{I1_p_v}}{,}{\mathrm{Main.RLC.I1.v}}{=}{\mathrm{I1_v}}{,}{\mathrm{Main.RLC.L}}{=}{L}{,}{\mathrm{Main.RLC.NP1.i}}{=}{\mathrm{NP1_i}}{,}{\mathrm{Main.RLC.NP1.v}}{=}{\mathrm{NP1_v}}{,}{\mathrm{Main.RLC.NP2.i}}{=}{\mathrm{NP2_i}}{,}{\mathrm{Main.RLC.NP2.v}}{=}{\mathrm{NP2_v}}{,}{\mathrm{Main.RLC.PP1.i}}{=}{\mathrm{PP1_i}}{,}{\mathrm{Main.RLC.PP1.v}}{=}{\mathrm{PP1_v}}{,}{\mathrm{Main.RLC.PP2.i}}{=}{\mathrm{PP2_i}}{,}{\mathrm{Main.RLC.PP2.v}}{=}{\mathrm{PP2_v}}{,}{\mathrm{Main.RLC.PP3.i}}{=}{\mathrm{PP3_i}}{,}{\mathrm{Main.RLC.PP3.v}}{=}{\mathrm{PP3_v}}{,}{\mathrm{Main.RLC.PS1.y}}{=}{\mathrm{PS1_y}}{,}{\mathrm{Main.RLC.R}}{=}{R}{,}{\mathrm{Main.RLC.R1.i}}{=}{\mathrm{R1_i}}{,}{\mathrm{Main.RLC.R1.n.i}}{=}{\mathrm{R1_n_i}}{,}{\mathrm{Main.RLC.R1.n.v}}{=}{\mathrm{R1_n_v}}{,}{\mathrm{Main.RLC.R1.p.i}}{=}{\mathrm{R1_p_i}}{,}{\mathrm{Main.RLC.R1.p.v}}{=}{\mathrm{R1_p_v}}{,}{\mathrm{Main.RLC.R1.v}}{=}{\mathrm{R1_v}}{,}{\mathrm{Main.RLC.SC1.i}}{=}{\mathrm{SC1_i}}{,}{\mathrm{Main.RLC.SC1.v}}{=}{\mathrm{SC1_v}}{,}{\mathrm{Main.S1.freqHz}}{=}{\mathrm{S1_freqHz}}{,}{\mathrm{Main.S1.offset}}{=}{\mathrm{S1_offset}}{,}{\mathrm{Main.S1.phase}}{=}{\mathrm{S1_phase}}{,}{\mathrm{Main.S1.y}}{=}{\mathrm{S1_y}}{,}{\mathrm{Main.Probe1.Vout}}{=}{\mathrm{Vout}}{,}{\mathrm{Main.RLC.InputSignal}}{=}{\mathrm{InputSignal}}{,}{\mathrm{Main.RLC.OutputSignal}}{=}{\mathrm{OutputSignal}}{,}{\mathrm{Main.RLC.PS1.p.i}}{=}{\mathrm{PS1_p_i}}{,}{\mathrm{Main.RLC.PS1.p.v}}{=}{\mathrm{PS1_p_v}}{,}{\mathrm{Main.RLC.R1.LossPower}}{=}{\mathrm{R1_LossPower}}{,}{\mathrm{Main.RLC.R1.R_actual}}{=}{\mathrm{R1_R_actual}}{,}{\mathrm{Main.RLC.R1.T_heatPort}}{=}{\mathrm{R1_T_heatPort}}{,}{\mathrm{Main.RLC.R1.T_ref}}{=}{\mathrm{R1_T_ref}}{,}{\mathrm{Main.RLC.R1.alpha}}{=}{\mathrm{R1_alpha}}{,}{\mathrm{Main.RLC.SC1.n.i}}{=}{\mathrm{SC1_n_i}}{,}{\mathrm{Main.RLC.SC1.n.v}}{=}{\mathrm{SC1_n_v}}{,}{\mathrm{Main.RLC.SC1.p.i}}{=}{\mathrm{SC1_p_i}}{,}{\mathrm{Main.RLC.SC1.p.v}}{=}{\mathrm{SC1_p_v}}{,}{\mathrm{Main.S1.amplitude}}{=}{\mathrm{S1_amplitude}}{,}{\mathrm{Main.S1.startTime}}{=}{\mathrm{S1_startTime}}\right\}$ (3)