Professional Documents
Culture Documents
Integration and Differentiation
Integration and Differentiation
1/8/15 3:08 PM
ODEs
1/8/15 3:08 PM
ODEs
dy/dt=f(y,t)
Order of ODE is based on the highest derivative
Ex m d2x/dx2+c dx/dt + kx = 0
y=dx/dt
m dy/dt + cy + kx =0
ex dy/dt=y
dy/y = dt # integrate
ln(y) =t+c
PDEs
d2u/dx2+d2y/dx2
Eulers Method
Dy/dt=f(t,y)
Y(t)=y(to)+(t-to)y(to) + (t-to)2/2! Y(to)++(t-to)n/n! yn(to)
Y(t)=y(to)+(t-to)f(to,yo)
Y1=yo+(t-to)f(to,yo)
Y2=y1+(t-to)f(t1,y1)
Ex Dy/dt=t-2y y(0)=1 h=.2
Y(1)=1+.2(0-2(1)) = .6
Runge Kutta
Yi+1=YI-1+(-)h
(-)=f(xi,yi)
th
4 order RK: y1+1=yi+(1/6ki+1/3k2+1/3k3+1/6k4)h
k1=f(ti,yi)
k2=f(ti+.5h, yi+.5kih)
k3=f(ti+.5h, yi+.5k2h)
k4=f(ti+h,yi+k3h)
For same function in Eulers
K1=0-2(1) = -2
K2=.1-2(1+.5(-2)(.2)) = -1.5
K3=.1-2(1+.5(-1.5)(.2))= -1.6
1/8/15 3:08 PM