Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D bifurcation for 3+ D dynamical systems #629

Open
2 tasks done
nosratullah opened this issue Feb 21, 2024 · 3 comments
Open
2 tasks done

2D bifurcation for 3+ D dynamical systems #629

nosratullah opened this issue Feb 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@nosratullah
Copy link

nosratullah commented Feb 21, 2024

Hi, Thanks for the awesome software.
I was wondering if there's a way to do 2D bifurcation on more than 2D dynamical systems in your software.

Please:

  • Check for duplicate requests.
    I checked that there's an example for FastSlow2D systems which indeed it provided bifurcation analyzing for 3D system, but the problem is that it's still reduces the dimension of the system to 2D (probably with time-scale separation methods).
    And more importantly, (I think) it only allows you to set one of the variable (dimensions) as the control parameter which is not desired.
  • Describe your goal, and if possible provide a code snippet with a motivating example.
@bp.odeint
def int_x(x, t, y, z, Iext, a):
    return F(x,y,z, Iext, a)

@bp.odeint
def int_y(y, t, x, z, Iext, a):
    return G(x,y,z, Iext, a)
@bp.odeint
def int_z(x, t, x, y, Iext, a):
    return H(x,y,z, Iext, a)

analyzer = bp.analysis.Bifurcation2D(
    model = [int_x, int_y, int_z],
    target_vars=dict(x=[-3, 3], y=[-3., 3.], z=[-3, 3]),
    target_pars=dict(a=[0.5, 1.], Iext=[0., 1.]),
    resolutions={'a': 0.01, 'Iext': 0.01},
)
analyzer.plot_bifurcation(num_rank=10, tol_aux=1e-9)
analyzer.show_figure()

Another example which I guess it's more common to use is analyzing the 2D bifurcation diagram of 4D Hodgkin-Huxley model . Maybe with this example I can rephrase my question which is can we perform low-dimensional bifurcation analysis on high-dimensional dynamical system with your software?
Many thanks.

@nosratullah nosratullah added the enhancement New feature or request label Feb 21, 2024
@chaoming0625
Copy link
Collaborator

This is a good question. I will show you inspirational examples, and their limitations.

@nosratullah
Copy link
Author

Great!
Maybe a good example is provided in this link with PyDSTool. It is a 4D predator-prey system with 2D bifurcation analysis.

@chaoming0625
Copy link
Collaborator

Currently, brainpy does not implement the continuation analysis. However, we can do bifurcation analysis using fast-slow bifurcation analysis: fixing one variable first, then do bifurcation analysis of two remaining variables. For your cases, we can use:

@bp.odeint
def int_x(x, t, y, z, Iext, a):
    return F(x,y,z, Iext, a)

@bp.odeint
def int_y(y, t, x, z, Iext, a):
    return G(x,y,z, Iext, a)
@bp.odeint
def int_z(x, t, x, y, Iext, a):
    return H(x,y,z, Iext, a)

analyzer = bp.analysis.FastSlow2D(
  [int_x, int_y, int_z],
  fast_vars={'x': [-3, 3], 'y': [-3., 3.]},
  slow_vars={'z': [-3., 3.]},
  pars_update={'a': 0.5, 'Iext': 0.5},
  resolutions={'a': 0.01, 'Iext': 0.01}
)
analyzer.plot_bifurcation(num_rank=20)
analyzer.show_figure()

Hoping this message can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants