I'm trying to study a simple predator-prey type ODE system of two variables, but I'd like to analyze the impulse response. Really, I have two versions of the same dynamical system, so two copies of each variable, where all the variables interact according to the same predator-prey model (so the herbivores in both systems can be eaten by carnivores in both systems), but where one of the systems is always on and where the other is off until some time when I subject it to an impulse. I'm using Runge-Kutta for integration, and I'd like to study the impulse response of that parallel system.
Note that I want the total sum of the copies of the two variables to be constant (when I impulse the one system I 'negative' impulse the other, to keep this consistent). Really I'm trying to study a single system, but separate out the contribution of the driving signal in a single time step so I can track how long it contributes to system dynamics.
I noticed that if I start the one system in steady state, so nothing is changing, and then impulse the other, the first system is kicked out of steady state and starts oscillating (while the other decays to 0, as expected). This oscillation suggested something was wrong, since it should return to steady state when the other system dies out. I've since learned that Runge-Kutta was not meant to deal with impulse.
I've tried two things: the first is to only have the impulse in the first of the four elements of the runge-kutta scheme at impulse time. This seems to work, and gives me back my steady state after the other system decays, but there is some very weird transience in between (when the sum of variables from the two systems is no longer constant). I have also tried explicitly using only Euler's method at the impulse time, and this gives a similar result.
Is there something else I can try or a better solution to this problem?