Skip to content

Commit 5606424

Browse files
committed
changed: RK4 move assignment outside of the loop
1 parent 3d69e82 commit 5606424

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model/solver.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ function get_solver_functions(NT::DataType, solver::RungeKutta, fc!, hc!, Ts, _
5454
k2 = get_tmp(k2_cache, var)
5555
k3 = get_tmp(k3_cache, var)
5656
k4 = get_tmp(k4_cache, var)
57+
xterm = xnext
5758
@. xcur = x
5859
for i=1:solver.supersample
59-
xterm = xnext # TODO: move this out of the loop, just above (to test) ?
6060
@. xterm = xcur
6161
fc!(k1, xterm, u, d, p)
6262
@. xterm = xcur + k1 * Ts_inner/2

0 commit comments

Comments
 (0)