Euler's Method

Calculus Level 5

Given the differential equation d y d x = y e π x \frac{dy}{dx} = ye^{\pi x} determine an estimate for the value of y ( 1 ) y(1) given that y ( 0 ) = 3 y(0) = 3 . Use Euler's method to determine your estimate, with a stepsize of 0.2 0.2 . If your estimate is equal to E E , the solution to this question will be E \lfloor E \rfloor .


The answer is 67.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Here is some Mathematica Code:

euler[f_, {x_, x0_, xn_}, {y_, y0_}, steps_] := 
 Block[{xold = x0, yold = y0, sollist = {{x0, y0}}, x, y, h}, 
  h = N[(xn - x0)/steps];
  Do[xnew = xold + h;
   ynew = yold + h*(f /. {x -> xold, y -> yold});
   sollist = Append[sollist, {xnew, ynew}];
   xold = xnew;
   yold = ynew, {steps}];
  Return[sollist]]

Because stepsize is 0.2. The number of steps is ( 1 0 ) 0.2 = 5 \frac{(1-0)}{0.2}=\boxed{5}

Key in this:

euler[y E^(\[Pi] x), {x, 0, 1}, {y, 3}, 5]

You will get:

{{0, 3}, {0.2, 3.6}, {0.4, 4.94961}, {0.6, 8.42778}, {0.8, 
  19.529}, {1., 67.7471}}

So, the value of y at 1 is 67.7471

Nguyen Thanh Long
May 25, 2014

Apply Euler method: y ( t + h ) = y ( t ) + h × y ( t ) × f ( t ) y ( 0.2 × k ) = y ( 0.2 × ( k 1 ) ) × [ 1 + 0.2 × e 0.2 × π ] y(t+h)=y(t)+h \times y(t) \times f'(t) \Rightarrow y(0.2 \times k)=y(0.2 \times (k-1)) \times [1+0.2 \times e^{0.2 \times \pi}] y ( 0.2 ) = 3.6 \Rightarrow y(0.2)=3.6 y ( 0.4 ) = 3.6 × [ 1 + 0.2 e 0.2 × π ] = 4.9496 y(0.4)=3.6 \times [1+0.2 * e^{0.2 \times \pi}]=4.9496 E = y ( 1 ) = 67.747 , E = 67 E=y(1)=67.747, \lfloor E \rfloor = \boxed{67}

Sir, I haven't worked on the Euler's method ..But won't the usual method to this Problem give the solution ? y(1) = e^[(e^pi)/pi] ??

Suchit Kulkarni - 7 years ago

Log in to reply

The question requires a numeric approximation of the ordinary differential equation. Euler's method is a simple explicit method for the given numerical analysis. Your 'usual' method doesn't readily provide a numerical approximation of the differential equation. Hence you need Euler's method to obtain an answer manually.

hamlet sentit - 6 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...