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

Click For Summary
SUMMARY

This discussion focuses on applying Euler's method to solve the initial value problem defined by the differential equation $\frac{dy}{dt}=\alpha t^{\alpha - 1}$ with $y(0)=0$. Participants explored various values of $\alpha$ (2.5, 1, 5, 1.1) and step sizes ($h=0.2, 0.1, 0.05$) while addressing the challenge of not having a specified interval for $t$. The conversation highlighted the importance of selecting appropriate values for $b$ to compute solution errors and estimate convergence orders, ultimately leading to the realization that the Modified Euler method yields a convergence order of approximately 2, contrasting with the first-order convergence of the standard Euler method.

PREREQUISITES
  • Understanding of Euler's method for numerical solutions of differential equations
  • Familiarity with initial value problems and convergence analysis
  • Knowledge of Lipschitz continuity and error estimation techniques
  • Proficiency in using Excel for data analysis and plotting
NEXT STEPS
  • Implement the Modified Euler method for the given initial value problem
  • Analyze convergence orders for different step sizes using log-log plots
  • Explore the implications of Lipschitz continuity on error bounds in numerical methods
  • Investigate alternative numerical methods for solving differential equations, such as Runge-Kutta methods
USEFUL FOR

Mathematicians, engineers, and students involved in numerical analysis, particularly those focusing on solving differential equations and optimizing numerical methods for accuracy and efficiency.

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