generate
Functions:
| Name | Description |
|---|---|
double_pendulum | Generate double pendulum dynamics via forward Euler integration. |
to_xy | Convert double pendulum angles to Cartesian coordinates. |
lorenz | Generate a Lorenz system trajectory via forward Euler integration. |
mackey_glass | Generate a Mackey-Glass chaotic time series via forward Euler integration. |
double_pendulum
Section titled “double_pendulum”double_pendulum(m1: float, m2: float, L1: float, L2: float, g: float, X0: np.ndarray, dt: float, t_max: int)Generate double pendulum dynamics via forward Euler integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m1 | float | Mass of first pendulum. | required |
m2 | float | Mass of second pendulum. | required |
L1 | float | Length of first pendulum. | required |
L2 | float | Length of second pendulum. | required |
g | float | Gravitational acceleration. | required |
X0 | ndarray | Initial state (theta1, theta2, omega1, omega2) of shape (4,). | required |
dt | float | Integration time step. | required |
t_max | int | Maximum time. | required |
Returns:
| Name | Type | Description |
|---|---|---|
t | ndarray | Time array. |
X | ndarray | State trajectory of shape (N, 4). |
to_xy(L1: float, L2: float, theta1: np.ndarray, theta2: np.ndarray)Convert double pendulum angles to Cartesian coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
L1 | float | Length of first pendulum. | required |
L2 | float | Length of second pendulum. | required |
theta1 | ndarray | Angle of first pendulum. | required |
theta2 | ndarray | Angle of second pendulum. | required |
Returns:
| Name | Type | Description |
|---|---|---|
x1 | ndarray | x-coordinate of first pendulum. |
y1 | ndarray | y-coordinate of first pendulum. |
x2 | ndarray | x-coordinate of second pendulum. |
y2 | ndarray | y-coordinate of second pendulum. |
lorenz
Section titled “lorenz”lorenz(sigma: float, rho: float, beta: float, X0: np.ndarray, dt: float, t_max: int)Generate a Lorenz system trajectory via forward Euler integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma | float | Prandtl number (typical: 10). | required |
rho | float | Rayleigh number (typical: 28). | required |
beta | float | Geometric factor (typical: 8/3). | required |
X0 | ndarray | Initial condition of shape (3,). | required |
dt | float | Integration time step. | required |
t_max | int | Maximum time. | required |
Returns:
| Name | Type | Description |
|---|---|---|
t | ndarray | Time array. |
X | ndarray | Trajectory of shape (N, 3) for (x, y, z). |
mackey_glass
Section titled “mackey_glass”mackey_glass(tau: float, n: int, beta: float, gamma: float, x0: float, dt: float, t_max: int)Generate a Mackey-Glass chaotic time series via forward Euler integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tau | float | Delay parameter (typical: 17 for chaos). | required |
n | int | Nonlinearity exponent (typical: 10). | required |
beta | float | Feedback strength (typical: 0.2). | required |
gamma | float | Decay rate (typical: 0.1). | required |
x0 | float | Initial condition. | required |
dt | float | Integration time step. | required |
t_max | int | Maximum time. | required |
Returns:
| Name | Type | Description |
|---|---|---|
t | ndarray | Time array. |
x | ndarray | 1D time series. |