Solving ODEs with Heun's Method: A Question

In summary, Heun's method for solving an ODE involves the use of k1 and k2, which are defined as f(y(old)) and f(y(old) + q11k1Δh) respectively. The formula for solving a simple differential equation using this method is du/dt = 0.5(k1 + k2). The confusion arises when the entire k2 term is multiplied by a, but this is not included in any formula and was a mistake. The issue has been resolved and the thread can be deleted.
  • #1
yugeci
61
0
Hi there,

in my notes for Heun's method for solving an ODE, I have

y(new) = y(old) + 0.5(k1 + k2)Δh

And k1 is supposed to be f(y(old)) while k2 is f(y(old) + q11k1Δh) and q11 is 1

So if for example I have a simple differential equation like du/dt = au

It would be du/dt = 0.5(k1 + k2)

du/dt = 0.5(au(told) + a((u(told)+au(told)Δt))

The first term on the right of the equal is k1, and the term after is k2. What I don't understand is why the entire k2 term is multiplied by a? It's not in any formula so what mistake have I made here. I couldn't really find this in any of my books either, especially since the notation is so different.
 
Physics news on Phys.org
  • #2
I figured it out. This thread can be deleted.
 

What is Heun's method for solving ODEs?

Heun's method is a numerical method used to approximate solutions to ordinary differential equations (ODEs). It is a two-step process that involves first approximating the solution using Euler's method, and then refining the approximation using a weighted average of the Euler approximation and the slope at the midpoint.

How does Heun's method differ from Euler's method?

Heun's method is more accurate than Euler's method because it takes into account the slope at the midpoint, whereas Euler's method only uses the slope at the starting point. This results in a smaller truncation error and a more precise approximation of the solution.

When is Heun's method most useful?

Heun's method is most useful for solving ODEs that do not have analytical solutions or when the analytical solution is difficult to obtain. It is also helpful when the ODE is nonlinear or has a steep slope, as Euler's method may produce inaccurate results in these cases.

What are the limitations of Heun's method?

Heun's method is a first-order method, meaning that the error in the approximation decreases linearly with the step size. This can result in a large number of steps needed to achieve a desired level of accuracy. Additionally, Heun's method may not be suitable for stiff ODEs, where the slope changes rapidly.

How do I implement Heun's method to solve an ODE?

To use Heun's method, you will need to first discretize the ODE by choosing a step size. Then, you can use the two-step process to approximate the solution at each step, using the slope at the midpoint. The process can be repeated until the desired level of accuracy is achieved or until the desired interval is reached. There are also software packages and coding libraries available that have built-in functions for implementing Heun's method.

Similar threads

Replies
3
Views
797
Replies
5
Views
368
  • Differential Equations
Replies
3
Views
1K
Replies
5
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
Replies
2
Views
3K
Replies
2
Views
2K
Replies
2
Views
1K
  • Programming and Computer Science
Replies
15
Views
2K
  • Differential Equations
Replies
1
Views
5K
Back
Top