Linearne Diferencijalne Jednadžbe, Book4

You might also like

Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 2

Differential Equation is y''+y' = x*y or y'' =x*y- y'

Numerical solution by Runga-Kutte method follows

h= x(1)-x(0)= 0.1000
x(0)= Initial condition (given) 0.0000
y(0)= Initial condition (given) 1.0000
y'(0)= Initial condition (given) -1.0000

L(1)= h*y'(0)= -0.1


L'(1)= h*f(x(0),y(0),y'(0))= 0.1
L(2)= h*f[x(0),y(0),y'(0)]= -0.095
L'(2)= h*f[x(0)+0.5*h,y(0)+0.5*L(1),y'(0)+0.5*L(1)]= 0.09975
L(3)= h*(y'(0)+2*L'(2)-L'(1))= -0.09005
L'(3)= h*f(x(0)+h,y(0)+2*L(2)-L(1),y'(0)+2*L'(2)-L'(1))= 0.09915

y(1)= y(0)+(L(1)+4*L(2)+L(3)/6)= 0.90499


y'(1)= y'(0)+(L'(1)+4*L'(2)+L'(3)/6)= -0.900308

h= x(1)-x(0)= 0.1000
x(0.1)= Neht value x(0)+h= 0.1000
y(1)= From previous computation 0.09915
y'(1)= From previous computation -0.9003

L(1)= h*y'(1)= -0.090031


L'(1)= h*f(x(1),y(1),y'(1))= 0.099081
L(2)= h*f[y'(1)+0.5*L'(1)]= -0.085077
L'(2)= h*f[x(1)+0.5*h,y(1)+0.5*L(1),y'(1)+0.5*L(1)]= 0.097976
L(3)= h*(y'(1)+2*L'(2)-L'(1))= -0.080344
L'(3)= h*f(x(1)+h,y(1)+2*L(2)-L(1),y'(1)+2*L'(2)-L'(1))= 0.096841

y(2)= y(1)+(L(1)+4*L(2)+L(3)/6)= 0.819878


y'(2)= y'(1)+(L'(1)+4*L'(2)+L'(3)/6)= -0.802337

h= x(1)-x(0)= 0.1000
x(0.2)= Neht value x(0)+2*h= 0.2000
y(2)= From previous computation 0.819878
y'(2)= From previous computation -0.802337

L(1)= h*y'(2)= -0.080234


L'(1)= h*f(x(2),y(2),y'(2))= 0.096631
L(2)= h*f[y'(2)+0.5*L'(1)]= -0.075402
L'(2)= h*f[x(2)+0.5*h,y(2)+0.5*L(1),y'(2)+0.5*L '(1)]= 0.094896
L(3)= h*(y'(1)+2*L'(2)-L'(1))= -0.070918
L'(3)= h*f(x(2)+h,y(2)+2*L(2)-L(1),y'(2)+2*L'(2)-L'(1))= 0.093397

y(3)= y(2)+(L(1)+4*L(2)+L(3)/6)= 0.744418


y'(3)= y'(2)+(L'(1)+4*L'(2)+L'(3)/6)= -0.707402
h= x(1)-x(0)= 0.1
x(0.2)= Neht value x(0)+2*h= 0.3
y(2)= From previous computation 0.744418
y'(2)= From previous computation -0.707402

L(1)= h*y'(2)= -0.07074


L'(1)= h*f(x(2),y(2),y'(2))= 0.093073
L'(2)= h*f[y'(2)+0.5*L'(1)]= 0.090903
L(2)= h*f[x(2)+0.5*h,y(2)+0.5*L(1),y'(2)+0.5*L '(1)]= -0.066087
L(3)= h*(y'(1)+2*L'(2)-L'(1))= -0.061867
L'(3)= h*f(x(2)+h,y(2)+2*L(2)-L(1),y'(2)+2*L'(2)-L'(1))= 0.089186

y(4)= y(2)+(L(1)+4*L(2)+L(3)/6)= 0.678259


y'(3)= y'(2)+(L'(1)+4*L'(2)+L'(3)/6)= -0.616423

You might also like