Maximum step size for variable

您所在的位置:网站首页 simulink中步长怎么设置 Maximum step size for variable

Maximum step size for variable

2024-02-26 23:06| 来源: 网络整理| 查看: 265

Open Live Script

Open the model vdp.

mdl = "vdp"; open_system(mdl)

To allow the software to select the solver to use for the model, specify the Type parameter as Fixed-step or Variable-step, and set the Solver parameter to auto. For this example, configure the software to select a variable-step solver for the model.

To open the Configuration Parameters dialog box, on the Modeling tab, click Model Settings.

On the Solver pane, set the solver Type to Variable-step and the Solver parameter to auto (Automatic solver selection).

Click OK.

Alternatively, use the set_param function to set the parameter values programmatically.

set_param(mdl,"SolverType","Variable-step", ... "SolverName","VariableStepAuto")

Simulate the model. On the Simulation tab, click Run. Alternatively, use the sim function.

out = sim(mdl);

As part of initializing the simulation, the software analyzes the model to select the solver. The status bar on the bottom of the Simulink Editor indicates the selected solver on the right. For this model, the software selects the ode45 solver.

To view more information about the selected solver parameters, click the text in the status bar that indicates the selected solver. The Solver Information menu shows the selected solver and the selected value for the Max step size parameter. For this simulation, the solver uses a maximum step size of 0.4.

If you want to lock down the solver selection and maximum step size, explicitly specify the solver parameter values. In the Solver information menu, click Accept suggested settings .

Alternatively, you can use the set_param function to specify the parameter values programmatically.

set_param(mdl,"SolverName","ode45","MaxStep","0.4")

After you explicitly specify the parameter values, the solver information in the status bar and Solver information menu no longer indicate that the parameter values are automatically selected.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3