How can I apply Euler's method without the interval component?

Click For Summary

Discussion Overview

The discussion revolves around the application of Euler's method to solve an initial value problem defined by the differential equation $\frac{dy}{dt}=\alpha t^{\alpha - 1}$ with the initial condition $y(0)=0$. Participants explore how to handle the absence of a specified interval for the variable $t$ while attempting to compute solution errors and convergence orders for various values of $\alpha$ and step sizes.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant expresses uncertainty about how to apply Euler's method without a defined interval for $t$, suggesting a range of $0 \leq t \leq b$ and questioning whether to set $b=1$.
  • Another participant suggests trying $b=0.2$ and computing absolute errors at $t=b$ for different step sizes, indicating that any multiple of $0.2$ could work.
  • A participant shares their results for $\alpha=2.5$ and questions the variability of the error when using the same $h$ in their error term, noting that they obtained an order of convergence of $O(1.875h)$.
  • Another participant points out that estimating $\kappa$ requires multiple step sizes and suggests using a log plot of error versus step size to find the slope, which should be close to 1.
  • Several participants discuss how to create a log plot in Excel to estimate the convergence order.
  • A participant mentions discrepancies in slopes when applying the Modified Euler method, questioning why the slopes are near 0.5 instead of the expected value.
  • Another participant responds that the plotting method may be incorrect and clarifies that the gradient should be close to 2 for the Modified Euler method, which is expected to be second order.

Areas of Agreement / Disagreement

Participants generally agree on the need to define an interval for $t$ and the method for estimating convergence orders. However, there are differing opinions on the results obtained from the Euler method and the Modified Euler method, with no consensus on the correctness of the error estimates or the methods used.

Contextual Notes

Participants express limitations in their approaches, particularly regarding the estimation of convergence orders from single integration results and the need for multiple data points to accurately assess the error behavior.

Who May Find This Useful

Readers interested in numerical methods for solving differential equations, particularly those using Euler's method and its variants, may find this discussion relevant.

kalish1
Messages
79
Reaction score
0
I have a problem on which I need to apply Euler's method - EXCEPT that I don't have one of the crucial components. Question and my thoughts below:

**Question:** Consider the initial value problem $\frac{dy}{dt}=\alpha t^{\alpha - 1}, y(0)=0$, where $\alpha > 0$. The true solution is $y(t)=t^{\alpha}$. Use the Euler method to solve the initial value problem for $\alpha = 2.5,1,5,1.1$ with stepsize $h=0.2,0.1,0.05$. Compute the solution errors at the nodes, and determine numerically the convergence orders of the Euler method for these problems.

**My thoughts:** I don't have the "interval" for t! I tried setting the problem up as follows:

$0 \leq t \leq b$, with $N = (b-0)/0.2 = 5b$ for $h=0.2$, but wasn't able to get anything conclusive.

Should I try $b = 1$, so that t is restricted to a range in which it shrinks?

Thanks for any help.
 
Physics news on Phys.org
kalish said:
I have a problem on which I need to apply Euler's method - EXCEPT that I don't have one of the crucial components. Question and my thoughts below:

**Question:** Consider the initial value problem $\frac{dy}{dt}=\alpha t^{\alpha - 1}, y(0)=0$, where $\alpha > 0$. The true solution is $y(t)=t^{\alpha}$. Use the Euler method to solve the initial value problem for $\alpha = 2.5,1,5,1.1$ with stepsize $h=0.2,0.1,0.05$. Compute the solution errors at the nodes, and determine numerically the convergence orders of the Euler method for these problems.

**My thoughts:** I don't have the "interval" for t! I tried setting the problem up as follows:

$0 \leq t \leq b$, with $N = (b-0)/0.2 = 5b$ for $h=0.2$, but wasn't able to get anything conclusive.

Should I try $b = 1$, so that t is restricted to a range in which it shrinks?

Thanks for any help.

Try $$ b=0.2$$, then look at the absolute error between the true solution and the computed solutions at \(t=b\) for each step size \(h=0.05, 0.1, 0.2\) and put $$error_{t=b}(h)=Ah^\kappa$$ and estimate $$\kappa$$ from your data.

(In fact setting \(b\) to any multiple of \(0.2\) will do, it is just a question of how much computation you wish to do, the bigger you make \(b\) the better the estimate of \(\kappa\) should be)
 
Last edited:
Hello,

I tried what you said, and I am not getting satisfactory results. For example, take the case presented below:

Information: h=0.05 y(0)=0 alpha=2.5 dy/dt=2.5*t^(1.5) y(t)=t^(1.5) a=0, b=1 N=20 t in [0,1]

i w_i y(t_i) |y(t_i)-w_i|
0 0 0 0
1 0 0.0005590 0.0005590
2 0.00139754 0.00316228 0.00176474
3 0.00535039 0.00871421 0.00336382
4 0.0126122 0.0178885 0.0052763
5 0.0237926 0.03125 0.0074574
6 0.0394176 0.049295 0.0098774
7 0.0599572 0.072472 0.0125148
8 0.08584 0.101193 0.015353
9 0.117463 0.135841 0.018378
10 0.155196 0.176777 0.021581
11 0.199391 0.22434 0.024949
12 0.250377 0.278855 0.028478
13 0.308472 0.34063 0.032158
14 0.373978 0.409963 0.035985
15 0.447185 0.487139 0.039954
16 0.528375 0.572433 0.044058
17 0.617818 0.666112 0.048294
18 0.715776 0.768433 0.052657
19 0.822502 0.879648 0.057146
20 0.938246 1 0.061754

Now, I am using the same h in my (h^k) term, but the error varies, so my k also varies right? In any case, I don't get O(h).

Using Lipschitz continuity and the error bound, I was able to obtain O(1.875h) for this particular case of $\alpha = 2.5, h=0.05, 0 \leq t \leq 1$.

Have I done everything correctly?
 
kalish said:
Hello,

I tried what you said, and I am not getting satisfactory results. For example, take the case presented below:

Information: h=0.05 y(0)=0 alpha=2.5 dy/dt=2.5*t^(1.5) y(t)=t^(1.5) a=0, b=1 N=20 t in [0,1]

i w_i y(t_i) |y(t_i)-w_i|
0 0 0 0
1 0 0.0005590 0.0005590
2 0.00139754 0.00316228 0.00176474
3 0.00535039 0.00871421 0.00336382
4 0.0126122 0.0178885 0.0052763
5 0.0237926 0.03125 0.0074574
6 0.0394176 0.049295 0.0098774
7 0.0599572 0.072472 0.0125148
8 0.08584 0.101193 0.015353
9 0.117463 0.135841 0.018378
10 0.155196 0.176777 0.021581
11 0.199391 0.22434 0.024949
12 0.250377 0.278855 0.028478
13 0.308472 0.34063 0.032158
14 0.373978 0.409963 0.035985
15 0.447185 0.487139 0.039954
16 0.528375 0.572433 0.044058
17 0.617818 0.666112 0.048294
18 0.715776 0.768433 0.052657
19 0.822502 0.879648 0.057146
20 0.938246 1 0.061754

Now, I am using the same h in my (h^k) term, but the error varies, so my k also varies right? In any case, I don't get O(h).

Using Lipschitz continuity and the error bound, I was able to obtain O(1.875h) for this particular case of $\alpha = 2.5, h=0.05, 0 \leq t \leq 1$.

Have I done everything correctly?

You cannot estimate \(\kappa\) from one integration as the error term is approximately of the form:
\[error_{t=b}(h)=Ah^{\kappa}\]
(there was a typo in my earlier post)) so one step size is not adequate to estimate \(\kappa\). Now if you do a log plot of the error and step size the gradient of the best line will give the required estimate of \(\kappa\) (and it is close to 1):

\[\ln(error_{t=b}(h))=\kappa \ln(h) + \ln(A)\]

..
 
Last edited:
Hi,
Could you help me figure out how to do this in Excel?

"Do a log plot of the error and step size; the slope of the best line will give the required estimate"

I have everything up to this part.
 
Does anyone have any ideas?
 
kalish said:
Does anyone have any ideas?

Enter the three values of the error in the first column and the corresponding values of h at t=1 (or 0.2) in the second column. Now put the log of the first column in the third and the log of the second column in the fourth. Select the third and fourth column and use the plotting tools to do a scatter plot. When you have the scatter plot select the line and use the tool provided to generate the equation fro the regression line (can't tell you the exact key sequence as I am not at a machine with Excel at present.

.
 
zzephod said:
Enter the three values of the error in the first column and the corresponding values of h at t=1 (or 0.2) in the second column. Now put the log of the first column in the third and the log of the second column in the fourth. Select the third and fourth column and use the plotting tools to do a scatter plot. When you have the scatter plot select the line and use the tool provided to generate the equation fro the regression line (can't tell you the exact key sequence as I am not at a machine with Excel at present.

.

Hello,
Everything came out right. Now, I need to do the same problem using the Modified Euler method. However, after I inputted the equations and repeated the process, I am getting the slopes of the best lines to be way off from 1. (They are near 0.5). Is there a reason for this discrepancy?
 
kalish said:
Hello,
Everything came out right. Now, I need to do the same problem using the Modified Euler method. However, after I inputted the equations and repeated the process, I am getting the slopes of the best lines to be way off from 1. (They are near 0.5). Is there a reason for this discrepancy?

You are doing the plot the wrong way around (or rather \( \kappa \) s the reciprocal of the slope with the equation this way around) the gradient is close to 2, which is what it should be as modified Euler is second order.

.
 
Last edited:

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 38 ·
2
Replies
38
Views
11K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
20
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K