Performance Problem in Simulink (why is it slower than matlab?)
5 views (last 30 days)
Show older comments
I have compared Solutions to the same ODE in matlab and simulink. Simulink took 7.6 sec. while ode15s in matlab took 1.4 sec. to solve. What is the reason for this time difference? FYI: I used the same number of time steps in both cases. And simulink model was run from matlab, using 'sim' function.
Answers (1)
Steven Lord
on 10 Apr 2018
Which solver did you use when you simulated your system? Did you leave the selection up to Simulink?
The ode15s solver in MATLAB is a stiff solver while ode45 is not. So if your simulation used ode45, to compare apples and apples you'd want to compare that with solving the system in MATLAB using ode45 (or switch both to use a stiff solver.)
1 Comment
See Also
Categories
Find more on Ordinary Differential Equations 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!