Clear Filters
Clear Filters

What is the best Jacobian setting for my model?

5 views (last 30 days)
Javier
Javier on 7 Feb 2017
Commented: Javier on 14 Feb 2017
Hello,
I am running a PWM model in simulink with SimScape, this is my model where I have followed the tips of Vishal in that thread, to solve the problem there mentioned.
However, I would like to improve the speed in my simulation and looking into the outcome of Solver profiler, which is shown below
I see that the Jacobian is being updated almost every time, so I would like to choose the best setting for the Jacobian, currently it is set to Auto, but I was wondering whether a better setting can be used or not.
CAn anyone enlighten me a bit in this?
Thanks in advance,
Kind regards

Answers (1)

Ankit Bhatnagar
Ankit Bhatnagar on 10 Feb 2017
For implicit solvers such as ode23t, Simulink must compute the solver Jacobian, which is a submatrix of the Jacobian matrix associated with the continuous representation of a Simulink model.
In the full perturbation method Simulink solves the full set of perturbation equations and uses LAPACK for linear algebraic operations. This method is costly from a computational standpoint, but it remains the recommended method for establishing baseline results. The sparse perturbation method attempts to improve the run-time performance by taking mathematical advantage of the sparse Jacobian pattern.
The Sparse Perturbation Method and the Sparse Analytical Method may be able to take advantage of the sparsity pattern of the matrix to reduce the number of computations necessary and improve performance.
After running the profiler for all of these, Sparse pertubration method will give you the best performance. For more details refer the documentation link on choosing the solver:
If it supports your workflow, you can also try increasing the maximum step size of the solver as suggested in the screenshot you attached.
  1 Comment
Javier
Javier on 14 Feb 2017
Thanks Ankit,
I will set the Sparse perturbation as method and check how the simulation performs.
On the other hand, I don't quite understand the suggestion of increasing the maximum step size, since If I do so ( I tried as well), then I could lack of precision right? Should I set that maximum step size as the average step size given by the profiler?
Thanks again

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!