Thank you very much. Your explanation is more than superb. I request you to publish more quality content like this. I am lucky that I found your channel.
This math is very lengthy and tedious and would easily have doubled the length of this video (and I though I would lose all my viewers). Here is the math for the RK-2 method (which is tedious enough). ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-X-_qCcYDbuY.html
Great explanations, except when we get to the important part: I am really missing a drawing of the final steps at 9:50-10:40, i.e.: What does it mean to evaluate the slope G as a function of two parameters, how does that slope fit on the drawing (it's hard to see that it can, as it supposes a 2D vector field... I suppose?), and most importantly: how does that slope look, and where do we finally end up. It's so frustrating to have been watching and waiting for half an hour to get to that, and then the most important part for understanding just being... skipped. Similarly for the actual form of RK4: "why is it like it is?" was the central question I was trying to find an answer to. Such a shame to have such a good build-up, but then just skip over the punch-line. Does a good visual explanation for this exist anywhere on youtube? (So it could be used together with this video set)
Thanks for your feedback. The math for the derivation of RK4 runs several pages and is too long to crunch into a video and is really the topic of papers and articles. I considered working the math for the RK-2 model just to show how it works in getting us from higher order derivatives, to simply evaluating the slope at different points. However, even that would have run into a video on its own (perhaps longer). Additionally, at the time I made this video, my approach was to focus more on the computer implementation of these models rather than having viewers get bogged down in tons of math because I felt like that was what was especially lacking in college courses on this topic - the computer implementation of things. Consequently, my approach was to try to describe RK-4 qualitatively using RK-1 and RK-2 and building up my way up. The answer to your question of "why is it like this?" is that it is the result of solving a system of simultaneous equations that we arrive at using the techniques described in the videos, namely, using the Taylor Series approximation to the required order, requiring that the weights add up to 1, a few substitutions before the equations get unwieldy. Sorry to sound so vague, but this is one of those times that I leave the hardcore number crunching to the math buffs and use their results. The results for various forms of the RK methods are typically presented in the form of a Butcher Tableau and these have been calculated for us for even higher order methods, so there's not really anything for use to work out. I agree that it gets a little tricky to show this graphically when dealing with higher-order derivatives, because some of these things are mathematical constructs and of higher dimensions (as you mentioned). Vectors are easy to work with in higher dimensional spaces, but difficult to draw. I haven't neither seen any other animations of the RK-4 nor have I really seen any decent explanations of RK-4. If you happen to find any, please share.
I was following along the derivation from the Taylor expansion and wondered where we were going to get all those derivatives. Then between equations 10 and 11 the derivatives magically became evaluations of the functions. How did that happen?
Well made video, but I feel like the main explaination is missing here. How do I get from the slopes in equation 10 to the coefficients in equation 11? You mentioned, that the coefficients are underdetermined, but in the end you still have to show that your specific solution with your choosen coefficients match the equation we wanted in the first place (the different order derivatives of the taylor series).
This is just algebra, but it involves pages and pages of tedious math. It was way too long to include in this video. I also considered showing the math only for the RK-2 case, but even this runs a few pages and I felt that very few people (if any) would sit through all of it on video. All of this math does exist in articles and research papers and has been performed for you, but I wanted to expand a little on the conceptual ideas behind this algorithm. So, in the end I decided that I would focus on the basic ideas behind the computer implementation of this method rather than focus on the rigorous mathematical derivation.
Thanks for posting this. I warched parts 1 and 2, and I feel I "almost" understand it, and was hoping thal looking at the code implementation on the next video I might finally understand it fully. But I could not find the next video. If I go to your youtube page->Videos, the RK videos are not even mentioned. Playlists don't mention them either. Could you include a link to the next video in part 2's description? Thanks.
There you go. Strange that it's not suggested since it's on the same playlist as the previous two. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IOkwWYaZbck.html
Thanks! I think I understand it now. G is a derivative computation; right? So, if I was computing a planetary orbit, for example, I 'd compute ... Nah, I'm lost. Would I be integrating speed into position? Or acceleration into speed? Or both separately? Or both together? If two integrations, each would use RK4? By the way, I wanted to like the python video but didn't know how from inside a play-list.
This has confused me so much because I am trying to understand RK method in the context of MATLAB coding. Here's the program I wrote function y = my_Rungekutta(dydx,x0,y0,h,xf) % x0, y0 = initial conditions % h = step size % xf = terminal x position % dydx = derivative of y with respect to x, anon func x = x0:h:xf; Lx = length(x); y = zeros(1,Lx); y(1) = y0; for i=1:Lx-1 k1 = dydx(x(i),y(i)); k2 = dydx(x(i)+0.5*h,y(i)+0.5*h*k1); k3 = dydx((x(i)+0.5*h),(y(i)+0.5*h*k2)); k4 = dydx((x(i)+h),(y(i)+k3*h)); y(i+1) = h*(1/6)*(k1+2*k2+2*k3+k4)+y(i); end end I am not taking any 2nd or 3rd or 4th derivatives... Oh wait, I am... Numerically
Did they finally add a basic working Runge Kutta to Matlab yet? I was solving systems of about 1000 ODEs about 10 years ago and none of the built in solvers would converge. Writing my own simple Runge Kutta worked perfectly. It was still a big system, a run of what I was doing was taking 8-10 hours on a Phenom II, but it worked while all their built in stuff failed miserably.
Say, If were to derive RK Method for 12-th order. What method (Mid-Point/Heun's method) should I use for steps in obtaining the consecutive slope terms?
Is this actually something you are trying to implement or is this just a theoretical question? I have not personally looked at any 12th order RK schemes, but the idea is that you will get a family of solutions (i.e. there are more unknowns that equations to solve them). As a result, assuming a value for one of the unknowns, then the others can be calculated. As a result of this assumption, you will get a certain set of weights which will further dictate the actual method (Mid-Point & Heun's Methods refer only to the 2nd order RK). While assuming a different value for a variable will yield a different set of weights (and also the actual procedure/steps used), each one of these methods and sets of weights will produce a 12th order accurate integrator. Typically, however, all the math has already been done for you so you can just pick whichever solution you want. As I indicated in the video, the choice of which exact procedure to use might depend on several factors including: ease of implementation, number of floating-point calculations required, actual accuracy (some 12th order methods will actually be slightly more accurate than others, but might require more calculations).
@@Freeball99 I had it as an assignment in My python programming class. I came across a method called the "Butcher Method". It took me 4 days to solve it. I got it now. But there's no vids in RU-vid on solving higher order RK method, let alone their algorithm for implementing. Here's a suggestion, maybe You should make one on higher order RK method. (using Butcher method or others)
@@Freeball99 Runge = 'roon'-ga and Kutta = 'could'-ter All three are germans, like many other mathmaticians, too. Gauß = 'gow'ss (sharp s) Leibniz: 'Lib'nits (Lib like in Library) Ich you wanna know more, feel free to ask me :-)