How to generate a protected model which supports different solvers?

5 views (last 30 days)
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?

Answers (1)

Lokesh
Lokesh on 25 Oct 2023
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

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!