1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
function Xdot=F1(t,X)
printf("t=%f \n ",t)
Xdot = X/10^(-3);
endfunction
//
pas_temps=0.001;
t0=170*pas_temps;
tf=172*pas_temps;
X0=1;
Trajectoire1=ode("rkf",X0,t0,t0:pas_temps:tf,F1);
//
printf("\n \n");
function Xdot=F2(t,X)
printf("t=%f \n ",t)
Xdot = [X(1)/10^(-3);((1-t)*X(2)-X(2)^2)/(10^(-4))];
endfunction
//
pas_temps=0.001;
t0=170*pas_temps;
tf=172*pas_temps;
X0=[1;1];
Trajectoire2=ode("rkf",X0,t0,t0:pas_temps:tf,F2);
//comparaison
Dif = Trajectoire1 - Trajectoire2(1,:) |
Partager