TABLE OF CONTENTS:
List of Figures xv List of Tables xix Preface xxi
Chapter 1. Introduction 1 1.1 Nature of Scientific Computing 1 1.2 Talking to Computers 2 1.3 Instructional Guide 4 1.4 Exercises to Come Back To 6
PART 1. MAPLE (OR MATHEMATICA) BY DOING 7
Chapter 2. Getting Started with Maple 9 2.1 Setting Up Your Work Space 9 2.2 Maples Problem-Solving Environment 10 2.3 Maples Command Structure 14 2.4 Sums and sums 16 2.5 Execution Groups 21 2.6 Key Words and Concepts 22 2.7 Supplementary Exercises 23
Chapter 3. Numbers, Expressions, Functions; Rocket Golf 25 3.1 Problem: Viewing Rocket Golf 25 3.2 Theory: Einsteins Special Relativity 26 3.3 Math: Integer, Rational and Irrational Numbers 27 3.4 CS: Floating-Point Numbers 29 3.5 Complex Numbers 31 3.6 Expressions 32 3.7 Assignment Statements 34 3.8 Equality (rhs, lhs) 36 3.9 Functions 36 3.10 User-Defined Functions 39 3.11 Reexpressing Answers 39 3.12 CS: Overflow, Underflow, and Round-Off Error 44 3.13 Solution: Viewing Rocket Golf 45 3.14 Extension: Tachyons* 50 3.15 Key Words and Concepts 51 3.16 Supplementary Exercises 51
Chapter 4. Visualizing Data, Abstract Types; Electric Fields 55 4.1 Why Visualization? 55 4.2 Problem: Stable Points in Electric Fields 56 4.3 Theory: Stability Criteria and Potential Energy 56 4.4 Basic 2-D Plots: plot 58 4.5 Compound (Abstract) Data Types: [Lists] and {Sets } 63 4.6 3-D (Surface) Plots of Analytic Functions 69 4.7 Solution: Dipole and Quadrupole Fields 73 4.8 Exploration: The Tripole 76 4.9 Extension: Yet More Plot Types* 76 4.10 Visualizing Numerical Data 91 4.11 Plotting a Matrix: matrixplot* 97 4.12 Animations of Data* 102 4.13 Key Words and Concepts 104 4.14 Supplementary Exercises 105
Chapter 5. Solving Equations, Differentiation; Towers 107 5.1 Problem: Maximum Height of a Tower 107 5.2 Model: Block Stacking 107 5.3 Math: Equations as Challenges 109 5.4 Solving a Single Equation: solve, fsolve 110 5.5 Solving Simultaneous Equations (Sets) 113 5.6 Solution to Tower Problem 115 5.7 Differentiation: limit, diff, D 117 5.8 Numerical Derivatives* 126 5.9 Alternate Solution: Maximum Tower Height 127 5.10 Assessment and Exploration 128 5.11 Auxiliary Problem: Nonlinear Oscillations 129 5.12 Key Words and Concepts 131 5.13 Supplementary Exercises 131
Chapter 6. Integration; Power and Energy Usage (Also 14) 134 6.1 Problem: Relating Power and Energy Usage 134 6.2 Empirical Models 134 6.3 Theory: Power and Energy Definitions 136 6.4 Maple: Tools for Integration 136 6.5 Problem Solution: Energy from Power 139 6.6 Key Words and Concepts 143 6.7 Supplementary Exercises 144
Chapter 7. Matrices and Vectors; Rotation 145 7.1 Problem: Rigid-Body Rotation 145 7.2 Math: Vectors and Matrices 147 7.3 Theory: Angular Momentum Dynamics 149 7.4 Maple: Linear Algebra Tools 151 7.5 Matrix Arithmetic and Operations 157 7.6 Solution: Rotating Rigid Bodies 171 7.7 Exploration: Principal Axes of Rotation* 176 7.8 Key Words and Concepts 181 7.9 Supplementary Exercises 182
Chapter 8. Searching, Programming; Dipsticks 184 8.1 Problem: Volume of Liquid in Spherical Tanks 184 8.2 Math: Volume Integration 184 8.3 Algorithm: Bisection Searches 185 8.4 Programming in Maple 187 8.5 Solution: Volume from Dipstick Height 194 8.6 Key Words and Concepts 195 8.7 Supplementary Exercises 196
PART 2. JAVA (OR FORTRAN90) BY DOING 197
Chapter 9. Getting Started with Java 199 9.1 Compiled Languages 199 9.2 Java Program Pieces 201 9.3 Entering and Running Your First Program 202 9.4 Looking Inside Area.java 205 9.5 Key Words 207 9.6 Supplementary Exercises 207
Chapter 10. Data Types, Limits, Methods; Rocket Golf 208 10.1 Problem and Theory (Same as Chapter 3) 208 10.2 Javas Primitive Data Types 208 10.3 Methods (Functions) and Modular Programming 215 10.4 Solution: Viewing Rocket Golf 219 10.5 Your Problem: Modify Golf.java 223 10.6 Coercion and Overloading* 224 10.7 Key Words 229
Chapter 11. Visualization with Java, Classes, Packages 232 11.1 2-D Graphs within Java: PtPlot 232 11.2 Installing PtPlot: See Appendix C* 238 11.3 Classes and Packages* 238 11.4 Gnuplot Basics 240 11.5 Java Archives: jar* 244
Chapter 12. Flow Control via Logic; Projectiles 247 12.1 Problem: Frictionless Projectile Motion 247 12.2 Theory: Kinematics 248 12.3 Computer Science: Designing Structured Programs 249 12.4 Flow Control via Logic 251 12.5 Implementation: Projectile.java 258 12.6 Solution: Projectile Trajectories 259 12.7 Key Words 259 12.8 Supplementary Exercises 260
Chapter 13. Java Input and Output* 262 13.1 Basic Input with Scanner 263 13.2 Streams: Standard Output, Input, and Error 263 13.3 I/O Exceptions: FileCatchThrow.java 272 13.4 Automatic Code Documentation: javadoc 274 13.5 Nonstandard Formatted Output: printf 275
Chapter 14. Numerical Integration; Power and Energy Usage 281 14.1 Problem (Same as Chapter 6): Power and Energy 281 14.2 Algorithms: Trapezoid and Simpsons Rules 282 14.3 Assessment: Which Rule Is Better? 288 14.4 Key Words and Concepts 289 14.5 Supplementary Exercises 289
Chapter 15. Differential Equations with Java and Maple* 290 15.1 Problem: Projectile Motion with Drag 290 15.2 Model: Velocity-Dependent Drag 291 15.3 Algorithm: Numerical Differentiation 292 15.4 Math: Solving Differential Equations 292 15.5 Assessment: Balls Falling Out of the Sky? 295 15.6 Maple: Differential-Equation Tools 297 15.7 Maple Solution: Drag &8733; Velocity 302 15.8 Extract Operands 303 15.9 Drag &8733;v2 (Exercise) 306 15.10 Drag &8733;v3/2 306 15.11 Exploration: Planetary Motion* 310 15.12 Key Words 311 15.13 Supplementary Exercises 311
Chapter 16. Object-Oriented Programming; Complex Currents 313 16.1 Problem: Resonance in RLC Circuit 313 16.2 Math: Complex Numbers 313 16.3 Theory: Resistance Becomes Impedance 317 16.4 CS: Abstract Data Types, Objects 319 16.5 Java Solution: Complex Currents 329 16.6 Maple Solution: Complex Currents 330 16.7 Explorations: OOP Worked Examples* 334 16.8 Key Words 340 16.9 Java and Maple Exercises 340
Chapter 17. Arrays: Vectors, Matrices; Rigid-Body Rotations 341 17.1 Problem: Rigid-Body Rotations 341 17.2 Theory: Angular-Momentum Dynamics 343 17.3 CS, Math: Arrays, Vectors, and Matrices 344 17.4 Implementation: Inertia.java, Inertia3D.java 347 17.5 Jama: Java Matrix Library* 349 17.6 Key Words 353 17.7 Supplementary Exercises 353
Chapter 18. Advanced Objects; Baton Projectiles* 355 18.1 Problem: Trajectory of Thrown Baton 355 18.2 Theory: Combined Translation and Rotation 356 18.3 CS: OOP Design Concepts 359 18.4 Key Words 377 18.5 Supplementary Exercises 377
Chapter 19. Discrete Math, Arrays as Bins; Bug Dynamics* 378 19.1 Problem: Variability of Bug Populations 378 19.2 Theory: Self-Limiting Growth, Discrete Maps 378 19.3 Assessment: Properties of Nonlinear Maps 380 19.4 Exploration: Bifurcation Diagram, BugSort.java* 381 19.5 Exploration: Other Discrete Maps* 384
Chapter 20. 2-D Arrays: File I/O, PDEs; Realistic Capacitor 385 20.1 Problem: Field of Realistic Capacitor 385 20.2 Theory and Model: Electrostatics and PDEs 385 20.3 Algorithm: Finite Differences 387 20.4 Implementation: Laplace.java 389 20.5 Exploration: 2-D Capacitor 391 20.6 Exploration: 3-D Capacitor* 393 20.7 Key Words 393
Chapter 21. Web Computing, Applets, Primitive Graphics 394 21.1 What Is Web Computing? 394 21.2 Implementation: Get This to Work First 396 21.3 Exploration: Modify Applet1.java 401 21.4 Extension: PtPlot as Applet* 402 21.5 Extension: Applet with Button Input* 403 21.6 Extension: AWT, JFC, and Swing* 405 21.7 Example: Baton Applet, Jparabola.java* 407 21.8 Key Words 410 21.9 Supplementary Exercises 410
PART 3. LATEX SURVIVAL GUIDE 411
Chapter 22. LATEX for Text 413 22.1 Why LATEX? 413 22.2 Structure of a LATEXDocument 414 22.3 Sample Input File (Sample.tex) 414 22.4 Sample LATEXOutput 416 22.5 Fonts for Text 420 22.6 Environments 422 22.7 Lists 422 22.8 Sections 425
Chapter 23. LATEX for Mathematics 427 23.1 Entering Mathematics: Math Mode 427 23.2 Mathematical Symbols and Greek 428 23.3 Math Accents 431 23.4 Superscripts and Subscripts 431 23.5 Calculus and Sums 431 23.6 Changing Math Fonts 432 23.7 Math Functions 432 23.8 Fractions 432 23.9 Roots 433 23.10 Brackets (Delimiters) 433 23.11 Multiline Equations 434 23.12 Matrices and Math Arrays 435 23.13 Including Graphics 436 23.14 Exercise: Putting It All Together 438
Appendix A. Glossary 441 Appendix B. Maple Quick Reference, Debugging Help 450 Appendix C. Java Quick Reference and Installing Software 461 C.1 Java Elements 461 C.2 Transferring Files from the CD 465 C.3 Using our Maple Worksheets 466 C.4 Using our Java Programs 466 C.5 Installing PtPlot (or Other) Packages 467 C.6 Installing Java Developers Kit 469
Bibliography 471 Index 477
|