Wrapped generateSpringRK4 in an IIF to memoize integration functions