Lorenz system is a system of (non-linear) ordinary differential equations.
\begin{aligned}
\dot{x} &= \sigma(y-x)\\
\dot{y} &= x(\rho-z)-y\\
\dot{z} &= xy-\beta z
\end{aligned}
Here \sigma,\rho,\text{ and }\beta are system parameters.
delayTS =function (ts, delay =1, dim =2) {return ts.map((d, i) => {const out = [];for (let j =0; j < dim; j++) out.push(ts[i + j * delay]);return out; });}lorenz =function ( [x, y, z] = [0,0,0], n =100, { sigma =10, r =28, b =8/3 } = {}) {let F =function (t, [x, y, z]) {return [sigma * (y - x), r * x - x * z - y, x * y - b * z]; };let s =new odex.Solver(3);let flow = [];for (let i =0; i < n; i++) { [x, y, z] = s.solve(F,0, [x, y, z],0.01).y; flow.push({ n: i,x: x,y: y,z: z }); }return flow;}lorenzData =lorenz([1,1,1],4000)odex =import("https://cdn.skypack.dev/odex");n = {let i =0;while (i <4000) {yield Promises.delay(10,++i); }}