I need some help with the derivation of fourth order Runge Kutta

In summary, the conversation is about the derivation of the fourth Runge Kutta scheme. The speaker found a helpful resource and has some questions about the equations involved. They discuss the notation and how the function is evaluated at different points in the process. Finally, the speaker thanks the others for their help and understanding.
  • #1
ATY
34
1
Hey guys, I need your help regarding the derivation of the fourth runge kutta scheme.
So, I found http://www.ss.ncu.edu.tw/~lyu/lecture_files_en/lyu_NSSP_Notes/Lyu_NSSP_AppendixC.pdf
this derivation. Maybe you have a clue what tehy are doing in C.54.
So before this they are calculating the taylor expansion series of [tex]f_1,f_2,f_3,f_4[/tex]. This makes somehow sense. But I get confused when they throw everything together in equation C.54.
Why is therre just the "ordinary" f everywhere instead of [tex] f_2,f_3,f_4 [/tex] ? I thougt that they just insert everything into equation C.46, but this seems not to be the case, or they are skipping some steps (like getting f_4 back to f_1 or so...)
I hope that somebody takes a look at the derivation and can tell me what exactly they are doing there
 
Mathematics news on Phys.org
  • #2
C.51 .. C.53 show how to replace f2, f3, f4 with terms expressions of partial derivatives of f. It says that is what they did.
 
  • Like
Likes BvU
  • #3
On the righthand side of 47, 51, 53 there are only ##f##, no ##f_2## etc. ?!

Never mind, FC was faster
 
  • #4
Thank you for the answer :)
 
  • #5
Hey guys,
I got one more question. I hope you do not mind it.
I spend some time with the equations but, there is still one thing I do not understand. What do they mean with
[tex]t=t^n[/tex] ?
I wrote an email to the author of the text and got this reply:
fd2366d65d.jpg


But this does not really help me. I do not know what exactly this means. [tex]\Delta t[/tex] is from what I know the step size "h" or (x-a) (this is the notation the english wikipedia uses in the article about the taylor expansion).
I hope that you want to help me one last time.
Have a nice day
 
  • #6
It's just a notation convenience to write ##t^n## instead of ##t=n\Delta t##. He doesn't use it in lecture 2, but in table 3.1 he does -- in a manner that isn't fully consistent with his convention. But it's readable. Try to master 2nd order first by writing it out in full - if stuck, grab another textbook or pdf.

For you it might be confusing that in section in appendix C.1, ##x## plays the role of ##t## in the Runge Kutta section C.2
 
Last edited:
  • #7
Ok. So I will try to go along the Taylor series notation of wikipedia right now:
dadd9a8618.png

so [itex]f[/itex] is the same [itex]f[/itex] as from the appendix.
[itex]\Delta t[/itex] is the step size and is the same as [itex](x-a)[/itex].
So does this mean, that [itex](f)_{t=t^n}[/itex] is the same as [itex]f(a)[/itex] ?
This would mean, that [itex]t=t^n[/itex] is the position at which I evaluate my function.
 
  • #8
Higher order Runge Kutta evaluates the function at intermediate points. E.g. for 4th order in the starting point (C.47), halfway (##\Delta t\over 2##) using ##f_1## (C.48), halfway (##\Delta t\over 2##) using ##f_2## (C.49) and at the end of the step (##\Delta t##) using ##f_3## (C.50). So: yes, in this case ##\Delta t## is the step size. But: no, the function is evaluated not just at ##t^n## but also at ##t^{n+{1\over 2}}##

Compare these to the notation in table 3.1 -- post if there is any doubt whatsoever left over.

BvU said:
in a manner that isn't fully consistent with his convention
I didn't really do him justice there: it's pretty consistent, but he doesn't use it all over, probably for reasons of clarity :smile:
 
  • #9
Sorry for the confusion by my bad choice of words.
I think I got it, but I just want to be sure:
When we take a look at e.g. C.53
we have [itex]f_4 = (f)_{t=t^n}+\Delta t (\frac{\partial f}{\partial t}+f_3 \frac{\partial f}{\partial y})_{t=t^n}[/itex].
If we just look at the beginning now; it means that I will take the value of [itex]f[/itex] at the position [itex]t^n[/itex].
(while the function [itex]f_4[/itex] get's evaluated at the point [itex]t+\Delta t[/itex]).
Is this now finally correct ?
 
  • #10
I think you've got it !
Perhaps the animation of slide 56 here helps picture what happens in an RK4 routine ?
 
  • #11
Thank you so much :)
 

1. What is the fourth order Runge Kutta method?

The fourth order Runge Kutta method is a numerical method used to solve ordinary differential equations. It is an improvement on the simpler Euler method, and it calculates the solution at four points within each interval instead of just one. This results in a more accurate approximation of the solution.

2. How is the fourth order Runge Kutta method derived?

The fourth order Runge Kutta method is derived by using Taylor series expansions to approximate the solution at each point within the interval. The method involves calculating four slopes and using a weighted average of these slopes to determine the next approximation of the solution.

3. What are the advantages of using fourth order Runge Kutta over other methods?

The fourth order Runge Kutta method is more accurate than simpler methods like Euler's method, as it takes into account multiple points within the interval. It is also more stable and can handle a wider range of differential equations. Additionally, it is relatively easy to implement and does not require advanced mathematical knowledge.

4. Are there any limitations to using fourth order Runge Kutta?

While the fourth order Runge Kutta method is more accurate than simpler methods, it still has limitations. It may not provide accurate results for very large or very small intervals, and it can struggle with stiff systems of equations. It is important to carefully choose the step size and be aware of the limitations of the method.

5. How can I implement the fourth order Runge Kutta method in my own code?

There are many resources available online that provide code examples and step-by-step instructions for implementing the fourth order Runge Kutta method. It is important to understand the mathematics behind the method and carefully code each step to ensure accuracy. It can also be helpful to test the code with known solutions to verify its accuracy.

Similar threads

  • Differential Equations
Replies
4
Views
2K
Replies
0
Views
2K
Back
Top