Question regarding ode15s

1 visualización (últimos 30 días)
Deepa Maheshvare
Deepa Maheshvare el 14 de Nov. de 2020
Respondida: Kiran Felix Robert el 16 de Dic. de 2020
Hello Everyone,
I'm simulating a system of stiff differential equations of the form using ode15s
Y'= (1./Vector1).*(Matrix1*Y+Matrix2*Y)
Z'= (1./Vector1).*(Matrix1*Z+Matrix2*Z) % the matrix diff eqn for each variable Y, Z is created in a for loop
The vector Y,Z is of size ~1200 and the number of differential equations is ~2400
The total simulation time takes around 570s when
odeset('abstol', 1e-10, 'reltol', 1e-9)
is used for error settings and it reduces by 5 times when the default error settings are used.
I tried to use the profiler and the ode solver takes around 508 s (snapshot ).
I'd like to know if I can speed up the compute time taken by the ode solver. Could someone clarify if the ode solver calls BLAS functions for Matrix operations? I'm using version 2019b
I would be happy to share addional details if the problem explained above isn't clear enough.
  2 comentarios
Ameer Hamza
Ameer Hamza el 14 de Nov. de 2020
Have you tried ode45()?
Deepa Maheshvare
Deepa Maheshvare el 14 de Nov. de 2020
Hi, my equations are stiff so I tried using ode15s.

Iniciar sesión para comentar.

Respuestas (1)

Kiran Felix Robert
Kiran Felix Robert el 16 de Dic. de 2020
Hi Deepa,
The ode15 solver is slow for your specific error tolerances when compared to the default setting because the constraints set by you (1e-10 & 1e-9) are more strict when compared to the default values(1e-3 & 1e-6) .
Please check the odeset documentation for the default values.
To improve the solver speed you can try the following
  1. Increase the error tolerances ( say increase the tolerances to 1e-2 & 1e-3).
  2. Provide the Jacobian explicitly using the ‘Jacobian’ parameter of the ‘odeset’
Kiran Felix Robert

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by