nth harmonic = 2
Amplitude = 50
Time Period = 1
Standing Wave
Here is a Standing Wave Simulation in ChelseaJS. Helps understand how Standing wave actually move.
Standing wave, also called Stationary wave, combination of two waves moving in opposite directions, each having the same amplitude and frequency. The phenomenon is the result of interference; that is, when waves are superimposed, their energies are either added together or canceled out
Code
elem=document.querySelector(".example-container");
setCanvas(elem);
t=0;
function draw(){
nh=document.getElementById("nharm").value;
amp=document.getElementById("amp").value;
timep=document.getElementById("timep").value;
clearCanvas();
points=[]
for(i=0;i<WIDTH;i++){
x=mapRange(i,0,WIDTH,WIDTH/4,3*WIDTH/4);
y=2*amp*sin(i*nh*PI/(1*WIDTH))*cos(t*2*PI/timep)
points.push([x,HEIGHT/2+y]);
}
new circle(WIDTH/4,HEIGHT/2,5,'#695fe6',0.7,'#695fe6',2);
new circle(3*WIDTH/4,HEIGHT/2,5,'#695fe6',0.7,'#695fe6',2);
new polygon(points,'#695fe6',0,'#695fe6',3,false);
t+=0.01;
requestAnimationFrame(draw);
}
draw();
document.getElementById("nharm").addEventListener("input",function(){
document.getElementById("nhval").innerHTML=this.value;
});
document.getElementById("amp").addEventListener("input",function(){
document.getElementById("aval").innerHTML=this.value;
});
document.getElementById("timep").addEventListener("input",function(){
document.getElementById("tval").innerHTML=this.value;
});