I have a series of ODE which I want to solve in Julia Programming Language.
Anyone have the coding for RK4 solver.
Thanks
Hi, this is actually implemented in DifferentialEquations.jl. I suggest you to look at the documentation.
Though, you should almost never use RK4 , so the bigger question is, what are you trying to do?
Hello. thanks for your reply.
I am working on developing a new formulation for stability of a power system utility grid. I have some preliminary results from MATLAB using the RK4. The Julia platform will be used to compare the results.
Thanks.
I will go through the documentation.
Sorry for the slightly off-topic comment, but why? My memory from university days might be betraying me, but I kind of have the mental picture that RK4 was the “bread-and-butter” algorithm. Or maybe it was RK5? I cannot remember precisely. This was in a computational physics context.
EDIT: Is it related to this?
so rk4 and rk4 are the best methods that you can explain to an undergrad class in half a lecture, but they are pretty suboptimal. Tsit5 is pretty much a strictly better method. there are, however about 10 other methods that may be better than tsit5 depending on your problem characteristics. if you want to do this the easy way, use DifferentialEquations.jl and then just call solve(prob)
which will pick a good method automatically.
OwrenZen4 for example is pretty much strictly better than RK4 in the sense that with the same number of f
calls and same number of memory registers it hits like an order of magnitude less error. 5th order methods generally work out a bit better, with the Dormand-Prince (DP5) and Tsit5 tableaus just heavily optimized in comparison to RK4.
RK4 is probably the only one reasonable to put to memory but if you’re sitting at a computer with wikipedia open you might as well slap down Dormand–Prince method - Wikipedia. But if you want to use it in Julia, then you can just snap SimpleDiffEq.jl where it has some written out in the simplest form SimpleDiffEq.jl/src/tsit5/gpuatsit5.jl at master · SciML/SimpleDiffEq.jl · GitHub