[SciPy-user] Solving "difference" equations

Robert Kern rkern at ucsd.edu
Sun Aug 21 02:49:55 EDT 2005


Kumar Appaiah wrote:
> Dear Scipy users,
> I would like to know whether SciPy has a facility allowing one to
> solve discrete-time difference equations. For example, equations like
> the following:
> 
> y[n] = y[n - 1] + x[n], n is an integer.
> 
> I tried using odeint, but it solves it as a continuous time equation
> (or so I think...). Setting hmax to 1.0 also doesn't help.
> 
> What is the right way?

Difference equations are rather trivial to do yourself via a for-loop. I
don't think there are any special algorithms that need to be applied.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the SciPy-User mailing list