Let's solve the differential equation by Eular's method. We had the initial value problem:
We'll start at the point "(x_0,y_0)=(0,1)" and use step size of "h=0.01" and proceed for 10 steps. That is, we'll approximate the solution from "t=0\\ to\\ t=0.1" for our differential equation. We'll finish with a set of points that represent the solution, numerically.
We already know the first value, when "x_0=0" which is "y_0=1" (initial value)
We now calculate the value of the derivative at this initial point. (This tells us the direction to move.)
"\\frac{dy}{dx}=f(0,1)=\\frac{-1}{1}=-1"
This means the slope of the line from t=0 to t=0.1 is approximately -1
Now, for the second step, ( Since "h=0.01", the next point is "x+h=0+0.01=0.01" ), we substitute what we know into Euler's Method formula, and we have:
"y(x+h) \\approx y(x)+hf(x,y)\\\\\ny_1 \\approx y_0+hf(x_0,y_0)\\\\\ny_1=y(0.01) \\approx 1+0.01(-1)=0.99\\\\"
This means the approximate value of the solution when "x=0.01\\ is\\ 0.99"
We'll need the new slope at this point, so we'll know where to head next.
"\\frac{dy}{dx}=f(0.01,0.99)=\\frac{-0.98}{1}=-0.98"
This means the slope of the approximation line from "x=0.01\\ to\\ x=0.02\\ is\\ -0.98". So it's a little bit steeper than the first slope we found.
Now we are trying to find the solution value when "x=0.02". We substitute our known values:
"y(x+h) \\approx y(x)+hf(x,y)\\\\\ny_2 \\approx y_1+hf(x_1,y_1)\\\\\ny_2=y(0.02) \\approx 0.99+0.01(-0.98)=0.9802\\\\"
We'll need the new slope at this point, so we'll know where to head next.
"\\frac{dy}{dx}=f(0.02,0.9802)=\\frac{-0.9602}{1.0002}=-0.96"
This means the slope of the approximation line from "x=0.02\\ to\\ x=0.03\\ is\\ -0.96". So it's a little bit steep than the first 2 slopes we found.
Now we are trying to find the solution value when "x=0.03". We substitute our known values:
"y(x+h) \\approx y(x)+hf(x,y)\\\\\ny_3 \\approx y_2+hf(x_2,y_2)\\\\\ny_3=y(0.03) \\approx 0.9802+0.01(-0.96)=0.9706\\\\"
We'll need the new slope at this point, so we'll know where to head next.
"\\frac{dy}{dx}=f(0.03,0.9706)=\\frac{-0.9406}{1.0006}=-0.94"
This means the slope of the approximation line from "x=0.03\\ to\\ x=0.04\\ is\\ -0.94". So it's a little bit steep than the first 3 slopes we found.
We continue to calculate the subsequent steps to "x=0.1"
We present all the values up to "x=0.1" in the following table.
(There's no final "\\frac{dy}{dx}" value because we don't need it. We've found all the required "y" values.)
We have obtained that the approximation at "x=0.1, \\ y=0.909"
The differential equation "\\frac{dy}{dx}=\\frac{x-y}{x+y}" at "x=0.1" is "0.909--->Answer"
Comments
Leave a comment