SystemModelParametricSimulate[model,v,{p1,p2,…}]
参数为 pi,针对变量 v 仿真 model.
SystemModelParametricSimulate[model,{v1,v2,…},{p1,p2,…}]
针对多个变量 vi 仿真 model.
SystemModelParametricSimulate[model,vars,tmax,…]
从 0 到 tmax 进行仿真.
SystemModelParametricSimulate[model,vars,{tmin,tmax},…]
从 tmin 到 tmax 进行仿真.
SystemModelParametricSimulate
SystemModelParametricSimulate[model,v,{p1,p2,…}]
参数为 pi,针对变量 v 仿真 model.
SystemModelParametricSimulate[model,{v1,v2,…},{p1,p2,…}]
针对多个变量 vi 仿真 model.
SystemModelParametricSimulate[model,vars,tmax,…]
从 0 到 tmax 进行仿真.
SystemModelParametricSimulate[model,vars,{tmin,tmax},…]
从 tmin 到 tmax 进行仿真.
更多信息和选项
- SystemModelParametricSimulate 返回系统模型的参数化仿真结果.
- model 可采用以下形式:
-
SystemModel[…] 一般系统模型 StateSpaceModel[…] 状态-空间模型 TransferFunctionModel[…] 传递函数模型 AffineStateSpaceModel[…] 仿射状态-空间模型 NonlinearStateSpaceModel[…] 非线性状态-空间模型 DiscreteInputOutputModel[…] 离散输入-输出模型 - SystemModelParametricSimulate 以 ParametricFunction 对象的形式给出结果.
- SystemModelParametricSimulate 接受与 SystemModelSimulate 同样的选项.
-
InterpolationOrder Automatic 事件之间的输出的连续性程度 Method Automatic 使用何种仿真方法 ProgressReporting $ProgressReporting 控制进度显示
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (3)
sol = SystemModelParametricSimulate[[image], "z", {"a"}]z1 = sol[1]z1[10]Plot[Evaluate[Table[sol[a][t], {a, 0, 1, .1}]], {t, 0, 10}]sol = SystemModelParametricSimulate[[image], "z", {"y"}]Plot[Evaluate[Table[sol[y][t], {y, 0, 1, .1}]], {t, 0, 10}]sol = SystemModelParametricSimulate[[image], "z", {"a"}]Plot[Evaluate[(sol[a][t] + {0, .1, -.1}D[sol[a][t], a]) /. {a -> 1}], {t, 0, 10}, Filling -> {2 -> {3}}]范围 (5)
模型 (5)
获取 SystemModel 中变量的参数化解:
sol = SystemModelParametricSimulate[[image], {"x", "y"}, "theta"]ParametricPlot[Evaluate[Table[Through[sol[a][t]], {a, 0.4, 0.7, 0.1}]], {t, 0, 7}]获取 AffineStateSpaceModel 中变量的参数化解:
sol = SystemModelParametricSimulate[AffineStateSpaceModel[{{a + a*Cos[x2],
(-a)*x2 + Cos[a*x1^2]}, {{0}, {1}},
{x2}, {{0}}}, {x1, x2}, Automatic, {Automatic}, Automatic,
SamplingPeriod -> None], x1, {a}]Plot[Evaluate[Table[sol[a][t], {a, 0.01, 0.05, 0.01}]], {t, 0, 10}]获取 NonlinearStateSpaceModel 中变量的参数化解:
sol = SystemModelParametricSimulate[NonlinearStateSpaceModel[{{a*Cos[x] + 4*Sin[x/2]},
{x + Sin[x]}}, {x}, {}, {Automatic}, Automatic,
SamplingPeriod -> None], x, {a}]Plot[Evaluate[Table[sol[a][t], {a, 1, 4}]], {t, 0, 10}]获取 DiscreteInputOutputModel 中变量的参数化解:
diom = DiscreteInputOutputModel[{u[0], u[1] - a y[0], u[2] - a y[1]}, u, y]sol = SystemModelParametricSimulate[diom, y, {a}, <|"Inputs" -> {1 -> Table[Sin[t / 10], {t, 0, 30}]}|>]Plot[Evaluate[Table[sol[a][t], {a, 0.2, 1.8, 0.8}]], {t, 0, 30}]获取一个 SystemModel 中变量关于多个参数的参数化解:
sol = SystemModelParametricSimulate[[image], {"p.r[1]", "p.r[2]"}, {"k", "p.m"}]ParametricPlot[Evaluate[Flatten[Table[Through[sol[k, m][t]], {k, 10, 20, 10}, {m, 1, 2.5, 1.5}], 1]], {t, 0, 40}]选项 (1)
Method (1)
用 Method 选择基本求解器:
model = [image];dassl = SystemModelParametricSimulate[model, "z", {"a"}, Method -> "DASSL"]用 ParametricNDSolve 作为求解器:
ndsolve = SystemModelParametricSimulate[model, "z", {"a"}, Method -> "ParametricNDSolve"]通常情况下,ParametricNDSolve 比其他求解器快:
RepeatedTiming[ndsolve[1][10]]RepeatedTiming[dassl[1][10]]应用 (2)
model = \!\(\*GraphicsBox[«8»]\);distance = SystemModelParametricSimulate[model, "distance", {"releaseTime", "ropeLength"}, ProgressReporting -> False]Monitor[fittedpars = NMaximize[{distance[time, length][10], 0.1 < length < 3 && 5 < time < 6.5}, {time, length}, AccuracyGoal -> 2, PrecisionGoal -> 2], {time, length}]sim = SystemModelSimulate[model, <|"ParameterValues" -> ({"releaseTime" -> time, "ropeLength" -> length} /. fittedpars[[2]])|>]sim[{"distance"}, 10]SystemModelPlot[sim, "Trajectory"]data = Import["ExampleData/inertiaTestData.dat"];pf = SystemModelParametricSimulate[\!\(\*GraphicsBox[«8»]\), "Inertia2.w", 40, {"Resistor1.R", "SpringDamper1.d"}, ProgressReporting -> False]criteriaFun[p_ ? NumericQ, q_ ? NumericQ] := Module[{f},
f = pf[p, q];
Norm[Table[data[[i, 2]] - f[data[[i, 1]]], {i, Length[data]}]]^2
]fittedpars = FindMinimum[criteriaFun[p, q], {{p, 0.1}, {q, 0.25}}, StepMonitor :> PrintTemporary[{p, q}]]sol = pf[p, q] /. fittedpars[[2]];Show[Plot[sol[t], {t, 0, 40}, PlotStyle -> Orange], ListPlot[data]]属性和关系 (1)
SystemModelSimulateSensitivity 可用来轻松计算参数灵敏度:
sim = SystemModelSimulateSensitivity[[image], 5, {"a"}];SystemModelPlot[sim, {{"y", "a", 0.1}, {"z", "a", 0.1}}]相关链接
文本
Wolfram Research (2018),SystemModelParametricSimulate,Wolfram 语言函数,https://reference.wolfram.com/language/ref/SystemModelParametricSimulate.html (更新于 2022 年).
CMS
Wolfram 语言. 2018. "SystemModelParametricSimulate." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2022. https://reference.wolfram.com/language/ref/SystemModelParametricSimulate.html.
APA
Wolfram 语言. (2018). SystemModelParametricSimulate. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/SystemModelParametricSimulate.html 年
BibTeX
@misc{reference.wolfram_2026_systemmodelparametricsimulate, author="Wolfram Research", title="{SystemModelParametricSimulate}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/SystemModelParametricSimulate.html}", note=[Accessed: 25-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_systemmodelparametricsimulate, organization={Wolfram Research}, title={SystemModelParametricSimulate}, year={2022}, url={https://reference.wolfram.com/language/ref/SystemModelParametricSimulate.html}, note=[Accessed: 25-November-2026]}