ode-initval/system.ss
;; Description of a systems of ODEs.
;;
;; y' = f(t, y) = dydt(t, y)
;;
;; The system is specified by giving the right-hand-side of the
;; equation and possibly a Jacobian function.
;;
;; Some methods require the Jacobian function, which calculated the
;; matrix dfdy and the vector dfdt.

(define-struct ode-system
               (function
                jacobian
                dimension
                params))

;; ode-system-function-eval:
;;   ode-system x real x vector of real x vector of real -> void
(define (ode-system-function-eval ode-system t y dydt)
  ((ode-system-function ode-system)
   t y dydt (ode-system-params ode-system)))

;; ode-system-jacobian-eval:
;;   ode-system x real x vector of real x matrix of real x vector of real -> void
(define (ode-system-jacobian-eval ode-system  t y dfdy dfdt)
  ((ode-system-jacobian ode-system)
   t y dfdy dfdt (ode-system-params ode-system)))