Skip to content
ZiaeemehrPublic

About

High-performance numerical continuation and bifurcation analysis library built on JAX for efficient dynamical systems analysis.

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

JaxCont

Differentiable continuation and bifurcation analysis in JAX.

Tests Documentation Status PyPI MIT License DOI Sponsor

JaxCont turns an equilibrium continuation sweep into a JAX program. Follow branches through folds with pseudo-arclength continuation, detect and refine fold/Hopf events, and compose the analysis with jax.jit, jax.vmap, and automatic differentiation.

📖 Read the full documentation

Why JaxCont?

  • Transform the whole analysis. Batch ensembles of branches with vmap and differentiate bifurcation locations for inverse design.
  • Stay on the branch. Adaptive pseudo-arclength continuation passes folds; natural continuation is available when the parameter remains regular.
  • See and validate the result. Plot stability-aware bifurcation diagrams and eigenvalue trajectories with JaxCont events plus MatCont, BifurcationKit, or analytic reference markers.

The current surface supports equilibrium and periodic-orbit continuation, their principal codimension-one events, direct codimension-two point solvers, two-parameter continuation (fold/Hopf curves with their own codimension-two events), and infinitesimal phase response curves (iPRC, prc_curve, cross-validated against MatCont) plus their parameter-derivative sensitivity (dPRC, dprc_curve, validated independently -- MatCont does not compute this quantity). Equilibrium branch switching (BP, branch_switch) and period-doubling switching (branch_switch_pd) are shipped. General connecting-orbit/BVP workflows remain future work.

Cubic S-curve: JaxCont vs MatCont 7.6, folds overlaid

JaxCont's branch (blue) traced independently over MatCont 7.6's reference (orange) — more cases, including known limitations, in the MatCont validation suite.

Installation

JaxCont requires Python 3.11 or newer.

pip install jaxcont

See the JAX installation guide when selecting CPU, GPU, or TPU support.

Using on Google Colab: !pip install jaxcont, then upload a notebook from the example gallery and run it. pip may also print a dependency conflict warning about numba needing an older numpy than the one JAX pulls in - this is expected and safe to ignore unless your notebook separately uses numba.

Quick start

Continue u² + p = 0 through its fold at p = 0:

import jax.numpy as jnp
import matplotlib.pyplot as plt
import jaxcont as jc

def saddle_node(u, p, args):
    return u**2 + p

problem = jc.bif_problem(
    saddle_node,
    u0=jnp.array([1.0]),
    p0=-1.0,
    state_names=["u"],
    param_name="p",
)

result = jc.continuation(
    problem,
    p_span=(-1.0, 0.2),
    settings=jc.ContinuationPar(ds=0.03, max_steps=200),
    events=[jc.Fold()],
)

print([(event.kind, event.p) for event in result.events])
result.plot(annotate=True, title="Saddle-node bifurcation")
plt.show()

The same result can drive a stability-spectrum plot:

from jaxcont.viz import plot_eigenvalues

plot_eigenvalues(result, shade_stability=True)

Explore

Development

git clone https://github.com/Ziaeemehr/JaxCont.git
cd JaxCont
python -m pip install -e ".[dev]"
python -m pytest

Contributions are welcome; see CONTRIBUTING.md, the roadmap, and the MatCont validation suite.

Citation

If JaxCont supports your research, please cite the archived release. Full citation metadata (including both DOIs) is in CITATION.cff -- GitHub renders a "Cite this repository" button from it automatically.

@software{ziaeemehr_jaxcont_2026,
  author  = {Ziaeemehr, Abolfazl},
  title   = {JaxCont: Differentiable Continuation and Bifurcation Analysis in JAX},
  year    = {2026},
  version = {0.4.0},
  doi     = {10.5281/zenodo.22035548},
  url     = {https://github.com/Ziaeemehr/JaxCont}
}

JaxCont is distributed under the MIT License.

Continuation supports jit, vmap and forward-mode jacfwd. For reverse-mode jax.grad, pass ContinuationPar(loop="scan") (the default is "while"). The scan uses a fixed attempt budget and masks inactive iterations. Derivatives follow the locally selected branch and acceptance decisions. See the transformation matrix for tested coverage.

About

High-performance numerical continuation and bifurcation analysis library built on JAX for efficient dynamical systems analysis.

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages