Finding optimal parameters in ODE



Hi there,

I am thinking that I am reinventing the wheel here. I have two
discretized functions (n known values over time): X(t) and Y(t). The
behavior is defined by:

Y'(t) = A*X(t) + B*Y(t), Y(0) = 0

If I were to solve this ODE I would use a RK4...well my problem here
is not solving the ODE but finding the A and B parameter. So instead I
have (n - 1) set of linear equations with 2 unknows.

y(n+1) = y(n) + h/6 (k1+2*k2+2*k3+k4)

Right now I am brute forcing the expansian of the 4 RK coefficients
(k1,k2,k3,k4) to expand them in A and B, but I am thinking that
someone else must have done that. Right ?

Thanks for suggestion,
-Mathieu

.