Chalkboard - v3.0.1
    Preparing search index...

    Function phase

    • Returns phase-plot data from a solution of an ODE (pairs of components). Useful for plotting trajectories such as (y, dy), (x, y), (x, z), etc.

      Parameters

      • sol: { t: number[]; y: number[][] }

        Solution of an ODE

      • i: number

        The first component index

      • j: number

        The second component index

      Returns number[][]

      // Phase plot of harmonic oscillator (y vs dy)
      const ode = Chalkboard.diff.harmonic();
      const sol = Chalkboard.diff.solve(ode, { t0: 0, t1: 20, steps: 2000, y0: { y0: 1, dy0: 0 } });
      const data = Chalkboard.diff.phase(sol, 0, 1);