//TD1 2017
clear;
//Exercices 4
function f=fonc(y); 
    f=0.15*y.*(1-y/7500);
endfunction;
yy=-300:100:7800;
plot(yy,fonc(yy))

//Exercice 5
function f=fonct(t,y); 
    f=-4*y+8.5*cos(t);
endfunction;
t0=0;y0=5;//y0=0
tt=t0:0.1:2;
yy=ode(y0,t0,tt,fonct);
xset("window",2);
plot(tt,yy);

y0=5//y0=0//
y0=2
tt=t0:0.1:20;
yy=ode(y0,t0,tt,fonct);
plot(tt,yy);

// Ex:ercice 6
k=2;M=50;
function f=MonAutreEquaLin(t,y); 
    f=k*(M-y);
endfunction;
t0=0;
M=50;k=2;
tt=t0:0.1:10;
y0=20//
y0=50//y0=60;
yy=ode(y0,t0,tt,MonAutreEquaLin);
xset("window",3);
plot(tt,yy);

xset("window",4);
k=4;
function f=MonAutreEquaLin(t,y); 
    f=k*(M-y);
endfunction;
y0=20//y0=50//
y0=60;
yy=ode(y0,t0,tt,MonAutreEquaLin);
plot(tt,yy);
///////////// idem avec k=8, dans la fenêtre 5
xset("window",5);
k=8;
function f=MonAutreEquaLin(t,y); 
    f=k*(M-y);
endfunction;
y0=20//
y0=50//y0=60;
yy=ode(y0,t0,tt,MonAutreEquaLin);
plot(tt,yy);
