SetSubstitutions
set the default variable and parameter substitutions
Calling Sequence
Parameters
Returns
Options
Description
Examples
A := MapleSim:-LinkModel();
A:-SetSubstitutions(substitutions, options)
substitutions
-
set ; set of the system's variable and parameter substitutions
options
(optional) equation(s) of the form name = value
none
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.
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.
Linking to a MapleSim model (located in .msim file):
A≔MapleSim:-LinkModel⁡filename=cat⁡kernelopts⁡toolboxdir=MapleSim,/data/examples/RLCcircuit.msim:
Getting the substitutions that are applied to variable and parameter names in other API function calls:
A:-GetSubstitutions⁡
Main.RLC.C=C,Main.RLC.C1.i=C1_i,Main.RLC.C1.n.i=C1_n_i,Main.RLC.C1.n.v=C1_n_v,Main.RLC.C1.p.i=C1_p_i,Main.RLC.C1.p.v=C1_p_v,Main.RLC.C1.v=C1_v,Main.RLC.G2.p.i=G2_p_i,Main.RLC.G2.p.v=G2_p_v,Main.RLC.I1.i=I1_i,Main.RLC.I1.n.i=I1_n_i,Main.RLC.I1.n.v=I1_n_v,Main.RLC.I1.p.i=I1_p_i,Main.RLC.I1.p.v=I1_p_v,Main.RLC.I1.v=I1_v,Main.RLC.L=L,Main.RLC.NP1.i=NP1_i,Main.RLC.NP1.v=NP1_v,Main.RLC.NP2.i=NP2_i,Main.RLC.NP2.v=NP2_v,Main.RLC.PP1.i=PP1_i,Main.RLC.PP1.v=PP1_v,Main.RLC.PP2.i=PP2_i,Main.RLC.PP2.v=PP2_v,Main.RLC.PP3.i=PP3_i,Main.RLC.PP3.v=PP3_v,Main.RLC.PS1.y=PS1_y,Main.RLC.R=R,Main.RLC.R1.T=T,Main.RLC.R1.i=R1_i,Main.RLC.R1.n.i=R1_n_i,Main.RLC.R1.n.v=R1_n_v,Main.RLC.R1.p.i=R1_p_i,Main.RLC.R1.p.v=R1_p_v,Main.RLC.R1.v=R1_v,Main.RLC.SC1.i=SC1_i,Main.RLC.SC1.v=SC1_v,Main.S1.f=S1_f,Main.S1.offset=S1_offset,Main.S1.phase=S1_phase,Main.S1.y=S1_y,Main.Probe1.Vout=Vout,Main.RLC.InputSignal=InputSignal,Main.RLC.OutputSignal=OutputSignal,Main.RLC.PS1.p.i=PS1_p_i,Main.RLC.PS1.p.v=PS1_p_v,Main.RLC.R1.LossPower=R1_LossPower,Main.RLC.R1.R_actual=R1_R_actual,Main.RLC.R1.T_heatPort=R1_T_heatPort,Main.RLC.R1.T_ref=T,Main.RLC.R1.alpha=R1_alpha,Main.RLC.SC1.n.i=SC1_n_i,Main.RLC.SC1.n.v=SC1_n_v,Main.RLC.SC1.p.i=SC1_p_i,Main.RLC.SC1.p.v=SC1_p_v,Main.S1.amplitude=S1_amplitude,Main.S1.startTime=S1_startTime
Setting the default variable and parameter substitution:
A:-SetSubstitutions⁡`Main.RLC.C`=C_new
Getting the new set of substitutions:
Main.RLC.C=C_new,Main.RLC.C1.i=C1_i,Main.RLC.C1.n.i=C1_n_i,Main.RLC.C1.n.v=C1_n_v,Main.RLC.C1.p.i=C1_p_i,Main.RLC.C1.p.v=C1_p_v,Main.RLC.C1.v=C1_v,Main.RLC.G2.p.i=G2_p_i,Main.RLC.G2.p.v=G2_p_v,Main.RLC.I1.i=I1_i,Main.RLC.I1.n.i=I1_n_i,Main.RLC.I1.n.v=I1_n_v,Main.RLC.I1.p.i=I1_p_i,Main.RLC.I1.p.v=I1_p_v,Main.RLC.I1.v=I1_v,Main.RLC.L=L,Main.RLC.NP1.i=NP1_i,Main.RLC.NP1.v=NP1_v,Main.RLC.NP2.i=NP2_i,Main.RLC.NP2.v=NP2_v,Main.RLC.PP1.i=PP1_i,Main.RLC.PP1.v=PP1_v,Main.RLC.PP2.i=PP2_i,Main.RLC.PP2.v=PP2_v,Main.RLC.PP3.i=PP3_i,Main.RLC.PP3.v=PP3_v,Main.RLC.PS1.y=PS1_y,Main.RLC.R=R,Main.RLC.R1.T=T,Main.RLC.R1.i=R1_i,Main.RLC.R1.n.i=R1_n_i,Main.RLC.R1.n.v=R1_n_v,Main.RLC.R1.p.i=R1_p_i,Main.RLC.R1.p.v=R1_p_v,Main.RLC.R1.v=R1_v,Main.RLC.SC1.i=SC1_i,Main.RLC.SC1.v=SC1_v,Main.S1.f=S1_f,Main.S1.offset=S1_offset,Main.S1.phase=S1_phase,Main.S1.y=S1_y,Main.Probe1.Vout=Vout,Main.RLC.InputSignal=InputSignal,Main.RLC.OutputSignal=OutputSignal,Main.RLC.PS1.p.i=PS1_p_i,Main.RLC.PS1.p.v=PS1_p_v,Main.RLC.R1.LossPower=R1_LossPower,Main.RLC.R1.R_actual=R1_R_actual,Main.RLC.R1.T_heatPort=R1_T_heatPort,Main.RLC.R1.T_ref=T,Main.RLC.R1.alpha=R1_alpha,Main.RLC.SC1.n.i=SC1_n_i,Main.RLC.SC1.n.v=SC1_n_v,Main.RLC.SC1.p.i=SC1_p_i,Main.RLC.SC1.p.v=SC1_p_v,Main.S1.amplitude=S1_amplitude,Main.S1.startTime=S1_startTime
Resetting the set of substitutions:
A:-SetSubstitutions⁡∅,forcereset
Checking that the substitutions were reset:
See Also
MapleSim
MapleSim[LinkModel]
MapleSim[LinkModel][GetSubstitutions]
Download Help Document