import { Equation, Step } from './types.js'; /** * Represents a system of differential equations. */ export declare class DifferentialSystem { private readonly dimensions; /** * Represents the actual differential equations within the system */ private readonly equations; /** * Initialize a new system of differential equations. * @param dimensions The number of equations in this system * @example * const system = new DifferentialSystem(3); // x, y, z */ constructor(dimensions: number); /** * Set a differential equation for a specific dimension. All differential equations must be set before solving. * @param dimension The 0-indexed dimension number to set the equation for * @param de The differential equation for this dimension must accept a global state vector ordered by dimension and derivative order * ``` * x, dx/dt, ..., d(i-1)x/dt(i-1), * y, dy/dt, ..., d(j-1)y/dt(j-1), * z, dz/dt, ..., d(k-1)z/dt(k-1), * ... (higher dimensions) * ``` * Where `i` is the highest order of `x` (dimension 0), `j` is the highest order of `y` (dimension 1) and `k` is the highest order of `z` (dimension 2) * @param ic Initial conditions for this dimension, ordered `x`, `dx/dt`, ..., `d(n-1)x/dt(n-1)` * @example * const sigma = 1; * const rho = 1; * const beta = 8 / 3; * const dx = (t, x, y, z) => sigma * (y - x); * const dy = (t, x, y, z) => x * (rho - z) - y; * const dz = (t, x, y, z) => x * y - beta * z; * system.setEquationFor(0, dx, 10); // x0 = 10 * system.setEquationFor(1, dy, 10); // y0 = 10 * system.setEquationFor(2, dz, 10); // z0 = 10 */ setEquationFor(dimension: number, de: Equation, ...ic: number[]): void; /** * Solve this system of differential equations from `t=0` to `t=tf` with timestep `dt`. * @param dt The timestep * @param tf The final time * @returns Square array with the first index being the 0-indexed dimension and second index being the time index, each entry contains the timestamp and all orders of derivatives * @example * const data = system.solve(1e-3, 4); */ solve(dt: number, tf: number): Step[][]; }