Pendulum Wave

We started off by creating a sketch in processing that mimicked the oscillations of the pendulums. This gave us a rough idea of what we intended on building eventually, although the number of oscillations was skewed. Credit for the base idea of the code goes to Casper van Bavel. We took his initial processing sketch of a pendulum wave and edited it to fit our model and also “beautified” it a bit.

 

Pendul [] p;

PImage bground;

int amount = 15;

void setup(){
smooth();
size(500,500);
p= new Pendul[amount];
for (float i=0;i<amount;i++){
p[int(i)]=new Pendul(0.003*i+0.004,5*i);
}
fill(#EA0E0E);
bground = loadImage("Background.jpg");

}

void draw(){
background(bground);
for (int i=0;i<amount;i++){
p[i].osc();
p[i].display();
}
saveFrame("wave####.jpg");
}


class Pendul
{
float angle;
float speed,posy;

Pendul(float speed_,float posy_){
angle=0;
posy=posy_*6.7+15;
speed=speed_;
}
void osc()
{
angle+=speed;
}
void display()
{
float w = (cos(angle)+1)*.5;
ellipse(w*width,posy,25,25);
}
}

 

 

Then when shifting the idea over to an actual model, we had to increase the amount of oscillations that the pendulums completed to fit the size of our model.

The only property that effects a pendulum’s period is the length of its string.  So for a pendulum wave to work, you need to find the proper lengths for each string.  We found this using two formulas for period:

1.) Period=(t)/(N+n)   and   2.) Period=2π√(l/g)

where: t=total time (60 seconds), N=number of oscillations/cycles for longest string (51 cycles), n=n-th pendulum (starting from 0 cycles), l=length of longest pendulum (m) and g=9.8m/s^2.

Since the unit for period is seconds/cycle, the first formula can be used– time/cycles.  From this, you can find the period.  Plug this value into the second formula to find the length for each of the strings.  We got these formulas from Paul Liu.

We started off by using 15 pendulums, but had some difficulty keeping the string untwisted.  So in the end we ended up having 8 pendulums anchored at 2 points each to negate the twisting string.

 

 

Creators: Kerry “Ker Bear” Meehl and Hayden “Fletch” Fitzgerald

Works cited:

http://hippomath.blogspot.com/2011/06/making-your-own-pendulum-wave-machine.html

http://www.openprocessing.org/sketch/95419

 

Published

Updated

Author

MKerry

Comments