Sunday, April 18, 2010

Hockey Stick in Harmonic Motion

Hey everyone - paste this code into a Visual Python window to see a hockey stick oscillating in harmonic motion.


from __future__ import division # makes sure is decimal and not integer
from visual import *
from visual.graph import * # graphing capability
scene.title = 'Simple Harmonic Motion with "Hockey Stick"'
pendulum = frame()
foot = box(frame = pendulum, pos = (.0885,.009,0), length=.15, height=.018, width=.006, color = (.5, .5, .5), materials = materials.marble)
stick = box(frame = pendulum, pos = (.0135,.518,0), length=.027, height=1, width = .006, color=color.orange, material=materials.wood)
#distance from top of hole to top end of stick
dhole = .001
#starting position
startAngle = 10
theta = math.radians(startAngle)
pendulum.rotate(angle = theta, axis = (0,0,1), origin = (0.5*stick.length, stick.height + foot.height - dhole ,0))
angVel = 0
angAcc = 0
# masses
foot.mass = .178
stick.mass = .129
# moments
xcmLength = (foot.mass*(0.5*foot.length + 0.5*stick.length) + stick.mass*(0.5*stick.length))/(stick.mass + foot.mass)
ycmLength = (foot.mass*(0.5*foot.height) + stick.mass*(0.5*stick.height + foot.height)) / (foot.mass + stick.mass)
stick.I = ((1/12)*stick.mass*stick.height*stick.height + stick.mass*(0.5*stick.height - dhole)*(0.5*stick.height - dhole))
foot.I = ((1/3)*foot.mass*foot.length*foot.length + foot.mass*(stick.height - dhole + 0.5*foot.height)*(stick.height - dhole + 0.5*foot.height))
I = stick.I + foot.I
#set up angle graph
graph1 = gdisplay(x=150, y=600, width=400, height=300,
title='Angle vs. Time', xtitle='time (s)', ytitle='angle (rad)',
xmax=10., xmin=0., ymax=1.1*theta, ymin=-1.1*theta,
foreground=color.black, background=color.white)
acurve = gcurve(gdisplay = graph1, color = color.black)
#time
time = 0
dt = 0.01
while True:
rate(100)
time += dt
gravTorque = -1 * math.pow((xcmLength - 0.5*stick.length)*(xcmLength - 0.5*stick.length) + (stick.height + foot.height - dhole - ycmLength)*(stick.height + foot.height - dhole - ycmLength), 0.5) * (foot.mass + stick.mass) * 9.8 * sin(theta)
angAcc = gravTorque / I
angVel += angAcc * dt
theta += angVel * dt
pendulum.rotate(angle = angVel * dt, axis = (0,0,1), origin = (0.5*stick.length, stick.height + foot.height - dhole ,0))
acurve.plot(pos = (time, theta))

Friday, February 12, 2010

Engine Success!

After weeks of preparation, hours of lunch periods lost to assembly, we have finally completed our sterling engine. Our engine was surprisingly cooperative, working essentially on our first try with little troubleshooting necessary. Here's the video

Monday, February 8, 2010

Circuits Lab















Today we experimented with a slightly different physical discipline: electricity. To illustrate principles of voltage difference and magnetic induction, we examined three scenarios: a "lemon battery," a solar-powered battery, and a hand-crank power generator.



The "lemon battery" demonstrates the the concept of charge polarization due to a chemical reaction. Basically, the reaction consists of the lemon's acid "pulling electrons" from the valence shells of the copper penny. The zinc screw, which is a better conductor than the copper penny, then "accepts" the copper's electrons. This polarization creates a voltage difference similar to that of a battery, in which current flows from a positive voltage, here about 0.2 V, to a negative voltage, here about zero. The natural and fairly low resistance of the voltmeter keeps the system from short-circuiting.


















The solar panel exhibit demonstrates, like the "lemon battery," a battery involving a voltage drop. Basically, the solar panel consists of impure silicon in both P and N forms together to create a semiconductor. Energy from sunlight in the form of heat creates "holes" of positivity in the silicon crystal. In an attempt to fill these holes, electrons rush from the N-type region of the silicon to the P-type, where the predominance of positivity "holes" exist. This electric surge creates a natural charge barrier between the N-types and P-types, as the electrons rushing to the positive side exert a repulsive electric force on the rest of the electrons in the N-type region. This polarization effect creates a small voltage difference similar to a battery.






The third and final demonstration was a hand-cranked induction generator. The basic form consisted of a coiled wire attached to a hand-crank surrounded by magnets. By the equation for magnetic inductance, emf = -N(d"flux"/dt), we know that a change in magnetic flux generates a voltage difference. In this scenario, a change in flux is generated by altering the angle, through the movement of the hand-crank, of the wire with respect to the magnetic field. The voltage difference generated induces a current powering the light bulb. When the circuit is incomplete, or switched to "off," the crank is easier to turn because there is no resistor. However, switching the circuit "off" disables the light bulb by removing the resistance. This concept of voltage induction through a magnetic field's influence on a coiled wire is similar to the situation in a solenoid.

Sunday, February 7, 2010

Here we have a rudimentary display of our engine. It is able to function for a brief amount of time, but has a low efficiency and tends to dissipate input energy rather quickly. Possible points of improvement: 1) decrease friction through lubrication 2) apply a protective layer to counteract air escape 3) add more input heat - this, however, will not make the engine any more efficient.



AMDG

Monday, February 1, 2010

Gas Model Python

Pasting this code into Visual Python will create a 3D simulation of our Stirling Engine, with visible gas molecules moving in random paths in a region of the pressure vessel below the displacer.

from visual import *
home = cylinder(pos=(0,-2.5,0), axis=(0,5,0), radius=3, color=color.cyan, opacity=0.2)
displacer = cylinder(pos=(0,1.5,0), axis=(0,1,0), radius=2.9, color=color.blue, opacity=1)
ball1 = sphere(pos=(0,0,0), radius=0.1, color=color.yellow)
ball1.velocity = vector(20,20,20)
ball2 = sphere(pos=(0,1.2,2), radius=0.1, color=color.red)
ball2.velocity = vector(20,-20,20)
ball3 = sphere(pos=(-2,-2.3,0), radius=0.1, color=color.green)
ball3.velocity = vector(20,20,20)
ball4 = sphere(pos=(0.9,1.4,-2), radius=0.1, color=color.magenta)
ball4.velocity = vector(20,-20,20)
ball5 = sphere(pos=(-1.0,0.5,2), radius=0.1, color=color.orange)
ball5.velocity = vector(20,-20,20)
ball6 = sphere(pos=(0,1,-0.9), radius=0.1, color=color.blue)
ball6.velocity = vector(-20,20,20)
ball7 = sphere(pos=(2.1,-1,0.5), radius=0.1, color=color.white)
ball7.velocity = vector(20,20,-20)
ball10 = sphere(pos=(2.3,-0.3,1.7), radius=0.1, color=color.cyan)
ball10.velocity = vector(20,-20,20)
ballA = sphere(pos=(2.3,1.7,1.7), radius=0.1, color=color.blue, opacity=0.5)
ballA.velocity = vector(-20,20,-20)
ballB = sphere(pos=(-0.3,-0.4,0.9), radius=0.1, color=color.orange, opacity=0.5)
ballB.velocity = vector(20,20,20)
deltat = 0.005
t = 0
while True:
rate(100)
ball1.pos = ball1.pos + ball1.velocity*deltat
ball2.pos = ball2.pos + ball2.velocity*deltat
ball3.pos = ball3.pos + ball3.velocity*deltat
ball4.pos = ball4.pos + ball4.velocity*deltat
ball5.pos = ball5.pos + ball5.velocity*deltat
ball6.pos = ball6.pos + ball6.velocity*deltat
ball7.pos = ball7.pos + ball7.velocity*deltat
ball10.pos = ball10.pos + ball10.velocity*deltat
ballA.pos = ballA.pos + ballA.velocity*deltat
ballB.pos = ballB.pos + ballB.velocity*deltat
if sqrt(math.pow(ball1.pos.x, 2) + math.pow(ball1.pos.z, 2))>home.radius:
ball1.velocity.x=-ball1.velocity.x
ball1.velocity.z=-ball1.velocity.z
if ball1.pos.y < -1.5:
ball1.velocity.y = -ball1.velocity.y
if ball1.pos.y > 1.5:
ball1.velocity.y = -ball1.velocity.y
if sqrt(math.pow(ball2.pos.x, 2) + math.pow(ball2.pos.z, 2))>home.radius:
ball2.velocity.x=-ball2.velocity.x
ball2.velocity.z=-ball2.velocity.z
if ball2.pos.y < -1.5:
ball2.velocity.y = -ball2.velocity.y
if ball2.pos.y > 1.5:
ball2.velocity.y = -ball2.velocity.y
if sqrt(math.pow(ball3.pos.x, 2) + math.pow(ball3.pos.z, 2))>home.radius:
ball3.velocity.x=-ball3.velocity.x
ball3.velocity.z=-ball3.velocity.z
if ball3.pos.y < -1.5:
ball3.velocity.y = -ball3.velocity.y
if ball3.pos.y > 1.5:
ball3.velocity.y = -ball3.velocity.y
if sqrt(math.pow(ball4.pos.x, 2) + math.pow(ball4.pos.z, 2))>home.radius:
ball4.velocity.x=-ball4.velocity.x
ball4.velocity.z=-ball4.velocity.z
if ball4.pos.y < -1.5:
ball4.velocity.y = -ball4.velocity.y
if ball4.pos.y > 1.5:
ball4.velocity.y = -ball4.velocity.y
if sqrt(math.pow(ball5.pos.x, 2) + math.pow(ball5.pos.z, 2))>home.radius:
ball5.velocity.x=-ball5.velocity.x
ball5.velocity.z=-ball5.velocity.z
if ball5.pos.y < -1.5:
ball5.velocity.y = -ball5.velocity.y
if ball5.pos.y > 1.5:
ball5.velocity.y = -ball5.velocity.y
if sqrt(math.pow(ball6.pos.x, 2) + math.pow(ball6.pos.z, 2))>home.radius:
ball6.velocity.x=-ball6.velocity.x
ball6.velocity.z=-ball6.velocity.z
if ball6.pos.y < -1.5:
ball6.velocity.y = -ball6.velocity.y
if ball6.pos.y > 1.5:
ball6.velocity.y = -ball6.velocity.y
if sqrt(math.pow(ball7.pos.x, 2) + math.pow(ball7.pos.z, 2))>home.radius:
ball7.velocity.x=-ball7.velocity.x
ball7.velocity.z=-ball7.velocity.z
if ball7.pos.y < -1.5:
ball7.velocity.y = -ball7.velocity.y
if ball7.pos.y > 1.5:
ball7.velocity.y = -ball7.velocity.y
if sqrt(math.pow(ball10.pos.x, 2) + math.pow(ball10.pos.z, 2))>home.radius:
ball10.velocity.x=-ball10.velocity.x
ball10.velocity.z=-ball10.velocity.z
if ball10.pos.y < -1.5:
ball10.velocity.y = -ball10.velocity.y
if ball10.pos.y > 1.5:
ball10.velocity.y = -ball10.velocity.y
if sqrt(math.pow(ballA.pos.x, 2) + math.pow(ballA.pos.z, 2))>home.radius:
ballA.velocity.x=-ballA.velocity.x
ballA.velocity.z=-ballA.velocity.z
if ballA.pos.y < -1.5:
ballA.velocity.y = -ballA.velocity.y
if ballA.pos.y > 1.5:
ballA.velocity.y = -ballA.velocity.y
if sqrt(math.pow(ballB.pos.x, 2) + math.pow(ballB.pos.z, 2))>home.radius:
ballB.velocity.x=-ballB.velocity.x
ballB.velocity.z=-ballB.velocity.z
if ballB.pos.y < -1.5:
ballB.velocity.y = -ballB.velocity.y
if ballB.pos.y > 1.5:
ballB.velocity.y = -ballB.velocity.y

Sunday, January 31, 2010

Tips and Tricks

While building our engine thus far we have not followed the instructions exactly as they are written. We have come up with some helpful nuances that could aid others this year, as well as future students, in building their engines. I would like to open up this post as a sort of running dialogue for the new ideas we come up with.

So far we have made some adjustments:

- Instead of worrying about the exact center for the pressure vessel top and displacer top, guesstimate on one. What really matters, and why the instructions seem to call for "exact center" is so the two line up. But if you put a hole in one first and then use that hole to line up your next hole, you have the two lined up for a guaranteed match so as to avoid friction.

- The needles are hard to bend, so JB weld your needle inside the bottom of the displacer top with the eye of the needle underneath but with the whole needle vertical. The width of this is greater than the rest of the needle so it shouldn't puncture through all the way and the JB weld shouldn't break.

- Drilling and welding both the crankshaft support and the pressure vessel to the elbow joint increases the space for a leak and error. If you cut one of the crankshaft supports shorter you can mount it above the elbow joint and then you only have to worry about sealing it to one surface.

Feel free to point out any flaws with these adjustments. I just see this as a running list of ideas that we can bounce off of one another. Let me know your thoughts.

Third Entry: Final Preparations

Over the past few weeks Mike and I have worked diligently on our engine. We have spent every lunch period in the physics lab for the past week and a half finishing all the prep work for our engine and at last we are ready to assemble. This coming Monday we will begin assembling all the pieces of our engine so we can test it soon.

I have included some photos, as well as a short video clip of a basic test of our engine's pressure vessel construction.

Displacer:
We put a needle through the exact center of our displacer top and JB welded it in place. We then
JB welded the displacer top onto the displacer bottom. We attempted to weld it from the inside, but some of the epoxy was squeezed over the edge and ended up on the outside of our displacer. To eliminate this and thus minimize friction, we sanded
the edges of the bond until
the glue became flush with the surface of the can itself. We also checked for any tiny gaps, resealed them with JB Weld, and sanded again.




Pressure Vessel Top:

Our pressure vessel top will be what seals off the engine. We first put a whole in the center of our vessel top. We realized that more important than being the exact center, the pressure vessel top simply needs to be centered on the displacer to minimize friction. Thus, we used our displacer top to line up and punch the hole. Next, to make it air tight, we used a small washer and a small square of tin to create an air tight chamber around the whole in our pressure vessel top. Next we punched another whole through the tin part of the chamber. This creates a tighter seal that prevents air from escaping our engine. However, we also had to work the needle to slightly widen the hole so that there would be no friction when the displacer pin slid through the pressure vessel top. We attached all these parts using an RTV gasket sealant.


Crank shaft:

The crankshaft is what translates the lateral motion of the displacer into the angular motion of the flywheel. The width of it's bends are extremely important because they dictate the range of motion of the displacer. Therefore, it must be very precise if we want out engine to work. Note though: the angle of the individual bends is not extremely significant, what matters is that the widths of the bends are correct, and that the two bends are exactly 90 degrees out of phase.




Crank shaft supports:


These are simply attached to the pressure vessel to hold the crankshaft in place. Notice that instead of following the instructions and making two equal length supports, we cut one shorter so that we would not have to drill a whole and both attach our elbow joint to the support and the support to the pressure vessel. This decreases the odds of a leak.




Elbow Joint:

The PVC elbow joint with a balloon will inflate as hot air rises. The balloon is then attached to the crankshaft, causing it to rotate the flywheel.










A quick video of how it all works:

This video demonstrates simply the lateral motion of the displacer in our pressure vessel to test how well it will work. We saw that friction really is not much of an issue.