0

I'm trying to solve an ODE of the form

x'=f(x), x(T)=x_{T}

in python using scipy.integrate.odeint.

However, this has the form: scipy.integrate.odeint(func, y0, t,...), where y0 is the vector of initial conditions. I do not have an initial vector, instead, I have a vector for the final time T. How should I modify the scipy.integrate.odeint routine?

Thanks in advance

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
FerCimat
  • 3
  • 2

1 Answers1

0

odeint can integrate "backwards". Give the known value x(T) as the "initial" condition, and then give the t values in decreasing order from T down to wherever you want the solution to stop.

See this answer for an example.

Warren Weckesser
  • 110,654
  • 19
  • 194
  • 214