Simulations and Reality
Published Mon, Oct 26 2009 12:37 PM
Technorati Tags: Hobbies, Software Development, Transportation, Politics, News
Before you continue – a warning. This is a VERY long post. Many of you will be tempted to ignore it because of the length. That’s fine. If you stick with it, I think it will be worth your time, but that’s just my opinion. If you actually read it, feel free to challenge my assumptions and reasoning. Much of this is from memory, but I believe the ultimate point is still sound. If you don’t have the patience to read through the whole thing, go ahead and skip to the bottom. The inspiration for this post can be found down there…
When you were a child, did you happen to build models? I did, and from time to time so did my dad. The models I built were generally simple die-cast plastic pieces that you would break or cut off from a common sprue and glue together with modeling cement. Most were fairly simple and didn’t require too much skill to build. No paint was involved, and details were handled with small decals. Some models were fairly complex, but they all shared one thing in common – the pieces were injection molded plastic. Very little actual craft was required. The models my dad built on the other hand required a bit of craftsmanship.
Two of these models stand out in my memory. One was a wood, cloth, and string scale model of the U.S.S. Constitution. The model my dad built wasn’t very large, but it took him what seemed to me at that impressionable age to be a very long time. The process was very similar (at least in my mind, and perhaps in actuality) to real ship building, except on a much smaller scale. The pieces were cut out of wood, and had to be joined together, sanded and shaped to fit. Once the ship was built, it was painted and varnished, and the sails and rigging were painstakingly put together and added. The result as I remember it was impressive.
The other model impressed me even more. It was a model airplane. It seemed to me as if hundreds of pieces went into this model, just to build the wings. There were the long spars that ran the length of the wings, including a curved leading edge. There were the individual braces and structural pieces that formed the shape of the airfoil and provided passageways for the control cables and working hardware for the control surfaces. More pieces went together to build the framework of the fuselage and tail, including the control cables and hardware for the rudder and elevators. The whole thing was covered with fabric, doped and painted to look like the steel skin on real aircraft. A single cylinder model aircraft engine was used to power the plane. When it was finished it was a work of art – and more importantly, it flew!
Both of these models were built more than thirty years ago, so you’ll have to forgive me if I don’t recall all the details correctly. I do know that the model ship was mounted on a pedestal and wasn’t required to actually be seaworthy, but it was a work of art and craftsmanship. At the size it was built, it was impossible for it to match the real ship in every detail, but a lot of detail work went into it. The airplane on the other hand actually had to be airworthy. It was intended to fly after all. A lot of detail work went into it as well, but so did some serious engineering. Even so, not all of the features of a real airplane were included, and some that are not part of real airplanes had to be present in order for the plane to fly independently of an actual on-board pilot.
All of these models were simulations of reality. Mine were merely crude simulations of reality, but the ones my dad built were more refined and accurate, with the model aircraft being the most accurate of all of them. None of them worked exactly the way their real world counterparts did though, although the aircraft came closest. And, while my models and my dad’s were built over thirty years ago, people still do this kind of model building today. Some still choose to do it with physical materials, but not all models can be built that way.
A computer simulation is a tool that can show you what might happen when a particular event occurs. The accuracy of a simulation depends on many things. The most important part of a computer simulation is the underlying model. For computer simulations this generally involves iterative calculations of many mathematical equations. How accurately the mathematical equations describe the physics of the world has a significant effect on how accurate the simulation is when compared to reality. Another factor that affects the correspondence of a computer simulation’s results to reality is the fudge factors used – values supplied to various parameters in the equations being processed that have to be assumed or measured and input. Yet another factor affecting how closely a simulation matches the real world is the assumed initial conditions. In chaotic systems, like particle flow in viscous media for example, small differences in initial conditions can have significant effects on the end product of the calculations.
A final factor to consider is the level of detail in the simulation. This is analogous to the scale of the model being built versus the scale of the real world object being modeled. A real plane is flown using more control surfaces than just ailerons a rudder and elevators. There are also flaps and trim tabs. As I recall it, when I was in high school and took some flying lessons (remember, this was over thirty years ago, and I’m not a pilot, I’m just remembering the things that stood out), we were taught that the ailerons and rudder had to be used in coordination to fly a plane properly or unexpected effects would occur. We were also taught that those control surfaces were really for gross control of the aircraft, making sharp turns for example. For finer control, and for minor course and altitude corrections we used the aircraft’s trim tabs. These are much smaller control surfaces, and so the effects of using them are much smaller than the effects of using the other controls. Smaller changes to the plane’s course meant smaller corrections in case you went “too far.” My dad’s model plane didn’t have trim tabs, or even flaps. It flew, but those details weren’t that important to making it fly correctly, so the simulation wasn’t “complete.” But, for the purposes my dad had in mind it was more than just “good enough.”
One of my favorite quotes relates to the difference between simulation and reality in an interesting way. I don’t know who said it first, but that doesn’t change the truth of it…
“In theory, there is no difference between theory and practice, but in practice there is.”
Think about that for a few moments and you’ll see why I like it, and where I’m going with this.
All computer simulations are the embodiment in machine instructions, code if you will, of one or more theories. By running the simulation, you can see where the theory might take you. The outcome of the simulation though depends on how accurately your code models the theory, how detailed the calculations are, how accurate your measurements or assumptions of initial conditions are, the parameters you choose to run the simulation with, and how long you let the simulation run.
Why is all of this important? Because we use simulations every day to help us make our decisions, from the small things like “should I wear a long sleeved shirt or a short sleeved one” or “how do I get from where I am now to the coffee shop I’m supposed to meet that client at” to more complex decisions like “should we built an elevated structure to replace the Alaskan Way Viaduct, or a tunnel, and for that matter do we really need to do either?” Hmm… I bet you thought I was going to go off on another tirade about anthropogenic global warming models or something like that, but no, not this time, although everything I’ve written so far applies to that as well.
Let’s start with the first question, “should I wear a long sleeved shirt or a short sleeved one.” The answer to that depends on what the weather is going to be like wouldn’t you think. It may also depend on other factors, like social requirements, work requirements, and so on, but let’s stick with the weather forecast. Look out your window. You can tell at a glance what the weather is like in general because you have a simulation of the weather in your head. You’ve experienced similar weather in the past, and based on what you see – and know, you probably have a relatively decent idea what the weather will be like a few minutes from now. A more long-range forecast works somewhat the same way, except that the forecasters use computer simulations and large amounts of collected data beyond what your eyes can see to drive those simulations.
We all know how accurate weather men are. It’s the subject of a great deal of humor, including tales of people being mad at the weather man because the weather isn’t what they want it to be. My brother-in-law works for the National Weather Service, and tells me that predicting weather in this area is particularly difficult because of a number of factors that can change fairly rapidly. The National Weather Service doesn’t just use a single computer simulation to predict the weather, they use several of them, and while they can predict the weather out to ten days or more, they’re not very accurate that far out. Even five day forecasts are subject to a lot of change as the time for the predicted weather gets closer. Generally, they can nail a prediction a couple of days out, but the simulations diverge from each other and from reality further and further as the time scale increases.
There are two major factors affecting this. One is the level of detail of the simulations, and this is linked to the processing capacity of the machine running the simulation. The other is the effect of very small differences in the measurements used to feed the simulations, and in the assumed initial conditions. Remember, predicting particle flow in viscous media involves simple calculations that feed back on themselves resulting in chaotic results. It’s simply not possible to predict the position and momentum of every particle in the simulation exactly, and small changes can have large effects. And YES, the same is true about climate modeling – but that’s NOT the subject I’m trying to cover.
So, lets step aside from THAT topic and move on to our next simple question, “how do I get from where I am now to the coffee shop?” Again, we carry our own mental model. If we know where we are, and where the coffee shop is, and if we have a familiarity with the various roadways and paths between us and the coffee shop, most of us can get there without asking directions or using a GPS navigation unit. But what if you’re in an unfamiliar city, and don’t know where you are in relation to the coffee shop? That’s a slightly bigger problem. You could rely on other people’s mental model, after all that’s what it means to ask directions. Alternatively, you could rely on a computer simulation to work it out for you. That’s what those GPS navigation units are for after all.
So, how does a GPS navigation system work anyway? Well, as the name implies, it uses the Global Positioning System (GPS) to work out your current location. It also uses a database containing the location of every street according to public records. There’s also a computer inside that calculates a route for you using an algorithm designed to work out the path between your current location and your desired location over the various roads available.
We all know that road construction is going on all the time. New roads are being built, old roads are being closed and the route changed, or more mundane maintenance is going on so that drivers can’t memorize the location of the potholes. Add to that the effects of traffic accidents and the like, and plotting the perfect route to the coffee shop can become an exercise in futility. Fortunately for us all, road construction takes time, and there are almost always alternate routes available to us, so even though the database of road data loses its accuracy over time (that’s why you can update them), these units generally do a good (maybe not always optimal, but certainly “good enough”) job of calculating a route. That’s the effect of the accuracy of the system’s model of the roads, and of the algorithm programmed into the machine.
Working out your current location requires another model. This one involves the use of multiple satellites orbiting the Earth and time signals. Without extremely accurate clocks and a knowledge of how fast radio signals can travel through space, the system would fail. The principle idea behind the calculation is that the GPS unit has an accurate clock, and so do all of the satellites. The computer inside the unit determines the difference between the time reported by each satellite and the time reported by its internal clock – uses the speed of light to work out the distance between the satellite and the unit, and based on the predetermined orbit of each satellite it can then work out a three dimensional position for the GPS unit – and match that three dimensional position to a location on the Earth’s surface. It requires a lot of mathematical calculation, but computers can do a lot that sort of thing very quickly.
The thing is, all of this is very dependent upon the underlying model of the orbital mechanics of those satellites, and upon the nature of time and space itself. How accurate that model is can make a huge difference, and as our simulations become more important to us, we need to refine our models of reality using the best evidence we can get. We must always remember though that a simulation is just a model – it’s not reality.
A few thousand years ago, the brightest scientific minds of the day believed that everything had a tendency to remain in place. Simply moving an object required the continuous application of force. Nothing moved on its own. At the time, this seemed to be a fairly decent model of the universe. After all, if you wanted to move a cart of produce to market, you had to apply force to move that cart the whole way. If you stopped applying force, the cart would stop.
Of course we know better than that. That model was incomplete. Think about cars today. You have to run the engine to get them moving, and for most purposes to keep them moving. So far that ancient model seems to work. But – if you want to stop the car you’ve got to apply force to do it. That’s why we have brakes. (Don’t get me started on brakes. I’m taking today off from that process.) Oh, sure, if your car runs out of gas, it’s going to stop moving. But, we all know that a car can coast a long way without the engine running. No force is being applied to it to keep it moving – although a force must be applied to stop it (whether that force is friction, or the result of the car slamming into a tree).
A couple of hundred years ago Isaac Newton came up with a better model. Newton’s laws of motion were radically different from the prevailing theory. The thing about them though, is that they could predict the motion of lots of objects very accurately (at least in terms of 17th century measurements), and gave better results than the existing model. Isaac Newton came up with a theory that explained the working of gravity, the motion of objects, and even the orbit of planets, stars, and galaxies. He reduced the motion of objects in the universe to a few simple equations that were easily calculated. If you knew the initial conditions you could, in theory at least, predict the location and momentum of any object at any time. All you needed was to do the math.
That’s a pretty good model. Even today, many people don’t understand Newton’s laws of motion. Either that, or they don’t understand the implications. A lot of people still believe that for something to move, a force must be continually applied to it. A good understanding of Newtonian mechanics can change a person’s mind. That’s why these laws are used in computer simulations to show the most likely scenarios for accidents in some court cases. That’s how (for the most part) we were able to put men on the moon in 1969 (yes, we really did do that, despite the conspiracy theories that say it was all done on a sound stage somewhere).
But, Newtonian mechanics isn’t a good enough model for GPS navigation. For that matter, although it does an excellent job of predicting the motion of objects such as planets, it was an inconsistency between theory and practice that ultimately led to a replacement model that does work well enough for GPS navigation. The problem you see, was that the orbit of the planet Mercury didn’t quite agree with what Newton’s theory said it should be. In other words, the best available simulation of the day didn’t match reality.
Albert Einstein came up with a new model that solved the problem. His model challenged a lot of the assumptions that people had (and that a lot of people still have) about the very nature of space and time, and their relationship to the mass of objects. The big idea in this model is that space and time are tied together into “space-time,” a four dimensional continuum in which everything else exists. That’s not so bad. If you want to know where to go for a football game for example, you can exactly specify the location in space-time by giving a position in three dimensions (relative to a reference point) and the time of the event. Being at the correct spacial location doesn’t guarantee you’ll see the football game. You have to be there at the right time too.
The other part of this idea is that space-time isn’t merely a way to measure things – it’s a part of the universe, and it can be affected by other parts of the universe, particularly the mass of objects inside it. The presence of a massive object in space-time warps the very fabric of space-time – it literally bends the dimensions.
Isaac Newton and Galileo Galilei took the notion that everything in the universe is lazy, preferring to find a rest position and tossed it out. Galileo demonstrated that objects at rest tend to stay at rest, and objects in motion tend to stay in motion, and Newton codified that into his first law of motion. In Einstein’s theory, everything tends to move through space time along the straightest possible path, and there is no “rest state.” The reason that the planets orbit the sun or objects fall to Earth isn’t just because a force is making them move, but rather because space-time itself is bent, and the straightest possible path for a planet to follow near the sun is the orbit it’s on.
The traditional explanation of this involves a rubber sheet and a massive object like a bowling ball. Rolling a smaller object over the rubber sheet results in a curved path because the bowling ball bends the sheet. You can also see this in some arcade games where a penny rolls along a curved surface. The penny “orbits” the hole in the center, going faster and faster as it approaches the center before finally dropping down into the hole.
This is all fine and good, except that these explanations only illustrate the bending of “space.” Einstein said that it is actually “space-time” that bends, not just “space.” That’s the key to how Einstein’s model of the universe applies to your GPS navigation system. Time itself is “bent” around a massive object like the Earth. The closer you are to the massive object, the more slowly time passes. For most people this result is incomprehensible. Time just “is”, it doesn’t run more slowly in one place than in another. But, it’s this very counter intuitive notion that lies at the heart of the Global Positioning System’s accuracy. Without accounting for the very real, although very small, difference in the rate of time at the surface of the Earth and at the orbital distance of the GPS satellites, the systems calculation of your location on Earth would drift by many miles every day.
So you see, not only do you need the best measurements possible, as in having an up to date database of where roads are, but you need the best possible model of how reality works if you want the best results possible. If your data is wrong, or your model is wrong, the results will be wrong too. Oh, it may appear that the results are good, but you have to cross check the model and the results all the time.
“In theory, there is no difference between theory and practice, but in practice there is.”
Computer simulations are fantastic scientific tools, but they’re NOT science. They’re merely technology applied to scientific theory. You cannot prove a theory using a simulation, but you can disprove one by comparing the results of the theory’s predictions against reality. Ultimately, scientific theories, and computer simulations are nothing more than models. They’re not reality. They can help you predict what might happen if your assumptions are correct, but they’re not a substitute for actual experimentation and measurement.
I used to build and play with models as a child. The interesting thing about models is you can make them do whatever you want them to do, and you can make a computer simulation predict whatever you’d like, if you play with the inputs and the model. Reality on the other hand is what it is. No matter what your simulation tells you.
Finally, one of the questions I asked that we could apply a simulation to was “should we built an elevated structure to replace the Alaskan Way Viaduct, or a tunnel, and for that matter do we really need to do either?” That wasn't an idle question. The last part of that question “do we really need to do either” seems to have been answered fairly well by the Washington State Department of Transportation.
The Washington Department of Transportation has released a powerful simulation of what could happen to the Alaskan Way Viaduct in the event of a powerful earthquake.
WSDOT has been working on the simulation for two years, and initially thought it was too alarming to release to the public, but a recent citizen's public disclosure request required the agency to release it.
I recommend watching the animation. It will show you why it is that the damage done to the Alaskan Way Viaduct on February 8, 2001 constitutes a “public safety emergency.” Yes, the viaduct is still standing after the earthquake, but nearly nine years have passed without anything significant being done about it.
I have to wonder, why is it that the Department of Transportation only started working on this two years ago? Just about everyone’s mental model of the Viaduct tells us that the damage done to it by the Nisqually earthquake left it in danger of collapse. I still remember the Loma Prieta earthquake and the collapse of the bridges in San Francisco. If there was any serious doubt about the danger to the public, shouldn’t this simulation have been done earlier? The idea that this was “too alarming to release to the public” irks me as well. Shouldn’t the public have the best possible information available to them to aid in making decisions?
I’m reasonably confident in this simulation, although there are a number of factors about it that could make it useless. For example, what type of motion was assumed for the earthquake? How likely is it that there will be a magnitude 7 earthquake near the Viaduct in the near future? Where is the assumed the epicenter? Will it be a thrust fault, a strike-slip? What assumptions about the consistency of the ground were made? How reliable are the estimates of the compression and tensile strength of the components that make up the Viaduct? What assumptions about the damage from the Nisqually earthquake were made? The list could go on and on, but like I said, I’m fairly comfortable with the simulation. The results fit my own mental model, which by the way is NOT a reason for trusting them. Still, at some point we have to have faith in the engineers that produced the model, and that they’ve considered all of the relevant issues that can affect it. Knowing how the model was produced can be a key to determining whether to trust it.
This isn’t about our politicians fighting over whether a tunnel should be built, or an elevated structure. It’s more about a government that neglects public safety in favor of comforting the masses. Something should have been done about the problems the Viaduct has years ago.
I’m not particularly in favor of replacing the Viaduct with a tunnel. The process by which that option was foisted upon the people bothers me, a lot. Nevertheless, the Viaduct needs replacement. It’s LONG past time to argue about the best option for fixing the problem. A decision has been made – now can the state get on with it? Preferably before the scenario in this simulation comes to pass?
Trackback URI for this post: http://perrinelson.com/track.aspx?postid=1383
Permalink URI for this post: http://perrinelson.com/2009/10/26/1383.aspx
Subscribe to this entry's
comment feed. (Atom)
David responded with:
 | Interesting read. The simulation video you link is also, although I'm not really informed--apart from information you've presented--on the viaduct issue. |
David responded with:
 | Note that although I said, "I'm not really informed--apart from information you've presented," that's not denigrating the detailed info you presented in your previous post. :-) |
T F Stern responded with:
 | This made for an interesting read, more folks should have been doing this sort of pre-planning instead of running full steam ahead in spite of the cautionary report which had been given those in charge. |
Perri Nelson responded with: More on the WSDOT video...
 | I'm beginning to wonder, was it a simulation or merely a video product representing the predictions of the simulation? At the same time, WSDOT said it took two years to create and run the simulation, but apparently the simulation and the video were complete in 2007. It's all looking a bit suspicious. The Seattle Times is questioning it too now. They have an article on their Politics and Government page titled "Viaduct disaster flick released; political motive?". It's an interesting read, including these bits... State officials say they released the video in response to a public-disclosure request last month from an anti-tunnel activist. But they acknowledged they decided to give KING-TV first crack at it. As of Monday, the activist who'd actually requested the video had not received a copy. There's also this one. Mayoral candidate Mike McGinn, who opposes the tunnel project, questioned the timing — and noted the video was produced by a tunnel contractor linked to his opponent, Joe Mallahan Mike McGinn appears to be right too. The video was produced by Parsons Brinckerhoff, a major engineering firm that has been performing tunnel design work. One of the company's local executives, Jared Smith, is a member of Mallahan's campaign advisory committee. Finally, there's this revelation... Gregoire also has endorsed Mallahan, largely for his pro-tunnel stance. It's obvious, at least to me, that this issue, now running for almost nine years is more about politics than public safety. The politicians have decided, against the will of the people, to build a tunnel. If we're really concerned about public safety it's time to move past what the Viaduct will be replaced with and get on with it. And NO, I still don't support a tunnel, but the Viaduct is unsafe. It's past time to replace it. |