Finding the Optimum Using Simulation
Simulation uses search techniques to find answers.
----------------------------------------------------------------------------------
----------------------------------------------------
If you can't solve equations analytically, which is the case much more often than not, the only meaningful way that's left is to use a search technique that samples the starting conditions, one at a time for each defining property -- as in a chemistry experiment. The inputs acting as special constraints, the equations would be computed separately for each selected starting value, keeping all other defining parameters constant for all trials on a given parameter. As an assistive technique in this regard, simulation can be useful. To be meaningful, the simulation must of course reflect the real dynamics accurately.
This approach is mostly intuitive. It can also be time consuming, and usually requires a certain amount of luck. In this respect, though, it's no different than repeating the real actions, each time with different trial conditions. There is no formal procedure to ensure success.
On the computer, fortunately, the sampling time isn't as great as it would be in real life. Imagine, for example, having to rig up the equipment each time you take a sample trial of the ski jump! Or piloting a large cargo carrier into a busy port! Or carving up a carcass in a meat factory! It is also much easier on a computer to keep the operating conditions constant. Computer sampling does have a lot to say for itself.
Sampling has its own difficulties, though. In simpler cases, it's easy enough to bracket the optimum quickly and zoom in on it to refine the numbers. Even so, the answer is always an approximation. And accuracy is never assured, despite increasing precision of the results. As in all problems, the accuracy, or soundness of a response depends on how well your math model depicts the true situation. Should you happen to capture the essentials of the problem, chances are your optimum will be satisfactory. So if the desired practices are to be treated properly, model realism is of the greatest importance.
Assume, then, that we wish to find the time when a fly ball attains its maximum height but that we don't have the velocity equation to give us the answer. In that case, we must play a guessing game, selecting different values of time more or less at random and trying to build a picture of the trajectory that gives us a view of the top. The plan is to evolve a pattern of information that reveals the relationship between the values of the variables and the maximum.
The picture is like a topographical map that lets you visualize the peaks and valleys of a terrain. By sampling the values in a methodical way, i.e., by observing the terrain in more detail, sometimes we can tell what the desired solution might be; we can find the location in the terrain that yields the highest point. That's the case with the height of the fly ball. We can, in fact, use the sample values that we compute here.
--------------------------------------------------
We assumed before that the starting velocity of the ball was 40-ft/sec, but we might have used 30-ft/sec, say, or 47.5, or some other number. Whichever value we choose for the parameter, we get a particular graph with its particular optimum.
If we collect graphs for a range of initial speeds, we get a parametric array of curves, one for each value of the starting-velocity parameter. Each curve would represent only one path of the fly ball, so we would end up with a large class of paths, one for each starting speed. In effect, then, when we generalize the problem, we end up with a large directory of curves or paths from which to choose.
The equations define the dynamics of the delivery process for any value of the parameter, and yield one or another representation of the dynamics when specific values are assigned to the parameters. Selecting the correct parameter values is the key to discovering the optimum performance. But the odds don't favor an early discovery, because you have no solid information to guide your selection, unless of course you've already studied the problem and learned a great deal about it. Your selection would therefore be fairly random, so chances are you will at first only find less than optimum conditions.
Finding the optimum with a sampling procedure is a bit like putting a new jigsaw puzzle together. At the beginning, you tend to select pieces more or less arbitrarily to form small, isolated patterns. And you tend to build on your successes. In a similar way, by using the computer model, you have to conduct enough trials to begin to form a picture of the puzzle -- the solution space, or the aggregate of results that reflects all the combinations of values for the variables of the given equations.
We might now ask, with respect to the paths of the ball, whether there is one among them that, in some sense, is the best. Continuing in the same vein as with the single curve, we can presume that, by the "best," we mean the maximum height. In that event, the best of our paths is the one that gives the overall maximum height. This is the maximum of the maxima. Of those in our array of curves, it is the one at the top of the heap, i.e., the one with the largest starting speed. To hit the ball as high as you can, then, you simply hit it as hard as you can in the upward direction -- the obvious conclusion.
As a more difficult alternative, you may wish to hit the ball, not as high as you can, but as far as you can. You would then be searching for the trajectory that had the greatest distance, as measured along the ground -- or what is generally called the range.
You have to change your thinking a bit, now, because the range is a function of the takeoff angle of the ball from your bat. In fact, the approach would now be to keep the starting speed constant for all of the different trials and let the starting angle take on different values, one for each path, or trajectory. It means, too, that you must include an equation that describes the horizontal motion of the ball. Else how would you know the distance?
To see the problem more clearly, note that the speed can be expressed in terms of its vertical and horizontal components, and second, that the two components are precisely related to the angle of release. When you hit the ball with a lot of upward motion, the flight is mostly vertical and the angle of release is almost 90 degrees. On the other hand, if you hit a hard line drive, the motion is flat, or almost horizontal, so the angle of flight is almost zero. Launch angles in between these extremes define a proportionate mix of the two extremes.
The pop-up, while it can go very high, doesn't travel very far. And the line drive, though hit very hard, isn't likely to fly deep into the outfield, though it might well bounce its way to the wall. To slam the ball over the wall, you really have to find a launch angle somewhere between those for the pop-up and those for the line drive.
The idea relates to the fact that the force of gravity tends to pull the ball to the ground. Time is involved. It takes time for the ball to drop. The higher the ball is hit, the longer it stays airborne.
The pulling effect is actually independent of the horizontal speed of the ball, so the time to fall depends only on the height. Therefore, to drive the ball a great distance, while you certainly have to apply a lot of horizontal force, you also have to keep the ball in the air a long time, which means hitting it with some upward angle.
Finding the answer thus involves a tradeoff. You trade horizontal speed for angle, or what is the same, you trade horizontal speed for time. Striking the ball so that it starts out on a slightly greater angle reduces its ground speed slightly but drives it higher and keeps it in the air longer, possibly letting the ball go farther. However, if you overshoot the mark, i.e., if you hit with too much angle, you could hit an easy fly ball or maybe even a pop-up. To get maximum range, the trick is to hit just a tad under the ball, or just below its center. This is obviously not an easy trick to learn.
The release angle is critical for other kinds of optima, too. In tennis, for example, the way the ball rebounds from your racket determines where it will go, so you have to select the correct striking conditions. Say you would like to hit a drop shot that just barely gets over the net. Suppose you happen to be a meter or two away from the net, toward one side, and you have to deal with a hard line drive down the sideline. Your objective might be to drop the ball cross-court, short. So your task would be to place the racket in just the right way for the ball to rebound gently over the net to the opposite side of the court, as I show. The drop shot at the net calls for "soft hands" and considerable subtlety in placement of the racket against the ball. To generate a correct release angle, the striking angle of the racket has to be adjusted for both horizontal and vertical components. The vertical angle affects the up-down motion of the ball and the horizontal angle affects the left-right motion. So the shot can be difficult.
Too little vertical angle will likely drive the ball into the net, whereas too much vertical will pop the ball up for a possibly easy put-away. And if the horizontal angle is too small, the ball will likely return easily to the opponent; whereas if the angle is too great, the ball will go wide and may not even cross the net. The best choice for the angles would therefore lie somewhere between their extremes, in some best combination. Since both angles have to be considered, the search for an optimum becomes more complicated.
A similar difficulty arises in platform diving. In this case it is required to dive as high as possible in order to have the longest possible time in the air. You need enough time to perform your in-flight maneuver, such as a tuck or an open pike. But it's also important not to launch either too close to the platform or too far out from it. You want your dive to be as nearly vertical as you can make it without hitting the platform.
If the launch angle is too steep, there is serious danger of a collision. But at the other extreme, "too shallow" means that you make a flat entry into the water and create a big splash. And if you don't launch high enough, you won't have enough time in air to complete your in-flight tactic. To find the optimum angle, you have to consider both the upward and the outward distances.
These principles apply to ballistics, generally, and so to a wide range of skills. When training armaments officers to fire artillery, astronauts to conduct space walks, or surgeons to apply elected operating procedures, it's important to understand the forces involved in the various actions and to find optimum or near optimum conditions for their performance.
Other interpretations of the best are possible, too. If you were driving a racing car, for instance, you would like to reach the greatest possible average speed for the race, but you would also wish to conserve fuel. It would be pointless, for instance, to drive as fast as you can, but run out of gas before reaching the finish line. But if you were to conserve too much fuel, you might have plenty left, but your average speed would be too slow to finish the race a winner. To get the best results, you have to strike a balance between the two extremes. Learning the balance points for a variety of conditions is by no means an easy task.
In other driving situations, there might be any number of competing factors. For example, if you were driving to work, you could conserve fuel by taking the shortest possible route. But the shortest route might not be the quickest route. That is, what is shortest in terms of distance, may not be shortest in terms of time. The shortest distance path could have many stopping points, for instance, or it might be more difficult, and even treacherous to drive; so the overall time could be greater than for that over another, longer-distance route.
If you were late for work and in a hurry, you might be willing to expend the extra fuel and thus drive the longer distance to work. On the other hand, if you were on holiday, chances are you would choose the drive that was the most scenic, while still conserving fuel. You might also be concerned about safety. So there are many options, many different goals. Considering the variety of possibilities, some weighted combination of objectives might be what 'best' means for you. To make a decision, the weighted combination would be expressed as a function, and you would attempt to obtain its maximum or its minimum value.
----------------------------------------------------
Generally speaking, the objective of optimization is to acquire the most of something that's good, and to have to put up with the least of what's bad . Each optimization problem thus involves the concept called the extremum -- an absolute, overall, or global best, which could be either a maximum or a minimum. In this respect, the most desirable action is the one that generates either the largest good or the least bad. It would be this action that, above all, you would most prefer to learn.
-------------------------------------------------