Giter VIP home page Giter VIP logo

Comments (8)

robclewley avatar robclewley commented on August 10, 2024

from pydstool.

ulyssek avatar ulyssek commented on August 10, 2024

When I try this, I have the following error :

TypeError: only size-1 arrays can be converted to Python scalars

Obviously, Pydstool expect me to use scalars as parameters.

Could you send me the link to the demo script? I couldn't find it in the doc.

Thanks a lot

from pydstool.

robclewley avatar robclewley commented on August 10, 2024

from pydstool.

robclewley avatar robclewley commented on August 10, 2024

from pydstool.

ulyssek avatar ulyssek commented on August 10, 2024

Amazing, it's working perfectly. Thanks a lot!

PS. it was a demonstrative example, my_custom_function is a 1000 x 1000 2D precomputed numpy array.

from pydstool.

ulyssek avatar ulyssek commented on August 10, 2024

Hi, it's me again!

This hack doesn't work to find nullclines, which is one of my goals:

from PyDSTool.Toolbox import phaseplane as pp
import PyDSTool as dst

domains = {
    'x' : [0,1],
    'y' : [0,1],
}

eqs = {
        'x' : '-2 * x + foo(x)',
        'y' : '- y',
}

DSargs = dst.args(name='my_model')

DSargs.vfcodeinsert_start = """
def foo(z):
      return [0,1,2][int(2*z)]
"""
DSargs.varspecs = eqs
DSargs.ignorespecial = ['foo']
DSargs.tdomain = [0, 30]

DSargs.xdomain = domains

dmModel = dst.Vode_ODEsystem(DSargs)

fp_coord = pp.find_fixedpoints(dmModel, n=4, eps=1e-8)

pp.find_nullclines(dmModel, *list(eqs.keys()), n=3, eps=1e-8,
                                          max_step=0.01, fps=fp_coord)

This code is basically the same as the one above, except that I use the fixed points to compute the nullclines.

I now have the following error :

ValueError: Undeclared or illegal token `foo` in spec string `x`

from pydstool.

robclewley avatar robclewley commented on August 10, 2024

Closing this as the merge should have fixed the issue.

from pydstool.

ulyssek avatar ulyssek commented on August 10, 2024

Yes, working perfectly, thanks a lot!

from pydstool.

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.