 #1
chwala
Gold Member
 2,216
 286
 TL;DR Summary

Kindly see the reference below;
https://math.libretexts.org/Courses/Monroe_Community_College/MTH_225_Differential_Equations/3%3A_Numerical_Methods/3.1%3A_Euler's_Method
My interest is on Example 3.1.1
How did they determine the initial condition ##y(0)=1##or is it picked out of convenience? why not ##y(0)=0.95## or ##y(0)=0.99##
The Euler method is straightforward to me; i.e ##y_{n+1}=y_n+ hf(t_0, y_0)## where the smaller the steps i.e ##h## size the better the approximation.
My question is 'how does one go about in determining the initial condition ##y(0)=1## in this problem? am assuming that this has to be a point on the line.
Assuming that i had this other problem; using it to elaborate my point,
##\dfrac{dy}{dt}=y## and given ##y(0)=1##
then in this case if i am to find ##y(t)## (using separation of variables) then the Exact solution is,
##y(t)=e^{t + k}## and when ##x=0, y=1 ⇒k=0##.
The exact value at ##t=4## is given by,
##y(4)=e^4≈54.598## on the other hand
Euler method (Numerical method) with step size ##h=0.0125## will give us,
##y=53.26##
...In this case,the initial condition, ##y(0)=1## makes sense to me as ##(0,1)## is a point on the curve. I hope that i am clear on my argument.
On the flip side, i attempted to find;
##f(x,y)## of the function
##\dfrac{dy}{dx}+2y=x^3e^{2x}##
and i ended up with;
##f(x,y)=ye^{2x}\dfrac{x^4}{4} + y^2e^{2x}x^3ye^{2x}y##
i am not sure whether its correct...still checking then i can post all my working. Cheers
My question is 'how does one go about in determining the initial condition ##y(0)=1## in this problem? am assuming that this has to be a point on the line.
Assuming that i had this other problem; using it to elaborate my point,
##\dfrac{dy}{dt}=y## and given ##y(0)=1##
then in this case if i am to find ##y(t)## (using separation of variables) then the Exact solution is,
##y(t)=e^{t + k}## and when ##x=0, y=1 ⇒k=0##.
The exact value at ##t=4## is given by,
##y(4)=e^4≈54.598## on the other hand
Euler method (Numerical method) with step size ##h=0.0125## will give us,
##y=53.26##
...In this case,the initial condition, ##y(0)=1## makes sense to me as ##(0,1)## is a point on the curve. I hope that i am clear on my argument.
On the flip side, i attempted to find;
##f(x,y)## of the function
##\dfrac{dy}{dx}+2y=x^3e^{2x}##
and i ended up with;
##f(x,y)=ye^{2x}\dfrac{x^4}{4} + y^2e^{2x}x^3ye^{2x}y##
i am not sure whether its correct...still checking then i can post all my working. Cheers
Last edited: