A Survey of Computational Physics: Introductory Computational Science

A Survey of Computational Physics: Introductory Computational Science

5.0 1
by Rubin H. Landau, José Páez, Cristian C. Bordeianu

View All Available Formats & Editions

Computational physics is a rapidly growing subfield of computational science, in large part because computers can solve previously intractable problems or simulate natural processes that do not have analytic solutions. The next step beyond Landau's First Course in Scientific Computing and a follow-up to Landau and Páez's Computational Physics,

…  See more details below


Computational physics is a rapidly growing subfield of computational science, in large part because computers can solve previously intractable problems or simulate natural processes that do not have analytic solutions. The next step beyond Landau's First Course in Scientific Computing and a follow-up to Landau and Páez's Computational Physics, this text presents a broad survey of key topics in computational physics for advanced undergraduates and beginning graduate students, including new discussions of visualization tools, wavelet analysis, molecular dynamics, and computational fluid dynamics. By treating science, applied mathematics, and computer science together, the book reveals how this knowledge base can be applied to a wider range of real-world problems than computational physics texts normally address.

Designed for a one- or two-semester course, A Survey of Computational Physics will also interest anyone who wants a reference on or practical experience in the basics of computational physics.

  • Accessible to advanced undergraduates
  • Real-world problem-solving approach
  • Java codes and applets integrated with text
  • Companion Web site includes videos of lectures

Read More

Editorial Reviews

Landau and Piez, authors of Computational Physics, have teamed up with Bordeianu to create an expanded work on introductory computational physics. Even more comprehensive than the first book, this volume contains up-to-date treatments of many new topics at the forefront of the field. . . . This volume offers everything needed for a graduate or undergraduate computational physics course.
— K.D. Fisher
Choice - K.D. Fisher
Landau and Piez, authors of Computational Physics, have teamed up with Bordeianu to create an expanded work on introductory computational physics. Even more comprehensive than the first book, this volume contains up-to-date treatments of many new topics at the forefront of the field. . . . This volume offers everything needed for a graduate or undergraduate computational physics course.
From the Publisher
Rubin H. Landau, Winner of the 2008 Undergraduate Computational Engineering and Sciences Awards, The Krell Institute

"Landau and Piez, authors of Computational Physics, have teamed up with Bordeianu to create an expanded work on introductory computational physics. Even more comprehensive than the first book, this volume contains up-to-date treatments of many new topics at the forefront of the field. . . . This volume offers everything needed for a graduate or undergraduate computational physics course."—K.D. Fisher, Choice

Product Details

Princeton University Press
Publication date:
Sold by:
Barnes & Noble
File size:
29 MB
This product may take a few minutes to download.

Read an Excerpt

A Survey of Computational Physics

By R. H. Landau M.J. Páez C.C. Bordeianu Princeton University Press
Copyright © 2008
Princeton University Press
All right reserved.

ISBN: 978-0-691-13137-5

Chapter One Computational Science Basics

Some people spend their entire lives reading but never get beyond reading the words on the page; they don't understand that the words are merely stepping stones placed across a fast-flowing river, and the reason they're there is so that we can reach the farther shore; it's the other side that matters. -José Saramago

As an introduction to the book to follow, we start this chapter with a description of how computational physics (CP) fits into the broader field of computational science, and what topics we will present as the contents of CP. We then get down to basics and examine computing languages, number representations, and programming. Related topics dealing with hardware basics are found in Chapter 14, "High-Performance Computing Hardware, Tuning, and Parallel Computing."

1.1 Computational Physics and Computational Science

This book adopts the view that CP is a subfield ofcomputational science. This means that CP is a multidisciplinary subject combining aspects of physics, applied mathematics, and computer science (CS) (Figure 1.1), with the aim of solving realistic physics problems. Other computational sciences replace the physics with biology, chemistry, engineering, and so on, and together face grand challenge problems such as

Climate prediction Materials science Structural biology Superconductivity Semiconductor design Drug design Human genome Quantum chromodynamics Turbulence Speech and vision Relativistic astrophysics Vehicle dynamics Nuclear fusion Combustion systems Oil and gas recovery Ocean science Vehicle signature Undersea surveillance

Although related, computational science is not computer science. Computer science studies computing for its own intrinsic interest and develops the hardware and software tools that computational scientists use. Likewise, applied mathematics develops and studies the algorithms that computational scientists use. As much as we too find math and computer science interesting for their own sakes, our focus is on solving physical problems; we need to understand the CS and math tools well enough to be able to solve our problems correctly.

As CP has matured, we have come to realize that it is more than the overlap of physics, computer science, and mathematics (Figure 1.1). It is also a bridge among them (the central region in Figure 1.1) containing core elements of it own, such as computational tools and methods. To us, CP's commonality of tools and a problem-solving mindset draws it toward the other computational sciences and away from the subspecialization found in so much of physics.

In order to emphasize our computational science focus, to the extent possible, we present the subjects in this book in the form of a problem to solve, with the components that constitute the solution separated according to the scientific problem-solving paradigm (Figure 1.2 left). Traditionally, physics employs both experimental and theoretical approaches to discover scientific truth (Figure 1.2 right). Being able to transform a theory into an algorithm requires significant theoretical insight, detailed physical and mathematical understanding, and a mastery of the art of programming. The actual debugging, testing, and organization of scientific programs is analogous to experimentation, with the numerical simulations of nature being essentially virtual experiments. The synthesis of numbers into generalizations, predictions, and conclusions requires the insight and intuition common to both experimental and theoretical science. In fact, the use of computation and simulation has now become so prevalent and essential a part of the scientific process that many people believe that the scientific paradigm has been extended to include simulation as an additional dimension (Figure 1.2 right).

1.2 How to Read and Use This Book

Figure 1.3 maps out the CP concepts we cover in this book and the relations among them. You may think of this concept map as the details left out of Figure 1.1. On the left are the hardware and software components from computer science; in the middle are the algorithms of applied mathematics; on the right are the physics applications. Yet because CP is multidisciplinary, it is easy to argue that certain concepts should be moved someplace else.

A more traditional way to view the materials in this text is in terms of its use in courses. In our classes [CPUG] we use approximately the first third of the text, with its emphasis on computing tools, for a course in scientific computing (after students have acquired familiarity with a compiled language). Typical topics covered in the 10 weeks of such a course are given in Table 1.1. Some options are indicated in the caption, and, depending upon the background of the students, other topics may be included or substituted. The latter two-thirds of the text includes more physics, and, indeed, we use it for a two-quarter (20-week) course in computational physics. Typical topics covered for each term are given in Table 1.2. What with many of the latter topics being research level, we suspect that these materials can easily be used for a full year's course as well.

For these materials to contribute to a successful learning experience, we assume that the reader will work through the problem at the beginning of each chapter or unit. This entails studying the text, writing, debugging and running programs, visualizing the results, and then expressing in words what has been done and what can be concluded. Further exploring is encouraged. Although we recognize that programming is a valuable skill for scientists, we also know that it is incredibly exacting and time-consuming. In order to lighten the workload somewhat, we provide "bare bones" programs in the text and on the CD. We recommend that these be used as guides for the reader's own programs or tested and extended to solve the problem at hand. As part of this approach we suggest that the learner write up a mini lab report for each problem containing

Equations solved Numerical method Code listing Visualization Discussion Critique

The report should be an executive summary of the type given to a boss or manager; make it clear that you understand the materials but do not waste everyone's time.

One of the most rewarding uses of computers is visualizing and analyzing the results of calculations with 2-D and 3-D plots, with color, and with animation. This assists in the debugging process, hastens the development of physical and mathematical intuition, and increases the enjoyment of the work. It is essential that you learn to use visualization tools as soon as possible, and so in Chapter 3, "Visualization Tools," and Appendix C we describe a number of free visualization -1 tools that we use and recommend. We include many figures showing visualizations 0 (unfortunately just in gray scale), with color versions on the CD.

We have tried to make the multifaceted contents of this book clearer by use of the following symbols and fonts:

in the margin Material on the CD [??] Optional material [??] at line's end End of exercise or problem Monospace font Words as they would appear on a computer screen Italic font Note at beginning of chapter to the reader about what's to follow Sans serif font Program commands from drop-down menus

We also indicate a user-computer dialog via three different fonts on a line:

Monospace computer's output > Bold monospace user's command Comments

Code listings are formatted within a shaded box, with italic key words and bold comments (usually on the right):

for ( i = 0 ; i <= Nxmax ; i ++ ) { // Comment: Fluid surface u [i] [Nymax] = u [i] [Nymax-1] + V0*h; w[i] [Nymax-1] = 0 . ; }

public double getI () { return (2./5.) * m * r * r; } // Method getI

Note that we have tried to structure the codes so that a line is skipped before each method, so that each logical structure is indented by two spaces, and so that the ending brace } of a logical element is on a separate line aligned with the beginning of the logic element. However, in order to conserve space, sometimes we do not insert blank lines even though it may add clarity, sometimes the commands for short methods or logical structures are placed on a single line, and usually we combine multiple ending braces on the last line.

Although we try to be careful to define each term the first time it is used, we also have included a glossary in Appendix A for reference. Further, Appendix B describes the steps needed to install some of the software packages we recommend, and Appendix F lists the names and functions of the various items on the CD.

1.3 Making Computers Obey; Languages (Theory)

Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate, and brilliant; together they are powerful beyond imagination. - Albert Einstein

As anthropomorphic as your view of your computer may be, keep in mind that -1 computers always do exactly as they are told. This means that you must tell them exactly everything they have to do. Of course the programs you run may have such convoluted logic that you may not have the endurance to figure out the details of what you have told the computer to do, but it is always possible in principle. So your first problem is to obtain enough understanding so that you feel well enough in control, no matter how illusionary, to figure out what the computer is doing.

Before you tell the computer to obey your orders, you need to understand that life is not simple for computers. The instructions they understand are in a basic machine language that tells the hardware to do things like move a number stored in one memory location to another location or to do some simple binary arithmetic. Very few computational scientists talk to computers in a language computers can understand. When writing and running programs, we usually communicate to the computer through shells, in high-level languages (Java, Fortran, C), or through problem-solving environments (Maple, Mathematica, and Matlab). Eventually these commands or programs are translated into the basic machine language that the hardware understands.

A shell is a command-line interpreter, that is, a set of small programs run by a computer that respond to the commands (the names of the programs) that you key in. Usually you open a special window to access the shell, and this window is called a shell as well. It is helpful to think of these shells as the outer layers of the computer's operating system (OS) (Figure 1.4), within which lies a kernel of elementary operations. (The user seldom interacts directly with the kernel, except possibly when installing programs or when building an operating system from scratch.) It is the job of the shell to run programs, compilers, and utilities that do things like copying files. There can be different types of shells on a single computer or multiple copies of the same shell running at the same time.

Operating systems have names such as Unix, Linux, DOS, MacOS, and MS Windows. The operating system is a group of programs used by the computer to communicate with users and devices, to store and read data, and to execute programs. Under Unix and Linux, the OS tells the computer what to do in an elementary way, while Windows includes various graphical elements as part of the operating system (this increases speed at the cost of complexity). The OS views you, other devices, and programs as input data for it to process; in many ways, it is the indispensable office manager. While all this may seem complicated, the purpose of the OS is to let the computer do the nitty-gritty work so that you can think higher-level thoughts and communicate with the computer in something closer to your normal everyday language.

When you submit a program to your computer in a high-level language, the computer uses a compiler to process it. The compiler is another program that treats your program as a foreign language and uses a built-in dictionary and set of rules to translate it into basic machine language. As you can probably imagine, the final set of instructions is quite detailed and long and the compiler may make several passes through your program to decipher your logic and translate it into a fast code. The translated statements form an object or compiled code, and when linked together with other needed subprograms, form a load module. A load module is a complete set of machine language instructions that can be loaded into the computer's memory and read, understood, and followed by the computer.

Languages such as Fortran and ITLITL use compilers to read your entire program and then translate it into basic machine instructions. Languages such as BASIC and Maple translate each line of your program as it is entered. Compiled languages usually lead to more efficient programs and permit the use of vast subprogram libraries. Interpreted languages give a more immediate response to the user and thereby appear "friendlier." The Java language is a mix of the two. When you first compile your program, it interprets it into an intermediate, universal byte code, but then when you run your program, it recompiles the byte code into a machine-specific compiled code.

1.4 Programming Warmup

Before we go on to serious work, we want to ensure that your local computer is working right for you. Assume that calculators have not yet been invented and that you need a program to calculate the area of a circle. Rather than use any specific language, write that program in pseudocode that can be converted to your favorite language later. The first program tells the computer: Calculate area of circle // Do this computer! This program cannot really work because it does not tell the computer which circle to consider and what to do with the area. A better program would be

read radius // Input calculate area of circle // Numerics print area // Output

The instruction calculate area of circle has no meaning in most computer languages, so we need to specify an algorithm, that is, a set of rules for the computer to follow:

read radius // Input PI = 3.141593 // Set constant area = PI * r * r // Algorithm print area // Output

This is a better program, and so let's see how to implement it in Java (other languageversions are on the CD). In Listing 1.1 we give a Java version of our area program. This is a simple program that outputs to the screen and has its input entered via statements.


Excerpted from A Survey of Computational Physics by R. H. Landau M.J. Páez C.C. Bordeianu
Copyright © 2008 by Princeton University Press. Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Read More

What People are saying about this

Ali Eskandarian
This book is a welcome addition to the existing literature on the subject. It is needed as much for its pedagogical approach to computational thinking as for its choice of topics in computational physics. Its use of Java as the main programming language brings it up to date with the skills that the new generation of students will bring to class.
Ali Eskandarian, George Washington University
In addition to being an excellent undergraduate textbook, A Survey of Computational Physics will be useful to scientists wanting a good reference on basic computational modeling methods.
John W. Mintmire, Oklahoma State University

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

A Survey of Computational Physics: Introductory Computational Science 0 out of 5 based on 0 ratings. 0 reviews.