How are parallel with ode45

Hi friends. i trying reduce execution time for my code ( system - differential equations ) by using parallel .
what are steps .... thanks in advance .
rows=1024;
cols=1024;
% interval=(rows*cols)/100;
interval=linspace(0,1,rows*cols);
[T,res]=ode45(@odefun,interval,[0.5;.4;.2]);%[0.5;.4;.2]);
% plot(T,res(:,1),T,res(:,2),T,res(:,3))
% legend('X','Y','Z')
k1=res(:,1);
k2=res(:,2);
k3=res(:,3);
function D=odefun(t,X)
x0=X(1);
y0=X(2);
z0=X(3);
a=35;
b=1.3;
c=3;
d=8;
e=10;
f=2;
g=5;
h=0.5;
x1=a*(y0-x0)+b*y0*z0;
y1=-c*x0*z0+d*y0+e*x0;
z1=f*x0*y0-g*z0+h*x0;
D=[x1;y1;z1];
end

2 comentarios

James Tursa
James Tursa el 12 de Nov. de 2020
Editada: James Tursa el 12 de Nov. de 2020
Numeric solvers such as ode45( ) rely on calculating the derivatives with the current state. This must be done in a sequential stepping process because the future estimated state at the next step depends on the estimated solution at the current step. You can't run any future steps in parallel because they depend on the estimated solution being known at that future time, and you don't have that.
omar A.alghafoor
omar A.alghafoor el 23 de Nov. de 2020
thank you

Iniciar sesión para comentar.

Respuestas (1)

Ameer Hamza
Ameer Hamza el 12 de Nov. de 2020

0 votos

MATLAB's ODE solvers do not support parallel processing capability.

Productos

Versión

R2019a

Preguntada:

el 12 de Nov. de 2020

Comentada:

el 23 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by