Thursday, October 08, 2009

Megacycles: The Screen Play


(define Time 0.5)

;
; sky dome
;
(define SKY (surface BLEND_TURBULENCE SURF_CONSTANT BUMP_FLAT SURF_CONSTANT BUMP_FLAT 0 1))

(define (skyDome) (scale 30 30 30 (move 0 3985 0
(scale 20 20 20 (shade SKY (rgb 0.1 0.3 0.9) (rgb 0.9 0.9 0.9)
(scale 0.05 0.05 0.05 (diff
(scale 4100 4100 4100 (sphere))
(scale 4000 4000 4000 (sphere))
))
))
)))


;
; quadric robot with parameterized joins
;

(define (Robot L_SHOULDER L_ELBOW R_SHOULDER R_ELBOW L_HIP L_KNEE R_HIP R_KNEE)
(bound (union
(bound (union ; head and trunk
(move 0 210 0 (rotate 20 '(0 0 1) (scale 32 48 32 (sphere))))
(move 0 160 0 (scale 20 40 20 (sphere))) ; neck
(move 0 120 15 (scale 30 40 55 (sphere))) ; chest and shoulders
(move 0 120 -15 (scale 30 40 55 (sphere)))
(move 0 80 0 (scale 30 80 50 (sphere))) ; abdomen and hip
(move 0 -50 0 (scale 35 35 55 (sphere)))
(move 0 34 0 (scale 25 25 35 (sphere)))
(move 0 17 0 (scale 25 25 35 (sphere)))
(move 0 0 0 (scale 25 25 35 (sphere)))
(move 0 -17 0 (scale 25 25 35 (sphere)))
))

; left arm
(bound (move 0 130 70 (rotate L_SHOULDER '(0 0 1) (union
; forearm and hand
(move 0 -110 0 (rotate L_ELBOW '(0 0 1) (union
(move 0 0 0 (scale 13 20 13 (sphere)))
(move 0 -50 0 (scale 12 50 12 (sphere)))
(move 0 -100 0 (scale 10 10 10 (sphere)))
(move 0 -120 0 (scale 12 25 6 (sphere)))
)))
; upper arm
(move 0 -55 0 (scale 23 55 16 (sphere)))
(move 0 -10 -10 (rotate -35 '(1 0 0) (scale 22 33 22 (sphere))))
))))

; right arm
(bound (move 0 130 -70 (scale 1 1 -1 (rotate R_SHOULDER '(0 0 1) (union
; forearm and hand
(move 0 -110 0 (rotate R_ELBOW '(0 0 1) (union
(move 0 0 0 (scale 13 20 13 (sphere)))
(move 0 -50 0 (scale 12 50 12 (sphere)))
(move 0 -100 0 (scale 10 10 10 (sphere)))
(move 0 -120 0 (scale 12 25 6 (sphere)))
)))
; upper arm
(move 0 -55 0 (scale 23 55 16 (sphere)))
(move 0 -10 -10 (rotate -35 '(1 0 0) (scale 22 33 22 (sphere))))
)))))

; left leg
(bound (move 0 -50 30 (rotate L_HIP '(0 0 1) (union
(move 0 -160 0 (rotate L_KNEE '(0 0 1) (union ; calf and foot
(move 0 0 0 (scale 20 20 20 (sphere)))
(move 0 -75 0 (scale 20 75 20 (sphere)))
(move 0 -150 0 (scale 20 12 12 (sphere)))
(move 20 -160 0 (scale 45 10 20 (sphere)))
)))
(move 0 -80 0 (scale 30 80 27 (sphere))) ; thigh
))))

; right leg
(bound (move 0 -50 -30 (scale 1 1 -1 (rotate R_HIP '(0 0 1) (union
(move 0 -160 0 (rotate R_KNEE '(0 0 1) (union ; calf and foot
(move 0 0 0 (scale 20 20 20 (sphere)))
(move 0 -75 0 (scale 20 75 20 (sphere)))
(move 0 -150 0 (scale 20 12 12 (sphere)))
(move 20 -160 0 (scale 45 10 20 (sphere)))
)))
(move 0 -80 0 (scale 30 80 27 (sphere))) ; thigh
)))))
))
)

;
; robot riding a unicycle
;
(define PI 3.14159265358979323846)
(define RTD 57.29577951308232087721)
(define (S angle)
(sin (* angle RTD))
)
(define (C angle)
(cos (* angle RTD))
)
(define (A angle)
(/ (atan angle) RTD)
)
(define (sqr x)
(* x x)
)

(define (unicyclist time)
(let* (
(s (* PI (- 2 time))) ; pedal angle (0-2 PI)
(f (* 0.8 (S s))) ; foot(z)
(g (* 0.8 (C s))) ; foot(y)
(h (- 5.33333 1)) ; height of hip joint
(l 2.66667) ; length of thigh (and calf)
(d (sqrt (+ (sqr (- h g)) (sqr f)))); dist foot to hip
(v (sqrt (- (sqr l) (/ (sqr d) 4)))); knee-chord dist
(a (A (* 2 (/ v d)))) ; internal angle
(k (* -360 (/ a PI))) ; knee angle (with thigh)
(c (A (/ f (- g h)))) ; external angle
(j (* 180 (/ (+ a c) PI))) ; hip angle

(s (+ s PI)) ; pedal angle (1-3 PI)
(f (* 0.8 (S s))) ; foot(z)
(g (* 0.8 (C s))) ; foot(y)
(h (- 5.33333 1)) ; height of hip joint
(l 2.66667) ; length of thigh (and calf)
(d (sqrt (+ (sqr (- h g)) (sqr f)))); dist foot to hip
(v (sqrt (- (sqr l) (/ (sqr d) 4)))); knee-chord dist
(a (A (* 2 (/ v d)))) ; internal angle
(n (* -360 (/ a PI))) ; knee angle (with thigh)
(c (A (/ f (- g h)))) ; external angle
(m (* 180 (/ (+ a c) PI))) ; hip angle

(le (+ 15 (* 15 (C (* (+ time 1) PI))))) ; left elbow
(ls (* 20 (C (* (+ time 1) PI)))) ; left shoulder
(re (+ 15 (* 15 (C (* time PI))))) ; right elbow
(rs (* 20 (C (* time PI)))) ; right shoulder
)
(move 0 -0.13662 0 (scale 0.5 0.5 0.5 (union
(move 0 -6.1666667 0 (scale 0.016667 -0.016667 -0.016667
(rotate 90 '(0 1 0)
(shade SURF_PLASTIC (rgb 1.5 0.65 .1)
(Robot ls le rs re j k m n)
)
)
))
(move 0 -1 0 (rotate 90 '(0 1 0)
(scale 1.27324 1.27324 0.1
(move 0 0 1 (cylinder))
)
))
)))
)
)

(define figure (def-prim (unicyclist Time)))
;
; generate peano-curve maze with recursive instancing
; D. P. Mitchell 90/06/09.
;

;
; Unit cell of peano-curve maze is slab with origin at O
; and three figures beginning at R0, R1, and R2. There are
; three varieties, where R2 goes forward, turns left, or
; turns right. The final location of R2 will then be F, L,
; or R respectively. The cycle time is 2 seconds.
;
; -2 2 6 10 14
; -2 +---------------------------L---+
;
; 0 O R0 R1 R2 F ----> Z axis
;
; 2 +---------------------------R---+
;

(define eF (def-prim
(bound (union
(move 0 32 6 (scale 2 32 8 (cube)))
(move 0 0 2 (velocity 0 0 2 (figure)))
(move 0 0 6 (velocity 0 0 2 (figure)))
(move 0 0 10 (velocity 0 0 2 (figure)))
))
))

(define eR (def-prim
(bound (union
(move 0 32 6 (scale 2 32 8 (cube)))
(move 0 0 2 (velocity 0 0 2 (figure)))
(move 0 0 6 (velocity 0 0 2 (figure)))
(move 2 0 10 (spin 45 '(0 1 0) (move -2 0 0 (figure))))
))
))

(define eL (def-prim
(bound (union
(move 0 32 6 (scale 2 32 8 (cube)))
(move 0 0 2 (velocity 0 0 2 (figure)))
(move 0 0 6 (velocity 0 0 2 (figure)))
(move -2 0 10 (spin -45 '(0 1 0) (move 2 0 0 (figure))))
))
))

;
; first order peano curves are just made out of edges
;
(define (clock1 turn) (def-prim (bound (union
(eR)
(move 0 0 12 (rotate 90 '(0 1 0) (eR)))
(move 12 0 12 (rotate 180 '(0 1 0) (turn)))
))))

(define clock1R (clock1 eR))
(define clock1F (clock1 eF))
(define clock1L (clock1 eL))

(define (counter1 turn) (def-prim (bound (union
(move 12 0 0 (eL))
(move 12 0 12 (rotate -90 '(0 1 0) (eL)))
(move 0 0 12 (rotate -180 '(0 1 0) (turn)))
))))

(define counter1R (counter1 eR))
(define counter1F (counter1 eF))
(define counter1L (counter1 eL))

;
; higher order peano curves are build out of edges and
; lower order curves
;
; six curves are needed at each order, three going clockwise
; and three counterclockwise and the figures turning left, right
; or going straight as they leave the curve.
;
(define (clockWise size quad1 edge1 quad2 edge2 quad3 edge3 quad4)
(def-prim (bound (union
(move 0 0 size (rotate 90 '(0 1 0) (quad1)))
(move 0 0 size (edge1))
(move 0 0 (+ 12 size) (quad2))
(move size 0 (+ 12 size) (rotate 90 '(0 1 0) (edge2)))
(move (+ 12 size) 0 (+ 12 size) (quad3))
(move (+ 12 size size) 0 (+ 12 size) (rotate 180 '(0 1 0) (edge3)))
(move (+ 12 size size) 0 0 (rotate -90 '(0 1 0) (quad4)))
)))
)

(define (counterWise size quad1 edge1 quad2 edge2 quad3 edge3 quad4)
(def-prim (bound (union
(move 0 0 size (rotate 90 '(0 1 0) (quad1)))
(move 0 0 (+ 12 size) (rotate 180 '(0 1 0) (edge1)))
(move 0 0 (+ 12 size) (quad2))
(move (+ 12 size) 0 (+ 12 size) (rotate -90 '(0 1 0) (edge2)))
(move (+ 12 size) 0 (+ 12 size) (quad3))
(move (+ 12 size size) 0 size (edge3))
(move (+ 12 size size) 0 0 (rotate -90 '(0 1 0) (quad4)))
)))
)

(define (oddPeanos size primitives) (let
(
(cR (car primitives))
(cF (car (cdr primitives)))
(cL (car (cdr (cdr primitives))))
(ccR (car (cdr (cdr (cdr primitives)))))
(ccF (car (cdr (cdr (cdr (cdr primitives))))))
(ccL (car (cdr (cdr (cdr (cdr (cdr primitives)))))))
)
(list
(clockWise size ccF eR cF eF cR eF ccR)
(clockWise size ccF eR cF eF cR eF ccF)
(clockWise size ccF eR cF eF cR eF ccL)
(counterWise size cR eF ccL eF ccF eL cF)
(counterWise size cF eF ccL eF ccF eL cF)
(counterWise size cL eF ccL eF ccF eL cF)
)
))

(define (evenPeanos size primitives) (let
(
(cR (car primitives))
(cF (car (cdr primitives)))
(cL (car (cdr (cdr primitives))))
(ccR (car (cdr (cdr (cdr primitives)))))
(ccF (car (cdr (cdr (cdr (cdr primitives))))))
(ccL (car (cdr (cdr (cdr (cdr (cdr primitives)))))))
)
(list
(clockWise size ccR eF cL eL cF eR ccR)
(clockWise size ccR eF cL eL cF eR ccF)
(clockWise size ccR eF cL eL cF eR ccL)
(counterWise size cR eL ccF eR ccR eF cL)
(counterWise size cF eL ccF eR ccR eF cL)
(counterWise size cL eL ccF eR ccR eF cL)
)
))

(define (peano n size odd even primitives)
(if (= n 1)
;
; return clockwise forward version
;
(let ((curve (car (cdr primitives)))) (curve))
(peano
(- n 1)
(+ 12 size size)
even odd ; swap even and odd
(even size primitives)
)
)
)

(define (peanoCurve n)
(peano n 12 oddPeanos evenPeanos
(list clock1R clock1F clock1L
counter1R counter1F counter1L
)
)
)

(define (peanoSize n)
(if (= n 0)
0
(+ 12 (* 2 (peanoSize (- n 1))))
)
)

(define CHECKER (surface MASK_CHECKER SURF_MATTE BUMP_FLAT SURF_MATTE BUMP_FLAT
0 0))

(globals (rgb 0 0 0) 0.05 0.0)

(render (cine 256 256 1) (union
(move -100 -4000 -1000 (light 4400))
; (move -4000 -1000 -1000 (light 250))
(move 6 -14 6 (rotate 45 '(0 1 0) (rotate -10 '(1 0 0) (move 0 0 -50
(scale 12 12 40 (camera))
))))

(scale 2 2 2
(move 0 0.125 0 (scale 0.5 0.5 0.5 (peanoCurve 5)))
)
))

Tuesday, October 06, 2009

50th Anniversary of First Photos of the Far Side of the Moon

50 years ago today, Luna-3 took the first photographs of the far side of the Moon in 1959. They were shot on film, developed automatically onboard, and then scanned and transmitted by radio.



http://www.mentallandscape.com/L_Luna.htm


Sunday, September 06, 2009

A Nobel Prize for Sputnik

According to some accounts, the Nobel Committee approached Nikita Khrushchev after the launch of Sputnik-1. But the Russian government would not reveal the name of their "chief designer", Sergei Korolev. So the scientific achievement that began the space age went unacknowledged.


Nobel prizes can only be given to living persons, but there is still an opportunity to award the Prize in Physics to Boris Evseevich Chertok. Chertok, who is 97 years old now, was a major contributor to the development of the R-7 rocket and the launch of Sputnik. He was one of Korolev's right hand men, the division head of rocket control systems.

Thursday, August 13, 2009

Electric Cars Get About 60-70 mpg

GM has announced the Chevy Volt, getting 230 miles per gallon, and Nissan has announced an electric car they claim gets 367 mpg. I'm not sure how they arrive at those numbers, but let's try to estimate a more meaningful mpg value.

The Nissan goes 100 miles on a 24 kilowatt-hour battery charge. That means 4.2 miles per kwh. A friend of mine owns a Tesla Roadster, and he says he consistantly gets 240 wH/mile, which also translates to 4.2 miles per kilowatt-hour. That energy comes from power plants, which could theoretically burn gasoline. A gallon of gasoline yields about 36.6 kilowatt hours of energy when burned, but the engine in conventional cars only used about 20% of that energy. Power plants are about 45%efficient, because they use turbine engines. Furthermore, there is about a 7 percent average loss of power in the transformers and power lines used to deliver electricity to your home.

There is also charge-discharge efficiency of batteries and the efficiency of electric motors, but that is already factored into our direct measurement of 4.2 khw/mile. So assuming 4.2 kwh/mile, and 36.6 khw/gallon, and 42% efficiency, I get 64 miles per gallon. Let's say 60 to 70, because this is not a precise calculation.

That's good, but not vastly better than a hybrid. What is really interesting about the electric car is that electricity can come from sustainable sources like wind and solar energy. And in the short term, it can come from coal and natural gas, which America has in great abundance.

Tuesday, July 21, 2009

The Apollo Landing Sites Pose a Danger to NASA's New Orbiter

While conspiracy nuts debate the reality of the Apollo landings, scientists must deal with some practical consequences of what astronauts put on the Moon. For the new Lunar Orbiter Laser Altimeter (LOLA), this means dodging the retro reflective mirrors mounted by astronauts at some of the landing sites.



The Apollo astronauts installed arrays of prisms at some landing sites, designed to bounce laser light directly back in the direction it came from. They reflect a signal, proportional to 1/R**2 instead of 1/R**4, where R is distance. These devices are still in use today, to monitor exact motion of the Moon and test physical theories.



The LRO carries a highly accurate laser altimeter, similar to the one installed on recent American Mars orbiters. It occured to me that this instrument might also verify the existance of the Apollo landing sites (as the LRO cameras have already done), but then it also occured to me that it might return a laser signal so strong that it could damage the instrument.

I wrote to David E. Smith at Goddard, the principal investigator for LOLA, to ask about this. He replied that this was most definitely a problem, and the LOLA instrument switches off when the orbiter passes over Apollo sites. If by small chance, the beam did strike the retro reflector, the light bounced back would be 1000 times the detector damage threshold!



The Russians have also been helpful in giving the LOLA team the best known locations for the two Lunokhod rovers, which also have laser retro reflectors mounted on them. Lunokhod-2 has been located precisely and is routinely probed by lasers from Earth. Lunokhod-1 has never been found by laser, and it is not known for certain if its reflector is deployed. Seen in the photo above, we can see the relfector (extended to the left) bouncing back the light from the camera's flash.

Tuesday, June 02, 2009

How Many Memories Do People Have?

How many events, stories and facts do people really remember? I decided to do a very crude experiment. From a complete list of vocabulary words, I generated sets of word triples (Noun, Verb, Noun) such as:

1 clarity consider sonnet
2 letterman propose tapdance
3 assignment deduce senate
4 virtuoso weaken ferment
5 controversy jeopardize globe
6 dialysis recur rooftop
7 dislocation admit portal
8 swirl decrease bough
9 dolphin install compatriot
10 gust beware extrapolation

There are about 200 billion possible triples. I seem to be able to assign an obvious word triple to almost anything I remember. But in a random set of 1000 triples, I didn't see any that obviously described a memory. I decided to cut back the experiment and just generate pairs of nouns:

1 lunch clarity
2 fist sonnet
3 letterman gamble
4 tapdance assignment
5 ounce senate
6 extrapolation mast
7 ferment controversy
8 yip globe
9 dialysis artisan
10 rooftop dislocation

There are 100 million possible pairs from my vocabulary set, and I'm looking for clear associations with memories, like "kennedy assassination" or "birthday party". Out of a random sample, about 2 percent could be associated in such an obvious way with a memory. If every memory could be assigned a fairly obvious word pair, then this implies that I only have about 2 million memories.

That's a surprisingly small number. I'm pretty skeptical about this experiment, and I'm sure we can find countless flaws in the whole concept of it. But it is amusing and suggests a contrary notion that the human mind might be far more limited that we like to believe (and we all know how much I enjoy contrary notions).

One obvious flaw is that meaningful word pairs might only number in the millions, but could refer to hundreds of different memories. So I tend to conclude that people have somewhere from 1 to 100 million memories.

Another approach to estimation of long-term memory capacity is to note that people only live for about 30,000 days. How many events per day really stand out enough for people to remember them permanently? That makes it easier for me to believe that people only have on the order of a million memories.

-------

PS. I haven't been posting a lot to my blog, because I've been putting my thoughts on Facebook notes. (http://www.facebook.com/profile.php?id=506882584). Folks are welcome to send an add request, but I can't guarantee I will accept requests from strangers, unless they have a real Facebook page that let's me know who they are.

Friday, October 10, 2008

The Economy and Energy

I. Who's Fault Is This Mess?

I believe in free markets. As a computer scientist, I've seen how the principles of capitalism have led to astonishing new inventions and positive economic activity just in my own field. As an historian of the Soviet space program, I also see just how poorly socialism functions in comparison.

In our current economic problem, there is plenty of blame to spread around. I personally see two places where the market was subverted:

1. Pressure from liberal government policies to give loans to people who couldn't afford them.

2. Dishonest labeling of the risk and quality of some mortgage-based bonds.

I'm not adverse to regulating the amount of leveraging in the market, but I can't help but think that people would never have risked so much if they had not thought they were buying "A" rated securities. Civil and criminal liability needs to be applied to those responsible for that.


II. Fear Mongering and Political Opportunism

Crisis brings out the best and worst in people. The mainstream media has contributed to the problem by flat out telling people to dump their stock. If you sell your stock now, you turn unrealized loss into actual loss. If the meat puppets on the network news keep yammering about bad banks, they could cause a run on the banks, and then of course they really would fail.

Talk of the Great Depression are popular now, but in fact there is no comparison: Depression Fears Overblown


Crisis also creates opportunity for would-be political mass movements. On the far left we hear talk of socialism and the failure of capitalism. On the far right, we hear populist nonsense about the bailout. Just the kind of hysterical actions that are bad for America now.


III. Fundamentals - Education and Energy

Adam Smith taught us the most important thing we can know about economics: the wealth of a nation is created by human productivity, not by "treasure". Compare a resource-poor nation like Japan to a resource-rich nation like Saudi Arabia or Venezuela. Where would you rather live? Nations that are truly wealthy have invested in their people, educating them to be productive and self sufficient. America does a fair job of this, but should do better.

Both candidates of said something to this effect, probably because they have been talking to T. Boone Pickens: we could revitalize our nation’s economy by embarking in a project to rebuild our energy infrastructure. Here is why I think that is a great idea:

1. Energy is crucial to a modern economy because it amplifies human productivity. We cannot allow ourselves to ride the downslide of global petroleum production.

2. New energy sources will free of us from dependence on hostile foreign petroleum suppliers.

3. Building a new infrastructure will create jobs and build long-term economic opportunities in the same way that the space program and the computer revolution did.

4. More young people will be encouraged to learn science and engineering.

5. I believe we can create vast amounts of cheap electrical power, but it may have new characteristics. Electricity might be cheap when the wind is blowing in northern Texas, and expensive during week-long lulls. People and the market can adjust. It creates a market incentive to store energy when its cheap and sell it when its expensive, which will level the pricing to some extent.

6. The free market can solve the energy-storage problem, but nation action is needed to upgrade our electrical grid so we can move more power over greater distances. The Soviets did this in the 1930s, we can certainly do it in America today. But it requires the national will to override eco-extremists and opponents of eminent domain.