06.03.2013 Views

Capitolul 1 Ecuatii diferentiale de ordinul ˆıntâi rezolvabile prin ...

Capitolul 1 Ecuatii diferentiale de ordinul ˆıntâi rezolvabile prin ...

Capitolul 1 Ecuatii diferentiale de ordinul ˆıntâi rezolvabile prin ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

138 CAPITOLUL 4<br />

> h:=0.1: n:=10:<br />

> f1:=(t,x1,x2)->-x1(t)+8*x2(t): f2:=(t,x1,x2)->x1(t)+x2(t):<br />

> t:=(n,h)->n*h:<br />

> x1:=proc(n,h);<br />

> if n=0 then x1(0) else<br />

x1(n-1,h)+h*f1(t(n-1,h),x1(n-1,h),x2(n-1,h))end if;<br />

> end proc:<br />

> x2:=proc(n,h)<br />

> if n=0 then x2(0)else<br />

x2(n-1,h)+h*f2(t(n-1,h),x1(n-1,h),x2(n-1,h))end if;<br />

> end proc:<br />

> x1(0):=1: x2(0):=1:<br />

> x1(t):=[seq(x1(i,h),i=0..n)];<br />

x1 (t) := [1, 1.7, 2.49, 3.433, 4.6001, 6.07617, 7.966249,<br />

10.4031833, 13.55708001, 17.64726322, 22.95758363]<br />

> x2(t):=[seq(x2(i,h),i=0..n)];<br />

x2 (t) := [1, 1.2, 1.49, 1.888, 2.4201, 3.12212, 4.041949,<br />

> t:=[seq(t(i,h),i=0..n)];<br />

5.2427688, 6.80736401, 8.843808412,11.49291558]<br />

t := [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]<br />

Pentru a compara valorile numerice ale solut¸iei cu cele obt¸inute<br />

<strong>prin</strong> calcul simbolic, vom calcula valorile solut¸iei obt¸inute în <strong>Capitolul</strong> 4<br />

în câteva puncte:<br />

> sol_x1:=5/3*exp(3*t)-2/3*exp(-3*t):<br />

> sol_x2:=5/6*exp(3*t)+1/6*exp(-3*t):<br />

> eval(sol_x1(t),t=0);<br />

eval(sol_x1(t),t=0.1);eval(sol_x1(t),t=0.2);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!