Skip to content

Poscidyn in a nutshell

Note

This project is in its early stages, some functionality is missing, some docs are missing and/or might not yet fully align with the (future) API. It is recommeded to use the quick example to get started and go from there.

Poscidyn is a Python toolkit based on JAX, designed to streamline and accelerate common workflows in nonlinear oscillator dynamics. It enables the simulation and visualization of (nonlinear) oscillators using experimentally realistic setups, supporting both time- and frequency-domain analyses.

Features include:

  • Frequency sweeping (forward and backward)
  • Vmappable (batched) frequency sweeping
  • Built-in models of (nonlinear) oscillators

Quick example

import poscidyn
import numpy as np

Q, omega_0, alpha, gamma = np.array([100.0]), np.array([1.00]), np.zeros((1,1,1)), np.zeros((1,1,1,1))
gamma[0,0,0,0] = 2.55
modal_forces = np.array([1.0])

driving_frequency = np.linspace(0.9, 1.3, 501)
driving_amplitude = np.linspace(0.1, 1.0, 10)

MODEL = poscidyn.NonlinearOscillator(Q=Q, alpha=alpha, gamma=gamma, omega_0=omega_0)
EXCITOR = poscidyn.OneToneExcitation(driving_frequency, driving_amplitude, modal_forces)

frequency_sweep = poscidyn.frequency_sweep(
    model = MODEL, excitor=EXCITOR,
) 

For who is Poscidyn?

If you want to know more for who Poscidyn could be a useful package, have a look at the For who is Poscidyn? page.

Credits where they are due

JAX: a Python library for accelerator-oriented array computation and program transformation, designed for high-performance numerical computing and large-scale machine learning.

Diffrax: JAX-based library providing numerical differential equation solvers.

Equinox: your one-stop JAX library, for everything you need that isn't already in core JAX.