Sundials Solver in MATLAB/Simulink

4 visualizzazioni (ultimi 30 giorni)
I noticed that the Sundials solver is implemented and and used someplaces in Simulink and MATLAB. I often run into problem formation that is Differential Algebraic Equations rather than Ordinary Differential Equations. I would like to experiment with the Sundials solvers however I can only find access to Sundials in SimBiology. Is there any chance that this solver will be available generally in Simulink and Matlab sometime in the future?
  3 Commenti
Arthur Goldsipe
Arthur Goldsipe il 23 Feb 2017
Hi Sam, please see the answer I just posted below.
Jason Nicholson
Jason Nicholson il 23 Feb 2017
Modificato: Jason Nicholson il 21 Mar 2018
Sam N. No I have not. I think the lack of answer is my answer: No, no support for Sundials in Simulink.
An old interface to Sundials has been written and is linked below. https://searchworks.stanford.edu/view/11143449
I don't plan on trying to connect into Sundials anytime soon. I think it is bit beyond my understanding. My key issues have to do with speed and complexity of models for large scale modeling. Large to me means building system on top of system on top of system. Where each level introduces 10-30 states of very stiff, often DAE, numerical ill-posed problems. My various states may be of the size 0.001 and then another state is 1e8 at the same time step. This state "size" combined with zero crossings, DAE's, absolute tolerances, inherent numerical stiffness, and non-smoothness seem to cause the simulations to be slow. I have work to better pose the problem. That is where I will focus rather than focusing on implementing an interface to Sundials.

Accedi per commentare.

Risposta accettata

Jason Nicholson
Jason Nicholson il 21 Mar 2018
Modificato: Jason Nicholson il 9 Apr 2018
Support for Sundials is limited in SimBiology. There is no hint that this will be more broadly available anytime soon.
Hint and tips:
  • Use the Simscape modeling language to define DAE's of problems in a way that MATLAB/Simulink can better understand and reformulate the DAE for solving. For instance, SimMechanics is optimized to deal with Index 3 DAE's that arise in rigid motion of multiple bodies moving together. There is no need to algebraically remove the constraints.
  • If you must work in Simulink, then add states with known dynamics in places that have the algebraic states. For instance, replace an algebraic state with a first order transfer function with 10-1000 times faster dynamics than the rest of the model. This adds stiffness to the ODE system but the DAE already added stiffness in the first place. Choosing the dynamics so they are just faster than the rest of the system will allow the model to run reasonably while minimizing solver performance penalties because of added stiffness.

Più risposte (2)

Arthur Goldsipe
Arthur Goldsipe il 23 Feb 2017
If your goal is to solve differential algebraic equations, you can already do that using the ODE solvers provided with MATLAB. Here's an example.
  1 Commento
Jason Nicholson
Jason Nicholson il 23 Feb 2017
Modificato: Jason Nicholson il 23 Feb 2017
I am aware of this. it does not answer my question.
Notes: You can solve explicit form index 1 DAE's in MATLAB/Simulink.

Accedi per commentare.


mona aljeagdaf
mona aljeagdaf il 7 Ott 2018
I have a problem choosing the type of solver in Simulink. Whenever I want to run the model does not work and ask me to change the type and variables of solver or ode and I have other frequently without reaching the solution please help
  2 Commenti
Jason Nicholson
Jason Nicholson il 8 Ott 2018
Modificato: Jason Nicholson il 8 Ott 2018
Mona, I would call Mathworks about your question. I think your post here off topic and resurrecting this without further information.
Thanks.
-Jason
mona aljeagdaf
mona aljeagdaf il 10 Ott 2018
I'm very sorry ... I thought it was possible for you to answer

Accedi per commentare.

Categorie

Scopri di più su Model Statistics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by