Created
June 18, 2018 06:50
-
-
Save teeGraco/14ef236e8c8d6514b34eebb72d45eaf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StateVector NumInt(StateVector S, StateVector S_dot, float h, float t, StateVector F()) | |
{ | |
StateVector K1, K2, K3, K4 | |
StateVector S_new | |
K1 = S_dot | |
K2 = F(S + h/2 + K1, t + h/2) | |
K3 = F(S + h/2 + K2, t + h/2) | |
K4 = F(S + h + K3, t + h) | |
S_new = S + h/6 * (K1 + 2*K2 + 2*K3 + K4) | |
return S_new | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment