Newton's Method, Euler's Method, and Modeling Dynamical Systems

Yadu Chittampalli

Improved Euler's Method

\[ x_{n+1}^{*}=x_n+hf\left( t_n,x_n,y_n\right) \]

\[ y_{n+1}^{*}=y_n+hg\left( t_n,x_n,y_n\right) \]

\[ t_{n+1}=t_n+h \]

\[ x_{n+1}=x_n+0.5h\left[f\left( t_n,x_n,y_n\right) +f\left( t_{n+1},x_{n+1}^{*},y_{n+1}^{*}\right) \right] \]

\[ y_{n+1}=y_n+0.5h\left[g\left( t_n,x_n,y_n\right) +g\left(t_{n+1},x_{n+1}^{*},y_{n+1}^{*}\right) \right] \]

\[ \frac{dx}{dt} = f\left( t_n,x_n,y_n\right) = x - xy - 0.75y \] \[ \frac{dy}{dt} = g\left( t_n,x_n,y_n\right) = xy - y - 0.75x \]

Improved Euler's Method

plot of chunk unnamed-chunk-1

  • All trajectories are diagonal straight lines.

  • Disregard the trajectory for step size 1.

Improved Euler's Method Exception (Step Size 1)

plot of chunk unnamed-chunk-2

  • x decreases as y increases.

  • The trajectory almost looks like that of the Euler's method. Only difference is that there is no steep drop to begin with.

Euler's Method

plot of chunk unnamed-chunk-3

  • Smoother trajectory for lower step sizes.

Improved Euler's Method vs. Euler's Method

  • The improved Euler's method displays divergence for step sizes less than 1.

  • The trajectories for the improved Euler's method are a straight diagonal line, whereas for the Euler's method, the trajectories are more curved.

Newton's Method

\[ x_{k+1}=x_k - \frac{f^\prime \left( x_k \right)}{f^{\prime \prime} \left( x_k \right) } \]

\[ \epsilon = tolerance \]

\[ \mid x_{k+1} - x_k \mid < \epsilon \]

\[ \mid f^\prime \left( x_k \right) \mid < \epsilon \]

Keep on reiterating until one of the two conditions listed above is met.

Two Different Functions (Piecewise Function and Quadratic Function)

\[ \left\{ \begin{array}{ll} 4x^{3} - 3x^{4} & x > 0 \\ 4x^{3} + 3x^{4} & x < 0 \\ \end{array} \right. \]

\[ \left\{ \begin{array}{ll} x^{2} + 2x & 3\leq x\leq 6 \\ \end{array} \right. \]

Newton's Method (How the Tolerance Affects Convergence of a Quadratic)

plot of chunk unnamed-chunk-4

  • For each tolerance convergence occurs at approximately -1.

Newton's Method (How the Tolerance Affects Convergence of a Piecewise at 0.4)

plot of chunk unnamed-chunk-5

  • The higher the tolerance, the lower the convergence value for x.

Newton's Method (How the Tolerance Affects Convergence of a Piecewise at 0.6)

plot of chunk unnamed-chunk-6

  • For x = 0.6, it does not matter what tolerance we pick because each of the tolerances yield the same trajectory of convergence.

  • For each tolerance convergence occurs at approximately 1.

Newton's Method (How the Tolerance Affects Number of Iterations Required)

plot of chunk unnamed-chunk-7

Newton's Method (How the Tolerance Affects Number of Iterations Required for Convergence)

  • The higher the tolerance, the lesser number of iterations required for convergence (shorter trajectory).

  • For the piecewise function where x1 = 0.6 and for the quadratic function it does not matter what tolerance we pick because convergence occurs at approximately the same number of iterations (7-9 for the piecewise function and 2-3 for the quadratic).

Newton's Method (How the Initial Value Affects Convergence of a Quadratic Function)

plot of chunk unnamed-chunk-8

  • For intial x-values less than -1, x increases and then converges at -1. But if x is initally greater than -1, x decreases and then converges at -1.

Newton's Method (How the Initial Value Affects Number of Iterations for Convergence of a Quadratic Function)

plot of chunk unnamed-chunk-9

  • Generally, as the initial value of x increases, the number of iterations required for convergence increases.

  • However, when x is initially -1 only one iteration is required for convergence.

Newton's Method (Convergence of a Piecewise Function (x > 1))

plot of chunk unnamed-chunk-10

  • For all initial values of x greater than 1, convergence occurs at approximately 1.

  • As the initial value of x is increased, the length of the trajectory increases and the slope becomes initially steeper.

Newton's Method (How x > 1 Affects Convergence of a Piecewise Function)

plot of chunk unnamed-chunk-11

  • As the initial value of x increases, the number of iterations required for convergence increases, thus yielding a trajectory that is of a longer length.

Newton's Method (Convergence of a Piecewise Function (0 < x < 1))

plot of chunk unnamed-chunk-12

Newton's Method (Convergence of a Piecewise Function (0 < x < 1))

  • There are uniquely different trajectories for many of these initial values of x.

  • When x is initially less than or equal to 0.6 convergence occurs when x reaches 0.

  • When x is initially greater than 0.6, convergence occurs when x reaches 1.

Newton's Method (How the Initial Value Affects Convergence)

plot of chunk unnamed-chunk-13

  • No particular trend shown in the graph.

  • However, if the number of iterations required for the initial value of 0.5 was 4 or greater, the histogram would look like a bell-shaped curve or in other words a normal distribution.

How the Half-life of Mercury Affects the Amount Accumulated in a Person's Lifetime

plot of chunk unnamed-chunk-14

  • As the half-life of mercury increases, the maximum amount of mercury accumulated in a person's body during a lifetime would indubitably increase due to the fact that it would take a longer time to decay.

How the Mass Affects the Amount of Mercury Accumulated in a Person's Lifetime

plot of chunk unnamed-chunk-15

  • As the mass of the consumed fish increases, mercury accumulated in a person's body during a lifetime would indubitably increase due to the fact that the intake of the amount of fish would be large.

Maximum Amount of Fish per Month

plot of chunk unnamed-chunk-16

  • As the mercury half-life increases, the maximum amount of fish that can be consumed per month decreases such that the concentration of mercury in a person's body does not exceed 50 mg/kg.

Maximum Amount of Fish per Month

plot of chunk unnamed-chunk-17

  • There is exponential decay shown in the graph. As the mass of the fish consumed is greater, the maximum amount of fish that can be consumed per month decreases.