questions is:
>> -d/dx(e^x y') + 2ye^x = (2-x)e^x
i need to simplify the equation to show that the finite difference method is given by:
>> -(2-h)yi-1 +4(1+h^2)yi -(2+h)yi+1 = 2h^2(2-xi)
I no how to apple the finite difference method so i get the difference equation to get the above but what is:
>> -d/dx(e^x y') + 2ye^x = (2-x)e^x
simplified so it is in the form containing y'' and y'?
After using the finite difference method I have solved the system using back substitution in matrix form to get:
-(2-h)yi-1 + 4(1+h^2)yi -(2+h)yi+1=2h^2(2-xi) as the difference equation. And using h=0.2 and working to 4dp i got the solutions as:
y1=0.4564
y2=0.1503
y3=0.3862
How do i use this information to show that the analytical solution is: y=-0.6925e^-2x -0.0575e^x +0.75
You are given the following two point boundary value problem:
>> -d/dx(e^x y') + 2ye^x = (2-x)e^x where y(0)=y(1)=0
Simplify the equation and show that the resulting difference equation is (below) when the finite difference method is applied:
>> -(2-h)yi-1 + 4(1+h^2)yi -(2+h)yi+1=2h^2(2-xi)
Take h=0.2 and determine the approximate solution?
I got the approximate solution as:
y1=0.4564
y2=0.1503
y3=0.3862
Show that the analytical solution is:
>> y=-0.6925e^-2x -0.0575e^x +0.75
And hence show the errors in your numerical approximation.
I assume y1 is the approximation to , y2 to , y3 to , you should also give the next value and for that matter include the boundary points as well.
You just have to show that this solution satisfies the original equation, or its simplified form:Show that the analytical solution is:
>> y=-0.6925e^-2x -0.0575e^x +0.75
And hence show the errors in your numerical approximation.
by differentiating twice and substituting into the equation. Then comparing the exact solution at with your numerical solution.
.