Skip to main content

1996 | Buch

Introduction to Scientific Programming

Computational Problem Solving Using Maple and C

verfasst von: Professor Joseph L. Zachary

Verlag: Springer New York

insite
SUCHEN

Über dieses Buch

"Introduction to Computational Science" was developed over a period of two years at the University of Utah Department of Computer Science in conjunction with the U.S. Department of Energy-funded Undergraduate Computation in Engineering Science (UCES) program. Each chapter begins by introducing a problem and then guiding the student through its solution. The computational techniques needed to solve the problem are developed as necassary, making the motivation for learning the computing alwasy apparent. Each chapter will introduce a single problem that will be used to motivate a single computing concept. The notes currently consist of 15 chapters. The first seven chapters deal with Maple and the last eight with C. The textbook will contain 20 to 30 chapters covering a similar mix of concepts at a finer level of detail.

Inhaltsverzeichnis

Frontmatter
1. Computational Science
Abstract
Tycho Brahe was a Danish astronomer who lived from 1546 until 1601. Under the patronage of the King of Denmark, he established Renaissance Europe’s first observatory on the Danish island of Even. Even though the telescope would not be invented until eight years after his death, Tycho was able to measure accurately the positions of celestial bodies to between one-thirtieth and one-sixtieth of a degree. To accomplish this feat he invented a succession of instruments, including the sextant in 1569, the mural quadrant in 1582, and the portable ring armillary in 1591. For more than twenty years he devoted himself to systematically measuring and recording the positions of the sun, the moon, and the planets.
Joseph L. Zachary
2. Population Density: Computational Properties of Numbers
Abstract
The human population of the earth is large and is increasing rapidly. Table 2.1 gives the estimates of the United States Bureau of the Census for the growth of the world’s population over the last 2000 years. This table reveals that the population in 1900 was approximately 1.6 billion. This increased to around 2.5 billion in 1950 and more than doubled over the next 40 years to exceed 5.6 billion in 1995. The Census Bureau estimates that the earth’s population reached 5.761 billion during April 1996.
Joseph L. Zachary
3. Eratosthenes: Significant Digits and Interval Arithmetic
Abstract
Eratosthenes of Cyrene was a Greek mathematician who lived during the latter part of the third century B.C. He is best known for discovering an algorithm, called the Sieve of Eratosthenes, for enumerating prime numbers. We, however, are interested in him for another reason. In about 225 B.C., more than 17 centuries before Columbus, he determined the circumference of the earth.
Joseph L. Zachary
4. Stairway to Heaven: Accumulation of Roundoff Error
Abstract
Martin Gardner’s popular “Mathematical Games” column appeared monthly in Scientific American from January 1957 through December 1981. During those 25 years he entertained his readers with discussions of such topics as how to fold adding machine tape into hexaflexagons, John Conway’s Game of Life, and the discoveries of the mysterious numerologist Dr. Matrix. He inspired a generation of budding engineers, scientists, and mathematicians.
Joseph L. Zachary
5. Kitty Hawk: Programmer-Defined Functions
Abstract
The Outer Banks is a sand bar extending for hundreds of miles along the east coast of the United States, mostly along the coast of North Carolina. The sand bar is broken by narrow inlets that connect the Atlantic Ocean on the east to the shallow salt water sounds on the west. The result is a chain of long, thin islands, in many places only a few hundred yards wide and a few feet above sea level.
Joseph L. Zachary
6. Baby Boom: Symbolic Computation
Abstract
The Bureau of the Census estimates that the resident population of the United States on January 1, 1994, was 259,167,000 and that it had increased to 261,638,000 by January 1, 1995. Although these are only estimates that are retroactively revised from time to time, we will entertain ourselves in this chapter by pretending that they are exact. More precisely, we will pretend that the first figure was the exact population at midnight when 1994 began, and that the latter figure was the exact population at midnight when 1994 ended. Our goal is to develop a way to determine the population of the United States at any instant of time during 1994.
Joseph L. Zachary
7. Ballistic Trajectories: Scientific Visualization
Abstract
A baseball batted from home plate, a golf ball struck from the first tee, and cannonball fired from a pirate ship all follow ballistic trajectories as they fly through the air. In each case, a projectile is given an initial velocity and is thereafter affected only by the downward force of gravity and by the retarding force of air resistance.
Joseph L. Zachary
8. The Battle for Leyte Gulf: Symbolic Mathematics
Abstract
On October 20, 1944, the United States began its invasion of the Philippines. The ensuing seven-week Battle for Leyte Gulf was the largest naval engagement in history. The United States committed 216 combat ships to the battle, but the Japanese could muster only 64. Knowing that the U.S. had superior naval power in the theater, the Japanese fleet split into three forces and employed a series of feints. The plan was to use one of the forces to draw the bulk of the U.S. fleet out of position. On October 24 this strategy worked when the U.S. Third Fleet was drawn away.
Joseph L. Zachary
9. Old MacDonald’s Cow: Procedural Programming
Abstract
Old MacDonald has a farm, and on that farm he has a fenced, circular pasture with a radius of 10 meters. He would like to let his cow graze inside the fence, but wants to limit her range so that she can eat only half of the grass. To do this, he plans to tie the cow to one of the fence posts with a rope. How long should the rope be so that the cow can range over only half of the pasture?
Joseph L. Zachary
10. Introduction to C
Abstract
This chapter marks a transition. To this point we have used Maple to implement our models. For the remainder of the book we will use the programming language C instead. We will deviate in this chapter from our approach of organizing each chapter around a problem. Instead, we will set the stage for the rest of the book by comparing Maple and C, and we will begin our study of C by examining two simple C programs that solve problems with which you are already familiar.
Joseph L. Zachary
11. Robotic Weightlifting: Straight-Line Programs
Abstract
Industrial robots are widely used to perform repetitive tasks on assembly lines. They look nothing like the popular conception of robots, which is to say that they look nothing like people. The animatronics industry, however, deliberately produces robots that resemble humans. Such robots are commonly seen at large amusement parks, and have even been used as advertising gimmicks at trade shows. In this chapter we will consider a problem that might arise in designing a robot that can enter weightlifting competitions.
Joseph L. Zachary
12. Sliding Blocks: Conditionals and Functions
Abstract
Figure 12.1 shows a block sitting on a ramp. The ramp is inclined from the horizontal at an angle of θ radians, and the block’s initial position is L meters from the lower end of the ramp. The block is initially prevented from moving, but is released at time zero. If the friction between the block and the ramp is high enough, the block will remain in place. Otherwise, it will accelerate down the ramp until it reaches the end, at which point it will abruptly stop.
Joseph L. Zachary
13. Rod Stacking: Designing with Functions
Abstract
A number of cylindrical steel rods of various radii are stacked in a bin. The rods on the bottom are lying on the floor and braced by the sides of the bin. Every other rod is supported from below by exactly two rods. Assuming that we know the radii of each rod as well as the center coordinates of the rods on the bottom, what are the center coordinates of the remaining rods?
Joseph L. Zachary
14. Newton’s Beam: Repetition
Abstract
A cubical box, each of whose sides is 1 meter long, is placed on the floor against a wall. A beam 4 meters long is leaned against the edge of the box so that one end touches the wall and the other end touches the floor. There are two different ways to position the beam so that these constraints are satisfied, one of which is illustrated in Figure 14.1. What is the distance along the floor from the base of the wall to the bottom of the beam in each of these two configurations?
Joseph L. Zachary
15. Numerical Integration: Multiple-File Programs
Abstract
A factory receives an order for corrugated steel sheets. Each sheet is to be 5 meters wide by 10 meters long and is to be corrugated in a sinusoidal pattern. When viewed in cross section along either of its long ends, each sheet should appear as illustrated in Figure 15.1. There are to be 100 ridges along the length of each sheet. Every ridge is to have a height and width of 10 centimeters, and every pair of ridges is to be the square of a complete cycle of a sine wave.
Joseph L. Zachary
16. Harmonic Oscillation: Structures and Abstract Datatypes
Abstract
An object of mass m is attached to opposite walls of a room with two identical springs, as illustrated in Figure 16.1. Neither spring is under tension when the object is equidistant from the walls. If we move the object x 0 meters toward one wall, the opposing spring will resist by exerting a force of κx 0 newtons. We say that κ is the spring constant of the spring.
Joseph L. Zachary
17. Heat Transfer in a Rod: Arrays
Abstract
Imagine that we have a silver rod 10 centimeters long with a constant cross section. The rod is encased in thermal insulation along its entire length so that no heat can enter or leave except at its ends. It is initially at a temperature of 0°C. At time t = 0, heat sources are placed in contact with its left and right ends. The left heat source has a temperature of 100°C, and the right heat source has a temperature of 50°C.
Joseph L. Zachary
18. Visualizing Heat Transfer: Arrays as Parameters
Abstract
In Chapter 17 we studied the problem of approximating the temperature at the center of a 10-centimeter silver rod at a specific interval of time after heat sources were put into contact with its ends. All of our work led to a program that produced as its output a single temperature. In this chapter we will study the same heat transfer problem as in Chapter 17, but will focus on characterizing how the temperatures throughout the rod change as time passes.
Joseph L. Zachary
Backmatter
Metadaten
Titel
Introduction to Scientific Programming
verfasst von
Professor Joseph L. Zachary
Copyright-Jahr
1996
Verlag
Springer New York
Electronic ISBN
978-1-4612-2366-5
Print ISBN
978-1-4612-7518-3
DOI
https://doi.org/10.1007/978-1-4612-2366-5