- So far, I've lost about 55 lbs. That's 4 or 5 pant sizes, I think, plus now my winter coat doesn't fit anymore. Naturally my workplace has NOW decided to have a Biggest Loser contest. I could have won one of these fabulous prizes! I'm almost tempted to regain it all so I can lose it for the free iPhone. (Actual prize may vary.)
- The PVC piston idea doesn't work. Or rather, it works really well, but not for high temperatures. Maybe a water pumping thing might work, but otherwise it just gets gummed up with melty yuck. Also using insulation for the displacer is contraindicated as a fire hazard. /turns off smoke alarm. Needless to say, the engine was unsalvageable.
- Because of the above, I'm starting a new engine. For various reasons, probably all stupid, I'm thinking of going rhombic. I sat down the other day to quickly figure out the stroke length given stuff like the gear diameter. Just an easy little geometry problem until my face imploded. Also, finding cots (commercial/off-the-shelf) hardware that can be used for a medium-sized Stirling is non-trivial.
- This cool thing is in free beta. I hope that doesn't mean they are going to charge for it later, because then we won't have future classics like Two Regular Guys.
- I got a Moleskine "square" (i.e. graph) paper notebook for Christmas. Coupled with my mechanical drawing pencils, it is really awesome. I should post some pics of what I've been doing with it.
- Read Clock of the Long Now. It was very interesting and enlightening and life-changing and so forth, but they left out sufficient detail for my geekiness: Details on the mechanism. It's a single-function, mechanical, binary computer. Like the Difference Engine only in binary. Should be a snap to implement in Lego. I even started designing it but I just don't have enough time to do more than that.
Tuesday, January 6, 2009
Incremental Backup
Monday, September 17, 2007
A New Recipe for π
I've made some progress, but my (borrowed) video camera is being cranky so I've been unable to record and post it. (Aside to person I borrowed it from: I'm just getting a black screen in record mode. Also a little red flashing light that I think is the button battery so I thought that was it. However recording suddenly started work despite that, but only for a few minutes. ???) Thus this post isn't about that.
When the Difference Engine actually is running, I thought it would be fun to have it calculate π. NO WAIT, LET ME FINISH!!! I know π is transcendental, meaning there is no polynomial for which π is the solution.
The point of the Difference Engine is that as you crank the handle, you calculate the value of the polynomial for higher and higher values of x. What I'd like is a polynomial such that for higher and higher x, the value is closer and closer to π.
So I just google for a polynomial that does that, right? I mean, there must be hundreds of them by now. No. There are none that I can find.
There are plenty of series approximations, however. For instance:
π = 1/1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 +....
And with some series...es, it's possible to come up with an expression that the series sums to up to any given point. For instance, the sum of the first n odd numbers:
1 + 3 + 5 + 7 + .... 2n-1 = n2
So maybe one of the series approximations of π can be manipulated into a polynomial. Then I can use the Lego Difference Engine on that polynomial and crank out 2 or 3 digits.
However, I'm having a great deal of trouble with this (not that that indicates anything other than the fact that I'm really not that great at math). For one thing, I've concentrated my efforts on the simple-to-remember 1/1 - 1/3 + 1/5 approach. But I just realized this morning that this series alternately overshoots and undershoots the target, meaning it has an infinite number of humps and valleys. A polynomial of degree n can have a maximum of n-1 humps and valleys, AFAIK, so that series is out.
If I'm going to start from a series, I need one that's always more or less than π and never the other. Or an entirely different idea. I can think of plenty of iterative methods, but that's basically just a series. I need a single step where the accuracy is chosen by the value of x I input. Since I haven't been able to find any reference to such a thing, I'm thinking it hasn't ever been done. Is that because it's impossible?
Monday, August 27, 2007
Difference Engineering
First of all, the basic idea: The purpose of the Difference Engine was to pre-calculate tables of polynomials for books in the days before portable calculators. So you'd want to known 3x3 + 14x2 + 5 for all values of x from 1 to, say, 1000. As it happens, there's a clever little shortcut such that if you have a few values you can calculate the next one very simply using only addition from the previous answer (thus "Difference Engine").
So let's say f(x) = x2 + 3x.
x f(x) diff1 diff2 1 4 - - 2 10 6 - 3 18 8 2 4 28 10 2 5 40 12 2See that second difference column is a constant. If we'd picked a polynomial of the 3rd degree, we'd have to work this out to the 3rd column. Fourth degree, 4th column, etc.
So to build a machine, all you need to do is set the value for x = 1 and set the Nth difference in the last column. It automatically adds that difference to the previous difference, which is cascaded upwards until f(x + 1) is arrived at. Then you go around again. All that is required is simple addition.
What isn't explained on that page (that I saw) was how to know ahead of time what that last difference is going to be. Sure, you can work out N rows to get that Nth column, but it would be nice if you could set the inputs from direct inspection of the polynomial. As a matter of fact, this is easy.
Say f(x) = ax2 + bx + c. Then the difference between two successive answers (i.e. the value in the first difference column) is going to be:
a(x+1)2 + b(x+1) + c - ax2 - bx - c
= ax2 + 2ax + a + bx + b + c - ax2 - bx - c
= 2ax + a + b
The difference between successive entries in THAT column are going to be:
2a(x+1) + a + b - 2ax - a - b
= 2ax + 2a + a + b - 2ax - a - b
= 2a
And if we look at our example, we did indeed get 2 * 1 as the constant in the last column.
Working this out for a 3rd degree polynomial gives 6a (where a is the coefficient of x3). Based on these two examples and looking at Pascal's Triangle, I predicted the value for a 4th degree would be 20. But it was actually 24.
In fact, if you work it out it should be clear that the constant difference will be a * n!, where a is the coefficient of the highest power of x and n is that power. It should be simple to prove this using induction, since all other terms always drop out and you muliply the coefficient by the power at each step on the way down.
So if I wanted to know what the constant difference was in the 5th column of differences for the polynomial 8x5 - 3x3 + 117, I just multiple 8 times 5! and get 960. I cram that, plus the initial value for x = 1 onto the machine and get cranking.