GithubHelp home page GithubHelp logo

constrain on states about pysindy HOT 5 CLOSED

bathukorallage avatar bathukorallage commented on August 18, 2024
constrain on states

from pysindy.

Comments (5)

akaptano avatar akaptano commented on August 18, 2024

Yes this is doable. There are constrained SINDy versions available in the optimizers folder for affine constraints. Since your example constraint is equivalent to dS/dt + dI/dt + dR/dt = 0, and SINDy is fitting d/dt[S, I, R] = Theta(...) * Xi, this can be cast as a constraint on the coefficients in Xi -- i.e. that Xi^S + Xi^I + Xi^R = 0 since the Theta matrix is the same for each. This can be put into the affine form C*Xi = d = 0, which you will have to work out. Let me know if you have any more questions.

from pysindy.

buathukorala avatar buathukorala commented on August 18, 2024

Thank you for the suggestion Alan, it is very useful. I will check the implemented optimizers and the related examples.

from pysindy.

slimaneaymen avatar slimaneaymen commented on August 18, 2024

Hello @akaptano,
I wonder if there is a way to specify which interaction to be done between the terms, in other words how to constrain the theta matrix. For ex: if i have x,y,z , I would like to constrain theta to have only the individual terms (x, y, z) + the interaction: xz.
Thanks for your help

from pysindy.

akaptano avatar akaptano commented on August 18, 2024

Hi @slimaneaymen

The answer is yes, but your example can be done in two ways in the code. The first way is to constrain the model coefficient Xi, rather than constraining theta. This is what I described above, and it can be done in a way that the model only produces (x, y, z) terms + an interaction xz term.

The other way is to design a theta matrix that only contains the interaction term xz. This can be done with the GeneralizedLibrary class since this allows you to specify only a subset of the inputs for library generation -- check out the example at the bottom of the Example 1 Jupyter notebook to see how this can be done, or the last of the recent Youtube lectures that I put online.

Best,
Alan

from pysindy.

slimaneaymen avatar slimaneaymen commented on August 18, 2024

Hi @akaptano,
Thanks so much for your reply Alan, I will check both methods.

Best,
Slimane

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.