Calculator/Hamilton/lorenz.txt
2023-12-03 14:50:32 +01:00

29 lines
690 B
Text

let bc = {t:0.0, w:[0.0, 1.0, 10.0]}
const omega = 27.0;
const sigma = 10.0;
const beta = 8.0 / 3.0;
let pf = [
(q) => {
const x = q.w[0];
const y = q.w[1];
return sigma * (y - x);
},
(q) => {
const x = q.w[0];
const y = q.w[1];
const z = q.w[2];
return x * (omega - z) - y;
},
(q) => {
const x = q.w[0];
const y = q.w[1];
const z = q.w[2];
return x * y - beta * z;
},
];
let r = solve (0.01, 2000, bc, pf);
plot (r, {x:['t'], y:['w', 0]}, '#00ff00');
plot (r, {x:['t'], y:['w', 1]}, '#ff0000');
plot (r, {x:['t'], y:['w', 2]}, '#0000ff');
plot (r, {x:['w', 0], y:['w', 2]}, '#00ffff');
delete r.data; /* ukliď po sobě */