GithubHelp home page GithubHelp logo

Comments (5)

briandesilva avatar briandesilva commented on August 18, 2024

See this section of the documentation. The following factors contribute to the issue:

  1. The default numerical integrator used by SINDy.simulate is scipy.integrate.odeint, an adaptive time-stepping routine. Since odeint is adaptive, it needs to be able to evaluate functions at various points in time, meaning control inputs need to be given as a callable function.
  2. Sometimes you don't have a function for u, but you do have a time series. In that case, SINDy will form a spline interpolation of the time series and use that instead. However, since it's an interpolating function, if you try to evaluate it at a time outside of the original time series, it will complain.

The issue is either that you're trying to simulate for times when the control inputs aren't known or that the numerical integrator, odeint, is attempting to evaluate the interpolating function for u outside the domain where it's defined. You could either decrease the span of time over which you simulate or use a different integrator (scipy.integrate has some other options). If you decide to do the latter, you will probably need to adjust the call signature of the integrator to match that which SINDy.simulate expects: integrator(rhs, x0, t, **kwargs).

from pysindy.

msis avatar msis commented on August 18, 2024

This is what I used to get too, see #94 .
I think it's related to the t you are passing, not the u.

from pysindy.

briandesilva avatar briandesilva commented on August 18, 2024

This is what I used to get too, see #94 .
I think it's related to the t you are passing, not the u.

That could also be the problem. I will create a new release including the fix this afternoon.

from pysindy.

moujrid avatar moujrid commented on August 18, 2024

thank you for all you replies.

I tried to shift the time to start at 0 and also tried different time spans smaller than the actual time span of my time serie but the error keeps showing up

from pysindy.

briandesilva avatar briandesilva commented on August 18, 2024

@moujrid, I just created a new release with the bug fix I alluded to earlier. See if you still encounter the error after updating to the latest version.

from pysindy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.