Sunday, July 16, 2006

3-Vector Source Code

Speaking of software, since I am sort of on a programming theme lately, here is a C++ class that I wrote a few years ago when writing a 3-D orbital simulator. It's for a 3-vector, and contains many useful 3-D vector operations (such as cross products, rotations, abs values, projections, ect) that make doing the math easy.

Additionally, this class should be easy to use because it's small, simple, and doesn't call on a whole lot of obscure stuff. Furthermore, it's not written in obscure C++, doesn't abuse whitespace insensitivity, and doesn't inherit the whole windows API. Using someone elses code in a pinch is always tedious, but hopefully this will make it easier.


Enjoy. For all you CS majors, don't laugh at my code.

Saturday, July 15, 2006

Rocket Calculator

Some of you may remember my beginning a program sometime last semester that would size rocket stages for a multi-stage rocket. Well, I start a lot of programs, I don't often finish one. And it's never really done anyways, it's always "in progress".

This is a program that takes information about rocket stages (payload mass, inert mass, isp), then calculates the distribution of Isp between them that results in the lowest overall rocket mass. Debugging this program should have been simple, but it's never simple. When I write programs a certain way, it takes me 10 times as long to debug them as it does to write them.

Here is the source code. Compile it as a console/command line executable, and enjoy.
Rocket Calculator

In addition, I've noticed that having a handy unit converter is also useful when working on aerospace problems. We invented the airplane, and pushed the boundaries of space exploration, and now you're stuck with our crazy unit system. HA! Anyway, I haven't tested this completely, so don't use it to guide any mars spacecraft or anything without checking first. Just input the number of units in the input column and read across.
Unit Converter.xls

Friday, July 07, 2006

Lunar Fluids

/Since volatiles are rare on the moon, and fluids are needed for many many applications, from heat exchange, to hydraulics, to sealing interfaces, a very useful thing to do would be to develop some sort of in-situ fluid that could fill some of these roles. It would have to be able to be produced from silicon, oxygen, titanium, iron, ect. The primary constituents of the lunar surface (Or at least stuff you can find in > PPM quantities). If a permanent settlement is to have fluid loss, it’s better to use something that can readily be replaced in abundance in seals, sliders, and rotating equipment.

So many liquids that we use every day are loaded with hydrogen. Anyone know of some chemical that could fill the bill?

I know that microscopic silicon spheres are used as a lubricant, but I’m not certain if they could, for instance, wet gaskets to prevent air from leaking from a chamber under pressure or something. It certainly won’t make a heat transfer medium for powerplants and heat exchangers, seeing as how silicon has about 1-1.5 W/m^2 (MATWEB) heat transfer coefficient! It also wouldn't be much use as a cleaner, seeing as how the lunar dust behaves similarly.

Maybe the same sort of thing could be done with iron, aluminum, or other metal – making microscopic spheres out of it to turn it into a pseudo-liquid for heat transfer purposes. However, having such a heat transfer medium lock up on the job, like the graphite in Chernobyl would be bad.

Perhaps liquid phosphorous or sulfur could be used. It would have to be heated, but has a low melting point. (111C, 219C respectively, For things like doors, you could possibly melt it and freeze it upon opening and closing the door, hermetically sealing your environment. But for piston rings, ect, it might not be the best idea. On second thought, it would oxidize like crazy with the gasses that they're sealing, not to mention burn if they got inside the habitat. Maybe lead?

Just thinking out loud. Let me know what you think in the comments section. In any case, the engineering challenges of settling space are likely to be complex and unanticipated to a large degree. We'll have to figure it out as we go, and we will have to go first, long before we know everything about what we're doing.

Lunar Dust Issues

The summer 2006 edition of The Bent, Tau Beta Pi's magazine, has an interesting article on Lunar dust that I thought I might comment on. (“True Grit: Unearthly Dust”, Trudy E. Bell) According to some theories, with support from lunar prospector, the lunar dust gets charged by the incoming solar wind and elevates off the surface. The Apollo astronauts apparently observed this phenomenon, which resulted a slightly blurred horizon, and reflected light just before sunrise. The Apollo astronauts observed streamers of light over the horizon. These phenomena are typical of an atmosphere, and were not expected on the moon.

This charging is uneven across the lunar surface from the sunward pole out. This charge differential between the near and far sides may lead to dust currents across the entire surface.

If these electrostatically elevated particles of dust can soften the horizon and reflect light, I wonder what implications this has for the use of the moon as a pristine observatory (as is often alluded to as a potential activity of interest for the lunar far side)? Astronomers have been interested for years in the use of the lunar far side as a potential observatory. Even though space telescopes get above the atmosphere, emissions from our planet in the form of radio waves and reflected light prevent our instruments from reaching full theoretical potential. The lunar far side blocks out all emissions from Earth and from the Sun during its long night. The dust currents may cover instruments, and the dust may also obscure the views of telescopes which require near-perfect vacuum.

Also, I was thinking this may have implications for solar panels. Dust deposition may take place over long periods of time on the panels, and need to be wiped off.

-----Separate topic
The lunar dust is highly abrasive. It’s like the sand in a bead blaster. The article touches on this topic somewhat as well. Wiping the dust off of delicate surfaces can result in scratches. It also seems to get into everything, according to the Apollo astronauts. The article suggests using an electrostatic repulsion system to clean the dust off of surfaces. Charged panels, or charging guns may make a good first line of defense to remove the dust in the most gentle manner possible.

Wednesday, July 05, 2006

French Terror Alerts

So Funny. So True.

Tuesday, July 04, 2006

4th of July 2006

Happy 4th of July!

Here's to America: The best nation on Earth!

Here's to the outrageous good fortune that we had to have our founding fathers, men of unparralelled genius, bravery, and integrity, be the authors of our constitution and founders of our nation. Men who had unlimited opportunities to seize the reins of power and didn't. Who had every opportunity to dissolve the union and pursue the government of their choosing, but saw that the long term security, integrity, and greatness of our nation required that it remain united. Men, like Washington, who could have been king, but dissolved his army and went back to his farm, unlike any other victorious general in history.

Here's to the nation that gave its people liberty. That freed them of the constraints of serfdom and slavery. That never thought to dictate the purpose of the lives of it's citizens with dogma and ideology. That recognized the fundamental rights of life, liberty, and the pursuit of happiness, as essential to the dignity of mankind.

Here's to the nation, whose citizens, freed from the tyrrany of heresy and illegal thought, invented the modern world. Freed from the need for approval and status, built the modern world. Who dug the Panama Canal to link the oceans, lofted the skyscrapers to dominate the city skylines, fed the world, invented the airplane and landed men on the moon!

Here's to our soldiers who liberated our own nation, and afterwards proceeded to liberate the world. We overthrew the aggression of Germany not once, but twice. We took control of all of Europe - and gave it back! We conquered Japan, pacified it - and gave it back to it's people! The Korea which we succeeded in liberating today stands in such stark contrast to the Korea that we didn't that the border between the two can be clearly seen from orbit (esp at night). Here's to the only nation on earth with the ability to easily be an empire, with the ability to effortlessly crush the resistance of the world, but completely devoid of the will to do so!

Here's to America and all it stands for! Happy 4th of July!

Monday, July 03, 2006

Future Car Visions (The debate)

A relative of mine recently told me of some thoughts of his on future driving. It turned into a mini debate on the merits and feasibility of his vision versus what I thought would or wouldn’t work. I shouldn’t be such an “old fogey” in those debates. I am somewhat skeptical of some of the points of his vision, but I should attempt to frame them more as improvements on his plan.
Perhaps I can articulate it better in writing (I usually can) the sort of things I have in mind.

My relative’s opinion is that the future of driving is one of the cars being controlled by a satellite computer network. These satellites will give the car information about the road, the cars around them, and give them their instructions on how to drive, operating sort of like air traffic control for planes. The cars, thus coordinated, would travel without human intervention, be able to sustain higher speeds without accident, and would never have accidents due to human error again. In his opinion, it’s safer for the cars to operate without the human having the ability to control the car than with due to the ability of modern programs to handle the information given to them. People are idiots. They get into accidents, their attention wanes, they drive drunk, they talk on the cellphone when they should be paying attention to the road, they ride people's trunks.

In my opinion, there certainly may be a role for computer control of cars, but some parts of his vision could work better if approached with a different philosophy. First of all, air traffic control, IMO, has a lot to learn from the way roads are operated than the other way around! Air traffic control deals with maybe 5000 aircraft over the sky of the entire United States at a time. It coordinates their movements, and directs their altitudes. However, aircraft can operate at many altitudes without terrain considerations at all. The problem of directing aircraft is simple compared with directing automobiles. And our skies are considered crowded! In contrast, there are 200 million vehicles operating in the United States. They all operate every day. They all pour out onto the road during rush hour, and they all have a very specific individual destination in mind (as opposed to a relative handful of airports). Each of these vehicles must navigate construction zones, other impassable vehicles at (comparatively) immensely close proximity, impassable barriers, unexpected obstacles (kids, bicycles, pipes sticking up out of the road for no apparent reason, pedestrians, storm debris). Each of these vehicles manages it every day without any coordination at all. The reason why they can perform what would be a monstrous command and control nightmare to dwarf by several orders of magnitude the air traffic control problem without any grand central traffic cop, is because every car operates according to some simple and mutually held road rules. This may sound trivial, but it’s not. The cars concern themselves with their immediate situation. They encounter localized road situations (intersections, merging, ect), and operate autonomously according to predefined rules (the cars going straight have to go before the cars turning left can go, turns yield to through traffic). This enables an arbitrary number of cars to proceed through their day to day business without burdening central control at all with an extra vehicle to maneuver. The amount of communication necessary to navigate the car drops. Each car is responsible for it’s own computation. This enables vehicles to operate locally and autonomously, rather than concerning themselves with the global traffic situation and being confined by it.

The cars on the road right now don’t need to communicate with a centralized network. The range, number, and volume of their communications is far less than what would be required for centralized control. As it is now, the vehicles only need to send and receive information to the cars immediately surrounding them. 200 million vehicles, all talking at the same time to the same computer system that’s trying to direct them, wouldn’t work out so well. 200 million computers can talk to the internet, because they’re each talking to an individual server, each requesting independent operations. The traffic control problem would need to be solved in such a localized manner, rather than all together as a coupled problem. With localized control, the cars could serve with their own computing power, rather than needing a super-supercomputer in each city to mange it.

The third nit-pick that bothered me is that the cars are all talking to a network to get their information about the world. Supposedly the network contains all the information the car needs to know about the world. If the car gets it’s worldview from the network, where does the network get it’s worldview? What happens when a storm blows through and puts a branch in the middle of the road? What happens when the road crew takes out your overpass without informing the network? (Visions of cars cascading over the side of a cliff) What happens in the inevitable accident when the car fails? (And the cars will fail. The system has to be tolerant of mechanical failure as well as lack of information). How will this network handle a kid running across the street, or a deer bounding across the highway? The network is not the world. I don’t think it should ever be taken as a substitute for the world. If cars have the capacity to operate themselves, they need to demonstrate it by reacting to the world as it is, not the world as a network thinks it is. They need to take in the immediate, local sensory information on the ground and process that, because a glorified road map will never have information to that detail. It just won’t have the sheer level of sensory capacity for it. Even if it does, it’s more effective to just stick the necessary sensors on the cars anyway. This ensures the senses are where the car is, and that the cars can handle non-upgraded roads as well as high-tech modernized roads.

My fourth nit-pick is that this system needs to be tolerant of drivers that aren’t operating on the central-control method. It needs to be able to be gradually phased in. You aren’t going to replace 200 million vehicles, or the highways, in a massive sweeping movement. You’re not going to be able to ground all the cars in the country until they are all equipped with robotic control systems. Your car has to be tolerant of idiot drivers anyways, even if your opinion is that people are too clumsy to operate a car, because it’s not going to have a road clear of all vehicles but ones operating according to the central control. Localized autonomous control of vehicles is so much more robust and requires so much less effort than a centralized control network. IMO, this is the way to go. If your car is autonomous, it should be able to handle what any driver can handle. This is so much more robust.

Final nit-pick – humans have demonstrated the capacity to operate their vehicles just fine. Robots haven’t demonstrated the capacity to operate in the real world to that degree yet (though I don’t doubt that they will be capable eventually). “People are idiots”, may apply, but even idiots are incredibly aware of their situation compared to the most decked out robots. Furthermore, people can gain an understanding of their situation to a degree that a program may not. I’m not saying that people should always grab manual control I’m saying that they should always have that option. Always. On any device that they are operating. Because the people maybe, maybe, just know something about what is going on in a particular scenario (esp. in particularly dangerous, unusual ones) that their programs don’t. A programmer in an office building may be able to take an impressive number of scenarios and situations into account, and may be able to develop some very nimble and responsive algorithms, but they aren’t there looking at the problem, on the scene. The whole point of having these vehicles and machines in the first place, is to get them to do what we need them to do, not what their manufacturer thinks we should do with them. They are tools for the use of the user, not the designers, and ultimately, the user should have control.

Okay, so that was more of a debate. But I still think these principles are more sound and robust than the ones laid out in the original vision of air-traffic-controlled vehicles.

Sunday, July 02, 2006

Risk and space travel

This article points out soemthing important about space travel and risk management that is important to consider. I would recommend reading it.

Here is a copied part debate I had a few years ago on a space forum that I post on sometimes. It seems very relevant to the issue:

Me, responding to a post about generating more and more fail-safes.

Backups cost money. There must be a balance between safety and cost
effectiveness, or it won't be reasonable to do. Take the shuttle for
example...theoretically, you could make it 100% safe, but only after spending
infinite money and attention on every aspect. But we can't operate a space
program that way, so their has to be a trade-off. Somewhere, somehow, somone has
to make a decision about what constitutes an acceptable risk. Personally, I
think that should be made by the people who want to ride the thing.

Between money and lives, I'll choose lives every time. No cost is too high to
ensure absolute safety.

A nice ideal, I guess. I am biased towards the life end. But if you take it
absolutely, then you would have been opposed to exploring the world in sailing
ships, lighting fire, driving cars, laying railroads, mining, in short, every
activity involving a potentially harmful result.

At this point in time, we have the technology to make it safe. It just cost too
much, so we cut back. But on a permanent base, i think no expense should be

I would agree with ASEI here, there must inevitably be some sort of trade off.
You could spend an infinate amount of time/money making everything safe, but it
can only be achieved at the expense of progress. This is why the great pioneers
of the past are still famous and admired today, they accepted that there was
only a certain level of precautions that could reasonably be taken - and they
took the risk. What we learnt from them allowed the journey to be safer next
time. This is what pioneers are. You obviously have to make things as safe as
you reasonably can, but for many the risks make it worth doing. As for a
permanent base, it is difficult to comment, as everyone would agree that we do
not have the fail safe technology to even attempt this right now. When we start
putting the general population up there then there can be no 'accidents' and
until we have fail safe technology it may be necessary to have a backup - or at
least a way out available should it be needed.

Another post of mine about space settlement or commercialization of a human presence in space:
I think if space is ever to be settled or commercialized that there needs
to be a cultural attitude of risk-taking. It doesn't necessarily mean that we
shouldn't value life. What it does mean is that people will need to be willing
to take personal risks, and accept the results of those risks. If a man gets on
a rocket, the attitude needs to be that he knows and accepts the risks of space
travel. If afterwards, the rocket explodes and he dies, the blame cannot lie
with the company that built it, they did their best to the greatest degree
reasonable in serving the interests of their customer. Currently, any risk is
deemed unacceptable. When risks are taken by people, the responsibility never
rests squarely on them. Through our legal system, revenge is usually taken on
the companies which enable the risk rather than the people who take it. The
result is that it becomes far too risky for anyone to provide any product or
service to which there is the slightest degree of risk to the consumer (at
least, at any price that is reasonable and viable).