xxxxxxxxxx
42
let i1 = 0;
let i2 = 0;
let i3 = 0;
let deltaT = 0.0001;
let t = 0;
let sc = 100;
let k = 0.5;
let wu = 1.01;
let gu = 100;
let wc = 1.1;
let gamma = 0.001;
function setup() {
createCanvas(400, 400);
background(250);
}
function draw() {
const u = gu * sin(wu * t)+100;
let y1 = i1 * (i2 + wc);
let y2 = i2;
let e = u - y1;
let ef = e * y2;
let w = wc + i3;
i1 += k * e - y2;
i2 += y1 * w;
i3 += gamma * ef;
t += deltaT;
translate(0, height / 2);
noFill();
stroke(0);
ellipse(frameCount, -sc*w, 1, 1);
line(0,-sc*wu,width,-sc*wu);
noStroke();
fill(255,0,0);
ellipse(width/4,100,abs(i1),abs(i1));
ellipse(2*width/4,100,abs(i2),abs(i2));
ellipse(3*width/4,100,abs(i3),abs(i3));
}