Introduction au Calcul Scientifique
ESI CS 1402 - Printemps 2010
Calculs faits avec Maple dans le chapitre I
> | n:=9; x[1]:=20; x[2]:=40; x[3]:=60; x[4]:=80; x[5]:=100; x[6]:=120; x[7]:=140; x[8]:=160; x[9]:=180; y[1]:=210; y[2]:=170; y[3]:=155; y[4]:=160; y[5]:=175; y[6]:=205; y[7]:=245; y[8]:=300; y[9]:=360; |
> | F := unapply(sum((y[i]-a*x[i]-b)^2, i = 1 .. n), [a, b]); |
> | simplify(F(a,b)); |
> | plot3d(F(a, b), a = 0..2, b = -100..300, view = 0..100000, axes = BOXED); |
> | solve({(D[1](F))(a,b)=0, (D[2](F))(a,b)= 0}, {a,b}); |