0
8.2kviews
Solve the equation $\frac{dy}{dx}={1-x}$ given y(0)=0 using modified Euler's method & tabulate the solution at x=0.1,0.2& 0.3 . Compare your results with exact solution.
1 Answer
0
741views

Step (i)

$ f(x,y)=1-y\,,x_0=0,\,y_0=0,\,h=0.1 $

$ x_1=x_0+h=0+0.1=0.1 \\ $

$ y_1=y_0+h*f(x_0,y_0)=0+0.1*1=0.1 \\ $

$ y_1^{(1)}=y_0 +\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1)] = 0+ \frac{0.1}{2} [f(0,0)+f(0.1,0.1)]=0.095 $

$y_1^{(2)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1^{(1)})] $

$= 0+\frac{0.1}{2}[f(0,0)+f(0.1,0.095)]=0.09525 $

$y_1^{(3)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1^{(2)})] $

$= 0+\frac{0.1}{2}[f(0,0)+f(0.1,0.09525)]=0.09523 $

when $,\,\,x_1=0.1,\,\,y_0=0.095 $

Step (ii)

$,x_0=0.1,y_0=0.095 $

$,x_1=x_0+h=0.1+0.1=0.2 $

$y_1=y_0+hf(x_0,y_0)=0.095+0.1*f(0.1,0.095)=0.1855 $

$y_1^{(1)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1)] $

$=0.095+\frac{0.1}{2}[f(0.1,0.095)+f(0.2,0.1855)]=0.1809 $

$y_1^{(2)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1^{(1)})] $

$= 0.095+\frac{0.1}{2}[f(0.1,0.095)+f(0.2,0.1809)]=0.1812$

$y_1^{(3)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1^{(2)})] $

$= 0.095+\frac{0.1}{2}[f(0.1,0.095)+f(0.2,0.1812)]=0.1812 $

when,x=0.2,y=0.1812

Step (iii)

$,x_0=0.2,y_0=0.1812 $

$x_1=x_0+h=0.2+0.1=0.3 $

$y_1=y_0+hf(x_0,y_0)=0.1812+0.1*f(0.2,0.1812)=0.26308$

$y_1^{(1)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1)]$

$=0.1812+\frac{0.1}{2}[f(0.2,0.1812)+f(0.3,0.26308)]=0.2589$

$y_1^{(2)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1^{(1)})]$

$= 0.1812+\frac{0.1}{2}[f(0.2,0.1812)+f(0.3,0.2589)]=0.2591 $

$y_1^{(3)}=y_0+\frac{h}{2}[f(x_0,y_0)+f(x_1,y_1^{(2)})]$

$= 0.1812+\frac{0.1}{2}$

$[f(0.2,0.1812)+f(0.3,0.2591)]=0.2591$

when,

$x=0.3,y=0.2591 $

Exact Value,

$\hspace{1cm}\frac{dy}{dx}=1-y\,=\gt\,\frac{dy}{dx}+y=1$

It is of form

$\frac{dy}{dx}+Py=Q$ with

$P=1,Q=1$

$e^{\int_{}{}pdx}=e^x $

Solution is

$y*e^x=\int{}{}1*e^x\,dx=e^x+c $

$ x=0,y=0,c=-1 $

$\therefore ye^x=e^x-1$

Please log in to add an answer.