How to generate a protected model which supports different solvers?

3 次查看(过去 30 天)
Is it possible to generate a protected simulink model which supports different solvers?
I would like to be able to change the solver from euler to RK4 without having to change the protected model.
Is there any way to do that?

回答(1 个)

Lokesh
Lokesh 2023-10-25
Hi Andrea,
I understand that you want to generate a protected model that supports different solvers.
It is not possible to generate a protected Simulink model that supports different solvers. When you protect a Simulink model, the protection is applied to the entire model, including its configuration settings.
Changing the solver from Euler to RK4 (or any other solver) requires modifying the solver settings within the Simulink model. This modification involves changing the solver type, step size, and other solver-specific parameters. Since the solver settings are part of the model's configuration, any changes to the solver settings would require modifying the protected model.
If you need the flexibility to change solvers, one approach is to create multiple versions of the model with different solver configurations and protect each version separately. This allows switching between protected models with different solver settings.
You can refer to the following MATLAB answer to switch between models based on solver settings:
Please refer to the following MATLAB documentation link to know more about Protected models:
I hope you find this helpful.
Best Regards,
Lokesh

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by