SetSystemModel[model,spec]
changes model parameters, initializations or other properties in place.
SetSystemModel
SetSystemModel[model,spec]
changes model parameters, initializations or other properties in place.
Details
- The model can be a SystemModel object, a full model name string or a shortened model name accepted by SystemModel.
- SetSystemModel[model,spec] takes the same arguments as SystemModel[model,spec] but modifies model in place.
Examples
open all close allBasic Examples (3)
Set the value of a parameter a in a model:
model = CreateSystemModel[StateSpaceModel[{{{a, 0}, {0, b}}, {{1, 0}, {0, 1}}, {{1, 1}}, {{0, 0}}},
SamplingPeriod -> None, SystemsModelLabels -> None]];SetSystemModel[model, <|"ParameterValues" -> {"a" -> 10}|>];The parameter value has changed in the model:
model[{"ParameterValues", "a"}]Rename a model by giving it a name:
model = CreateSystemModel[StateSpaceModel[{{{a, 0}, {0, b}}, {{1, 0}, {0, 1}}, {{1, 1}}, {{0, 0}}},
SamplingPeriod -> None, SystemsModelLabels -> None]];SetSystemModel[model, <|"ModelName" -> "MyStateSpaceModel"|>];The model now has the new name:
model["ModelName"]Enable external function evaluation in a model:
model = Import["ExampleData/ModelWithExternalFunction.mo", "MO"]Use SetSystemModel to trust external functions:
SetSystemModel[model, <|"TrustExternalFunctions" -> True|>]Simulate the model and plot the simulation results:
SystemModelPlot["ModelWithExternalFunction.MyModel", "z", 10]Properties & Relations (1)
SystemModel generates a new model with applied changes:
model = [image];model["ParameterValues"]model2 = SystemModel[model, {"a" -> 10}];{model["ParameterValues"], model2["ParameterValues"]}SetSystemModel makes changes in place:
SetSystemModel[model2, {"a" -> 14}];model2["ParameterValues"]See Also
Related Guides
Related Links
History
Text
Wolfram Research (2018), SetSystemModel, Wolfram Language function, https://reference.wolfram.com/language/ref/SetSystemModel.html.
CMS
Wolfram Language. 2018. "SetSystemModel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SetSystemModel.html.
APA
Wolfram Language. (2018). SetSystemModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetSystemModel.html
BibTeX
@misc{reference.wolfram_2026_setsystemmodel, author="Wolfram Research", title="{SetSystemModel}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/SetSystemModel.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_setsystemmodel, organization={Wolfram Research}, title={SetSystemModel}, year={2018}, url={https://reference.wolfram.com/language/ref/SetSystemModel.html}, note=[Accessed: 13-June-2026]}