Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm trying to investigate nonlinear system numerical methods. For the nonlinear DE x' = 2t(1+x^2). Use the value tan(1) = 1.557407724654....

a) how to find the explicit solution $x(t)$ satisfying $x(0) = 1$?

b) how to use Euler's method to approx the value of $x(1) = e$ using $\Delta t = 0.1$. I.e., recursively determine $t_k$ and $x_k$ for $k = 1,...10$ with $\Delta t = 0$, starting with $t_0 = 0$ and $x_0 = 1$.

c) Repeat using $\Delta t = 0.05$

d) Again using Euler's method but reduce step size by a factor of 5, so that delta $t = 0.01$ to approx x(1)

e) Repeat parts b, c, and d with Improved euler's method using the same step sizes

f) Repeat using Runge-Kutta

g) Calculate the error in each case, since we now have 9 different approx for the value of $x(1) = e$, three for each method.

h) Calculate how the error changes as we change the step size from 0.01 to 0.05 and then from 0.05 to 0.01

Can someone also write in the format that implicit EUler and RK 4 takes in this example?

share|improve this question
1  
This exact set of questions was done with a different DEQ. Are you saying that you couldn't do a single part of this variant with that answer? Regards –  Amzoti Apr 21 '13 at 5:45
    
@Amzoti, I'm stuck on how to get a computer calculator software to generate the values for delta t = 0.1, 0.05, and 0.01. Can you just help out with Euler's for part b,c,d and paste the output here? –  mary Apr 21 '13 at 19:34
    
Okay, I added an example of the improved Euler. The rest is up to you! Regards –  Amzoti Apr 23 '13 at 0:44
    
@Amzoti, thank you . However, when I use the software for Implicit Euler with h = 0.01, there seems to be an error. It works well with step sizes of h =0.05, and 0.10 but not 0.01, can you please explain why? If you get an answer, can you tell me what software you use? Thanks –  mary Apr 23 '13 at 1:51
    
You can try this solver and see what is happening near 1.0 from the graphic I included. I suspect that your method is getting to those values and not handling them well. See: and try your problem (you have to change variable names, but it has Euler and Improved), see math-cs.gordon.edu/~senning/desolver and look at some of the values near 1.0 and above. Maybe your SW is blowing up because of this. Regards –  Amzoti Apr 23 '13 at 2:00

2 Answers 2

a. We are given the DEQ: $f(t, x) = x' = 2 t (1 + x^2), x(0) = \alpha = 1$.

We find the closed form solution as $\displaystyle x(t) = \tan\left(t^2 + \frac{\pi}{4}\right)$

b. To set up the Euler iteration, we have:

$h = \frac{b - a}{N} = 0.1$

$t_0 = a = 0$

$w_0 = \alpha = 1$

For $i = 1, 2, \ldots, N$:

$$w_i = w_{i-1} + h f(t, w) = w_{i-1} + 0.1\left(2~ t_{i-1} (1 + w_{i-1}^2)\right)$$

Generating the iterates yields:

$t_i ~~~~|~~ x_i$

$0.0 ~~|~~ 1.$

$0.1 ~~|~~ 1.$

$0.2 ~~|~~ 1.04$

$0.3 ~~|~~ 1.12326$

$0.4 ~~|~~ 1.25897$

$0.5 ~~|~~ 1.46577$

$0.6 ~~|~~ 1.78061$

$0.7 ~~|~~ 2.28109$

$0.8 ~~|~~ 3.14955$

$0.9 ~~|~~ 4.8967$

$1.0 ~~|~~ 9.39269$

Part c is just changing the step size for $t$.

Part d is just changing the step size for $t$.

Part e:

We have:

$x'(t) = f(t, x) = 2 t (x(t)^2+1), x(0) = 1$

$k_1 = h f(t_n, x_n)$

$k_2 = h f(t_n + (2 h)/3, x_n + (2 k_1)/3)$

$x_{n + 1} = x_n + k_1/4+(3 k_2)/4$

The iterates from this are:

$t_i ~~~~~|~~ x_i$

$0.0 ~~|~~ 1.0$

$0.1 ~~|~~ 1.02$

$0.2 ~~|~~ 1.08262$

$0.3 ~~|~~ 1.19637$

$0.4 ~~|~~ 1.37988$

$0.5 ~~|~~ 1.67285$

$0.6 ~~|~~ 2.16814$

$0.7 ~~|~~ 3.12781$

$0.8 ~~|~~ 5.5858$

$0.9 ~~|~~ 17.5821$

$1.0 ~~|~~ 467.086$

If you look at these results, things are looking shaky near the end. That is the point of this exercise.

If we look at a figure of actual versus numerical, we have:

enter image description here

share|improve this answer
    
+1 Nice step-by-step modeling...parts c and d should be doable! ;-) –  amWhy Apr 22 '13 at 0:05
    
@amWhy: I hope she gets it!!! Thx –  Amzoti Apr 22 '13 at 0:06
    
@Amzoti, I got that x1 = 1.1, x2 = 1.241, and x3 = 1.4350081 with this form of Euler's method: xn = xn-1 + 0.2tn-1 + 0.1xn-1^2, which matches your format. However, I got a different answer –  mary Apr 22 '13 at 1:38
    
Could you also provide the values for Implicit Euler and RK4 so I can check over my work on it? A setup/some values would be nice. Thanks –  mary Apr 22 '13 at 1:39
    
@mary: You wrote xn = xn-1 + 0.2tn-1 + 0.1xn-1^2, but I think you left out a product: $x_n = x_{n-1} + 0.1(2 t_{n-1}(1 + x_{n-1}^2))$. See the issue with your result? –  Amzoti Apr 22 '13 at 1:41

a)$$\frac{dx}{dt}=2t(1+x^2)\Rightarrow\frac{dx}{1+x^2}=2\,t\,dt$$ $$\int\frac{dx}{1+x^2}=\int2\,t\,dt\Rightarrow\arctan(x)=t^2+C\Rightarrow x=\tan(t^2+C)$$ by initial condition $x(0)=1\Rightarrow C=\frac\pi4$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.