Git Product home page Git Product logo

pyrates-neuroscience / pycobi Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 1.0 676 KB

Python package for automated bifurcation analysis and parameter continuations, based on Auto-07p.

Home Page: https://pycobi.readthedocs.io/en/latest/

License: GNU General Public License v3.0

Python 98.02% Fortran 1.98%
bifurcation bifurcation-analysis bifurcation-detection parameter-continuation python auto-07p differential-equations dynamical-systems phase-transitions fortran90

pycobi's Introduction

PyCoBi

License Python PyPI version CircleCI Documentation Status DOI

PyCoBi is a Python tool for parameter continuations and automated bifurcation analysis. It provides a Python interface to Auto-07p [1], allowing for a more intuitive usage of Auto-07p commands within Python scripts. It provides direct access to solutions, branches, and their properties (i.e. special solutions, eigenvalues, etc.) as well as a range of plotting functions to visualize bifurcation diagrams and solutions. Finally, it allows to automatically generate the user-supplied Fortran routines via PyRates, such that Auto-07p can be fully used/controlled from within a single Python script, without the need to supply additional non-Python files.

Installation

To use PyCoBi, it is required to install Auto-07p. You can follow these installation instructions for detailed information on how to install Auto-07p in your specific setup. Note that it is not required to manually set any path variables, since PyAuto will take care of that for you.
A typical installation procedure would be the following:

Step 1: Clone the Auto-07p github repository:

git clone https://github.com/auto-07p/auto-07p

Step 2: Configure the installation scripts

Go to the directory that you cloned the Auto-07p repository into and call

./configure

Step 3: Install Auto-07p

In the same directory, call

make

Step 4: Install the Python version of Auto-07p

After that, in the same directory, execute the following call from within the Python environment that you would like to use for PyAuto

python setup.py install

Step 5: Install PyCoBi

Use pip to install the latest stable version of PyCoBi

pip install pycobi

Alternatively, the development version of PyCoBi can be installed by cloning the github repository and using the setup.py for installation (see steps 1 and 4).

Documentation

A full API, documentation, and use examples can be found at readthedocs.

References

[1] E.J. Doedel, T.F. Fairgrieve, B. Sandstede, A.R. Champneys, Y.A. Kuznetsov and W. Xianjun (2007) Auto-07p: Continuation and bifurcation software for ordinary differential equations. Technical report, Department of Computer Science, Concordia University, Montreal, Quebec.

pycobi's People

Contributors

richert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wisamreid

pycobi's Issues

Error: `invalid literal for int() with base 10`

Hello,

I am currently trying to use PyCoBi to simulate non-linear effects in microring resonators for photonic neuromorphic computing and I am exploring continuation analysis of some of our (potential) neuron structures. I have rate equations obtained from the literature but I encounter the following errors in various scenarios:

  • If I simply copy the Van der Pol operator from PyRates, I get the following error: invalid literal for int() with base 10
  • If I use my actual equations, I get the following error: TypeError: _lambdifygenerated() missing 1 required positional argument: 'Pin'

My operator for my use case is the following:

# A simple MRR without graphene.
mrr_si_no_gr:
  base: OperatorTemplate
  equations:
    - "d/dt * a = Pin^0.5"
    - "d/dt * n = - n / tau + abs(a)^4."
  variables:
    a: output(0.0 + 0.0j)
    n: variable(1000000000000.0)
    Pin: input(0.0)
    tau: 0.0
    n_kerr: 0.0
    theta_fcd: 0.0
    gamma_fca: 0.0
    alpha_tpa: 0.0
    i: 0.0+1.0j

# A simple node with a single MRR.
MRRNODE:
  base: NodeTemplate
  operators:
    - mrr_si_no_gr

# Example circuit for Aashu's paper.
AASHU:
  base: CircuitTemplate
  nodes:
    mrr: MRRNODE
  edges:

And my current Python code is the following:

from pycobi import ODESystem
import numpy as np
import matplotlib.pyplot as plt

ode = ODESystem.from_yaml(
    "aashu/AASHU",
    working_dir="target/",
    auto_dir="~/auto-07p",
    node_vars={
        "mrr/mrr_si_no_gr/Pin": 19.54,
    }
)

Note that Aashu is a reference to the file name I gave to my YAML file since I am trying to recreate a paper from Aashu Jha, et al. I should also mention that this is a somewhat minimal reproduction example because the actual rate equations are much longer and more complicated.

As far as I know, I am using the latest version of the library, of auto-07b, and Python 3.10.14.

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.