Home > Back-end >  TT TT request help
TT TT request help

Time:12-01

H=0.5;
F=the inline (' 5 * exp (2 * x). * sin (x) - + 2 * 2 * y z ', 'x', 'y', 'z');
X=0-0. ";
Y1 (x)=ones (1, length (x));
Y1 (1)=2;
Y2=y1;
Y3=y1;
Z1=ones (1, length (x));
Z1 (1)=3;
Z2=z1;
Z3=z1;
For k=1: length (x) - 1
Z1 (k + 1)=z1 (k) + h * f (x (k), y1 (k), z1 (k));
Y1 (k + 1)=y1 z1 (k) (k) + h *;
Z2 (k + 1)=z2 + h/2 * (k) (f (x (k), y2 (k) and z2 (k)) + f (x (k + 1), y1 (k + 1), z1 (k + 1)));
Y2=y2 (k) (k + 1) + h/2 * (f (x (k), y2 (k) and z2 (k)) + f (x (k + 1), y1 (k + 1), z1 (k + 1)));
K1=f (x (k), y3 (k), z3 (k));
K2=f (x (k) + h/2, y3 + h (k)/2 * K1, z3 (k) + h/2 x K1);
K3=f (x (k) + h/2, y3 (k) + h/2 * K2, z3 (k) + h/2 * K2);
K4=f (x (k) + h, y3 (k) + h * K3, z3 + h * K3);
Z3 (k + 1)=z3 (k) + h * (K1 + 2 * K2 + 2 * K3, K4)/6.
K1 K1=z3 (k) + h *;
K2=z3 (k) + h/2 * K2.
K3=z3 (k) + h/2 * K3;
K4=z3 (k) + h * K4;
Y3 (k + 1)=y3 (k) + h * (K1 + 2 * K2 + 2 * K3, K4)/6.
End
The plot (x1, y1, 'r *, x2, y2, k., x3, y3,' + ')
Legend (' euler, improved euler, 'fourth order runge kutta classic');
Hold on
Subscript indices must be positive integer types or logical type,


This exactly what to do ah small white what won't TT TT
  • Related