How to change the type of step for a Simulink Solver from variable to fixed in the Electric Vehicle Thermal Management model in Simulink?
20 views (last 30 days)
Show older comments
I have tried to change the type of step the solver uses to solve the Electric Vehicle Thermal Management model found in the Simulink Examples section from variable step to fixed step and it displayed the following error message:
I have tried to tighten the error tolerances and reducing step size but the error message pups up at different timesteps.
How do I resolve this issue?
0 Comments
Answers (2)
Govind KM
on 6 Nov 2024
Hi Yash,
When running the Electric Vehicle Thermal Management example model with the solver type as variable step and the solver as auto, Simulink selects the daessc solver to run the model. This Simulink solver provides algorithms specifically designed to simulate differential algebraic equations (DAEs) arising from modeling physical systems. Switching to a fixed step solver leads to the mentioned error as a fixed step size cannot accurately capture the system dynamics. Hence, it is recommended to use the variable step daessc solver for such systems.
More details on this specific error along with debugging tips can be found in the following blog post:
Details on the daessc solver and its different modes can be found here:
Hope this is helpful!
0 Comments
Yifeng Tang
on 7 Nov 2024
When trying to run a complex Simscape in fixed-step, it is almost always recommended to use an implicit solver, as the equations from a Simscape networks is likely highly nonlinear. More particularly, I found myself using the Local Solver found in the Solver Configuration block for the Simscape part of the model most of the time.
Follow the workflow outlined here: https://www.mathworks.com/help/simscape/real-time-simulation.html The first two steps of this workflow focuses on bringing a Simscape model to fixed-step, fixed-cost capable, getting ready for HIL simulation.
Let me be clear: for complex thermo-fluids models like this EV thermal management example, it's usually way more than just playing with the solver settings. You'll likely need to adjust the model/component fidelity based on the simulation results and errors. Physical understanding of the system and understanding of the best practice of modeling using Simscape are critical in this process.
If your requirement is just fixed-step but not necessarily fixed-cost, your life may be a bit easier. You won't need to check the fixed number of nonlinear iterations in the Solver Configuration, and I've found that to help with simulation stability a lot while keeping a reasonable large time step (hence good speed).
0 Comments
See Also
Categories
Find more on Simulation Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!