0% found this document useful (0 votes)
126 views

Introduction To Modeling and Simulation With Matlab and Python - Gordon and Guilfoos

Uploaded by

Martin Cohen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
126 views

Introduction To Modeling and Simulation With Matlab and Python - Gordon and Guilfoos

Uploaded by

Martin Cohen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 203
| (OUR avec (ee eer mere ee a") ie Nl COUR ICM O ILO LbS) wy ore} ery alll sf 3 ii, iil hates , Introduction to Modeling and Simulation with MATLAB?® and Python PUBLISHED TITLES CONTINUED HIGH PERFORMANCE PARALLEL I/O Prabhat and Quincey Koziol HIGH PERFORMANCE VISUALIZATION: ENABLING EXTREME-SCALE SCIENTIFIC INSIGHT Edited by E. Wes Bethel, Hank Childs, and Charles Hansen INDUSTRIAL APPLICATIONS OF HIGH-PERFORMANCE COMPUTING: BEST GLOBAL PRACTICES Edited by Anwar Osseyran and Merle Giles INTRODUCTION TO COMPUTATIONAL MODELING USING C AND OPEN-SOURCE TOOLS José M Garrido INTRODUCTION TO CONCURRENCY IN PROGRAMMING LANGUAGES Matthew J. Sottile, Timothy G. Mattson, and Craig E Rasmussen INTRODUCTION TO ELEMENTARY COMPUTATIONAL MODELING: ESSENTIAL CONCEPTS, PRINCIPLES, AND PROBLEM SOLVING José M. Garrido INTRODUCTION TO HIGH PERFORMANCE COMPUTING FOR SCIENTISTS, AND ENGINEERS Georg Hager and Gerhard Wellein INTRODUCTION TO MODELING AND SIMULATION WITH MATLAB® AND PYTHON Steven I. Gordon and Brian Guilfoos INTRODUCTION TO REVERSIBLE COMPUTING Kalyan S. Perumalla INTRODUCTION TO SCHEDULING Yves Robert and Frédéric Vivien INTRODUCTION TO THE SIMULATION OF DYNAMICS USING SIMULINK® Michael A. Gray PEER-TO-PEER COMPUTING: APPLICATIONS, ARCHITECTURE, PROTOCOLS, AND CHALLENGES Yu-Kwong Ricky Kwok PERFORMANCE TUNING OF SCIENTIFIC APPLICATIONS Edited by David Bailey, Robert Lucas, and Samuel Williams PETASCALE COMPUTING: ALGORITHMS AND APPLICATIONS Edited by David A. Bader PROCESS ALGEBRA FOR PARALLEL AND DISTRIBUTED PROCESSING Edited by Michael Alexander and William Gardner PROGRAMMING FOR HYBRID MULTI/MANY-CORE MPP SYSTEMS John Levesque and Aaron Vose PUBLISHED TITLES CONTINUED SCIENTIFIC DATA MANAGEMENT: CHALLENGES, TECHNOLOGY, AND DEPLOYMENT Edited by Arie Shoshani and Doron Rotem SOFTWARE ENGINEERING FOR SCIENCE Edited by Jeffrey C. Carver, Neil P. Chue Hong, and George K. Thiruvathukal Introduction to Modeling and Simulation with MATLAB? and Python Steven I. Gordon Brian Guilfoos CRC Press Taylor & Francis Group: Boca Raton London New Yor: ACHAPMANBHALL BOOK MATLAB? and Simulink? are trademarks of the MathWorks, Inc. and are used with permission. The MathWorks does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® and Simulink® software or related products does not constitute endorsement or sponsorship by the MathWorks of a particular pedagogical approach or particular use of the MATLAB? and Simulink® software. CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2017 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Printed on acid-free paper International Standard Book Number-13: 978-1-4987-7387-4 (Hardback) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www. copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Mix Printed and bound in Great Britain by TJ International Led, Padstow, Cornwall Contents Preface, xiii Authors, xvii Cuapter 1» Introduction to Computational Modeling 1 1.1. THE IMPORTANCE OF COMPUTATIONAL SCIENCE 1 1.2. HOW MODELING HAS CONTRIBUTED TO ADVANCES IN SCIENCE AND ENGINEERING 3 1.2.1 Some Contemporary Examples 8 1.3. THE MODELING PROCESS 9 1.3.1 Steps in the Modeling Process 11 1.3.2. Mathematical Modeling Terminology and Approaches to Simulation 14 1.3.3 Modeling and Simulation Terminology 14 1.3.4 Example Applications of Modeling and Simulation 15 EXERCISES 17 REFERENCES 18 Cxapter 2 « Introduction to Programming Environments 21 2.1 THE MATLAB® PROGRAMMING ENVIRONMENT 21 2.1.1 The MATLAB® Interface 21 2.1.2 Basic Syntax 23 2.1.2.1 Variables and Operators 23 2.1.2.2 Keywords 25 2.1.2.3 Lists and Arrays 26 2.1.3. Common Functions 28 vii viii_ = Contents 2.1.4 Program Execution 2.1.5 Creating Repeatable Code 3 2.1.6 Debugging 5 2.2. THE PYTHON ENVIRONMENT 30 2.2.1 Recommendations and Installation 30 2.2.2 The Spyder Interface a 2.2.3 Basic Syntax 2 2.2.3.1. Variables and Operators a 2.2.3.2. Keywords 4 2.2.3.3 Lists and Arrays 35 2.2.4 Loading Libraries 38 2.2.5 Common Functions 39 2.2.6 Program Execution 40 2.2.7. Creating Repeatable Code 40 2.2.8 Debugging 41 EXERCISES 42 Cuapter 3» Deterministic Linear Models 45 3.1. SELECTING A MATHEMATICAL REPRESENTATION FOR A MODEL 45 3.2 LINEAR MODELS AND LINEAR EQUATIONS, 46 3.3. LINEAR INTERPOLATION 49 3.4 SYSTEMS OF LINEAR EQUATIONS 5 3.5 LIMITATIONS OF LINEAR MODELS 5 EXERCISES 52 REFERENCES 53 CxapTer 4» Array Mathematics in MATLAB® and Python _5° 4.1. INTRODUCTION TO ARRAYS AND MATRICES, 5 4.2. BRIEF OVERVIEW OF MATRIX MATHEMATICS, 56 4.3. MATRIX OPERATIONS IN MATLAB® 58 4.4. MATRIX OPERATIONS IN PYTHON 7 6 EXERCISES Contents = ix Cuarter 5 Plotting 61 5.1 PLOTTING IN MATLAB® 61 5.2 PLOTTING IN PYTHON 68 EXERCISES 76 Cuarter 6 » Problem Solving 79 6.1 OVERVIEW 79 6.2 BOTTLE FILLING EXAMPLE 80 6.3 TOOLS FOR PROGRAM DEVELOPMENT 81 6.3.1 Pseudocode 82 6.3.2 Top-Down Design 82 6.3.3 Flowcharts 83 6.4 BOTTLE FILLING EXAMPLE CONTINUED 84 EXERCISES 85 Cxarter 7 » Conditional Statements 87 7.1 RELATIONAL OPERATORS 87 7.2 LOGICAL OPERATORS 88 7.3 CONDITIONAL STATEMENTS 89 7.3.1 MATLAB® 89 7.3.2 Python 92 EXERCISES 95 Cuarter 8 » Iteration and Loops 97 8.1 FOR LOOPS 97 8.1.1 MATLAB® Loops 97 8.1.2 Python Loops 98 8.2. WHILE LOOPS 99 8.2.1 MATLAB® While Loops 99 8.2.2 Python While Loops 99 8.3. CONTROL STATEMENTS 100 8.3.1 Continue 100 8.3.2 Break 100 EXERCISES 100 x ® Contents Carter 9 » Nonlinear and Dynamic Models 10 9.1 MODELING COMPLEX SYSTEMS 0 9.2 SYSTEMS DYNAMICS 0 9.2.1 Components of a System 10 9.2.2. Unconstrained Growth and Decay 0 9.2.2.1 Unconstrained Growth Exercises 0 9.2.3. Constrained Growth 10 9.2.3.1 Constrained Growth Exercise ul 9.3. MODELING PHYSICAL AND SOCIAL PHENOMENA 9.3.1 Simple Model of Tossed Ball ll 9.3.2 Extending the Model L 9.3.2.1 Ball Toss Exercise l REFERENCES 1 Cuapter 10 » Estimating Models from Empirical Data 1 10.1 USING DATA TO BUILD FORECASTING MODELS 1; 10.1.1 Limitations of Empirical Models ut 10.2 FITTING A MATHEMATICAL FUNCTION TO DATA _ 12( 10.2.1 Fitting a Linear Model 12; 10.2.2 Linear Models with Multiple Predictors 12! 10.2.3. Nonlinear Model Estimation 12 10.2.3.1 Limitations with Linear Transformation 13 10.2.3.2 Nonlinear Fitting and Regression 13 10.2.3.3 Segmentation 13 EXERCISES 3 FURTHER READINGS 13: REFERENCES 13. Cuapter 11.» Stochastic Models 13. 11.1. INTRODUCTION B. 11.2 CREATING A STOCHASTIC MODEL 13 Contents = xi 11.3. RANDOM NUMBER GENERATORS IN MATLAB® AND PYTHON 136 11.4 A SIMPLE CODE EXAMPLE 137 11.5 EXAMPLES OF LARGER SCALE STOCHASTIC MODELS 139 EXERCISES 142 FURTHER READINGS 143 REFERENCES 143 Cuapter 12 « Functions 145 12.1. MATLAB® FUNCTIONS 145 12.2 PYTHON FUNCTIONS 147 12.2.1 Functions Syntax in Python 147 12.2.2. Python Modules 148 EXERCISES 149 Cuapter 13 » Verification, Validation, and Errors 151 13.1. INTRODUCTION 151 13.2 ERRORS 152 13.2.1. Absolute and Relative Error 152 13.2.2 Precision 153 13.2.3. Truncation and Rounding Error 153 13.2.4 Violating Numeric Associative and Distributive Properties 155 13.2.5 Algorithms and Errors 155 13.2.5.1_ Euler's Method 156 13.2.5.2 Runge-Kutta Method 158 13.2.6 ODE Modules in MATLAB® and Python 159 13.3. VERIFICATION AND VALIDATION 159 13.3.1 History and Definitions 160 13.3.2 Verification Guidelines 162 xii_ = Contents 13.3.3 Validation Guidelines 163 13.3.3.1 Quantitative and Statistical Validation Measures 164 13.3,3.2 Graphical Methods 166 EXERCISES 166 REFERENCES 167 Chapter 14 » Capstone Projects 169 14.1 INTRODUCTION 169 14.2 PROJECT GOALS 170 14.3. PROJECT DESCRIPTIONS 171 14.3.1 Drug Dosage Model 171 14.3.2 Malaria Model 172 14.3.3 Population Dynamics Model 174 14.3.4 Skydiver Project 176 14.3.5 Sewage Project 178 14.3.6 Empirical Model of Heart Disease Risk Factors 180 14.3.7 Stochastic Model of Traffic 180 14.3.8 Other Project Options 181 REFERENCE 181 INDEX, 183 Preface Me AND SIMULATION USING computation or computational science has become an essential part of the research and develop- ment process in the physical, biological, and social sciences and engi- neering. It allows the exploration of physical and biological systems at the micro- and molecular level that increase our understanding of their function and the discovery of new materials and new drugs. It allows us to understand the interactions of components in complex systems from those we engineer and build to our ecosystems and climate. In recent years, computational science has produced enormous advances in almost all fields of scientific and technological inquiry, including DNA sequenc- ing, behavioral modeling, global climatic predictions, drug design, finan- cial systems, and medical visualization. At the same time, it has become critical in the design, testing, and manufacturing of new products and services, saving millions of dollars in development costs and getting new products to market more rapidly. Scientists, social scientists, and engineers must have an understand- ing of both modeling and computer programming principles so that they appropriately apply those techniques in their practice. Several sets of knowledge and skills are required to achieve that understanding. How do we translate the relationships within a system being modeled into a set of mathematical functions that accurately portray the behavior of that system? How are the mathematics translated into computer code that correctly simulates those relationships? What is the nature of errors introduced by simplifying the depiction of the system, introduced by the computer algorithm used to solve the equations, and limited by our knowledge of the system behavior? How accurate is the model? How do we know the model is logically correct and follows from the physical and mathematical laws used to create it (verification)? How do we demonstrate xiii xiv m= Preface that the model correctly predicts the phenomena modeled (validation)? ‘These are the underlying questions that are the focus of this book. ‘The book is intended for students and professionals in science, social science, and engineering who wish to learn the principles of computer modeling as well as basic programming skills. For many students in these fields, with the exception of computer science students and some engineer- ing students, enrollment in an introductory programming course may be impractical or difficult. At many institutions, these courses are focused primarily on computer science majors and use a programming language such as Java that is not readily applicable to science and engineering prob- lems. We have found that teaching programming as a just-in-time tool used to solve real problems more deeply engages those students to master the programming concepts. Combining that effort with learning the prin- ciples of modeling and simulation provides the link between program- ming and problem solving while also fitting more readily into a crowded curriculum. For students from all fields, learning the basic principles of modeling and simulation prepares them for understanding and using computer modeling techniques that are being applied to a myriad of problems. The knowledge of the modeling process should provide the basis for under- standing and evaluating models in their own subject domain. The book content focuses on meeting a set of basic modeling and simulation compe- tencies that were developed as part of several National Science Foundation grants (see http://hpcuniversity.org/educators/undergradCompetencies/). Even though computer science students are much more expert program- mers, they are not often given the opportunity to see how those skills are being applied to solve complex science and engineering problems, and may also not be aware of the libraries used by scientists to create those models. We have chosen to use MATLAB® and Python for several reasons. First, both offer interfaces that the intended audience should find intuitive. Both interfaces provide instant feedback on syntax errors and extensive help documents and tutorials that are important for novice programmers. Although MATLAB is a commercially licensed program, whereas Python is open source, many campuses currently have a site license for MATLAB. Students can also purchase the student version of MATLAB relatively cheaply. Perhaps most importantly, both programs are extensively used by the science and engineering community for model development and test- ing. Even though neither program scales as efficiently as C, Fortran, ae Preface = xv or other languages for large-scale modeling on current parallel comput- ing architectures, they do offer a stepping stone to those environments. Both have extensive toolkits and scientific and mathematical libraries that can be invoked to reduce the amount of coding required to undertake many modeling projects. Although we use these programming environ- ments to teach rudimentary programming techniques without applying a large number of these tools, they are available to students for develop- ing capstone projects or for use in more advanced courses later in their curriculum. ORGANIZATION OF THE BOOK The book interleaves chapters on modeling concepts and related exercises with programming concepts and exercises. We start out with an introduc- tion to modeling and its importance to current practices in the sciences and engineering. We then introduce each of the programming environ- ments and the syntax used to represent variables and compute math- ematical equations and functions. As students gain more programming expertise, we go back to modeling concepts, providing starting code for a variety of exercises where students add additional code to solve the prob- lem and provide an analysis of the outcomes. In this way, we build both modeling and programming expertise with a “just-in-time” approach so that by the end of the book, students can take on relatively simple model- ing example on their own. Each chapter is supplemented with references to additional read- ing, tutorials, and exercises that guide students to additional help and allow them to practice both their programming and analytical modeling skills. The companion website at http://www.intromodeling.com provides updates to instructions when there are substantial changes in software versions as well as electronic copies of exercises and the related code. Solutions to the computer exercises are available to instructors on the publisher's website. Each of the programming-related chapters is divided into two parts— one for MATLAB and one for Python. We assume that most instructors will choose one or the other so that students can focus only on the lan- guage associated with their course. In these chapters, we also refer to addi- tional online tutorials that students can use if they are having difficulty with any of the topics. The book culminates with a set of final project exercise suggestions that incorporate both the modeling and the programming skills provided in xvi @ Preface the rest of the volume. These projects could be undertaken by individuals or small groups of students. They generally involve research into a par- ticular modeling problem with suggested background reading from the literature. Each exercise has a set of starting code providing a very simplis- tic view of the system and suggestions for extending the model by adding additional components to relax some of the assumptions. Students then complete the program code and use the model to answer a number of questions about the system, complete model verification and validation where possible, and present a report in written and oral form. The website also offers a space where people can suggest additional projects they are willing to share as well as comments on the existing proj- ects and exercises throughout the book. We hope that the combination of materials contributes to the success of those interested in gaining model- ing and simulation expertise. MATLAB?® is a registered trademark of The MathWorks, Inc. For product information, please contact: The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 USA Tel: 508 647 7000 Fax: 508-647-7001 E-mail: [email protected] Web: www.mathworks.com Authors Steven I. Gordon is a professor emeritus of the City and Regional Planning and Environmental Science Programsat the Ohio State University, Columbus, Ohio. He earned a bachelor’s degree from the University at Buffalo, Buffalo, New York, in 1966 and a PhD degree from Columbia University, New York, in 1977. He also serves as the senior education lead at the Ohio Supercomputer Center. In that and other roles at OSC, he has focused primarily on the integration of computational science into the curricula at higher education institutions in Ohio and throughout the United States. He has worked with multiple institutions through a variety of grants from the National Science Foundation, including the Extreme Science and Engineering Discovery Environment (XSEDE) and Blue Waters project. Dr. Gordon is also one of the founders and first chair of the Association of Computing Machinery (ACM) Special Interest Group High Performance Computing (SIGHPC) Education Chapter and serves as a representative of the SIGHPC on the ACM Education Council. He has published exten- sively on topics related to environmental planning and the applications of modeling and simulation in education and research. Brian Guilfoos serves as the High Performance Computing (HPC) Client Services manager for the Ohio Supercomputer Center (OSC), Columbus, Ohio. Guilfoos leads the HPC Client Services Group, which provides train- ing and user support to facilitate the use of computational science by the center’s user communities. He earned a master’s degree in public policy and administration in 2014 and a bachelor’s degree in electrical engineering in 2000, both from the Ohio State University, Columbus, Ohio. He also works directly with OSC clients to help convert computer codes and develop batch scripting, compiling, and code development so that these researchers can efficiently use the center’s supercomputers and licensed software. xviii § Authors Guilfoos developed and delivered training in MATLAB® as a part of the U.S. Department of Defense High Performance Computing Modernization Program support. Prior to joining OSC, he was contracted by the Air Force Research Laboratory (AFRL) to focus on software development in support of unmanned aerial vehicle interface research. He was a key technical mem- ber of a team that was awarded the 2004 Scientific and Technological Achievement Award by the AFRL’s Human Effectiveness Directorate. CHAPTER 1 Introduction to Computational Modeling 1.1. THE IMPORTANCE OF COMPUTATIONAL SCIENCE Advances in science and engineering have come traditionally from the application of the scientific method using theory and experimentation to pose and test our ideas about the nature of our world from multiple perspectives. Through experimentation and observation, scientists develop theories that are then tested with additional experimentation. The cause and effect relationships associated with those discoveries can then be represented by mathematical expressions that approximate the behavior of the system being studied. With the rapid development of computers, scientists and engineers translated those mathematical expressions into computer codes that allowed them to imitate the operation of the system over time. This pro- cess is called simulation. Early computers did not have the capability of solving many of the complex system simulations of interest to scientists and engineers. This led to the development of supercomputers, comput- ers with higher level capacity for computation compared to the general- purpose computers of the time. In 1982, a panel of scientists provided a report to the U.S. Department of Defense and the National Science Foundation urging the government to aid in the development of super- computers (Lax, 1982). They indicated that “the primacy of the U.S. in sci- ence, engineering, and computing technology could be threatened relative to that of other countries with national efforts in supercomputer access 1 2 ® Modeling and Simulation with MATLAB® and Python and development.” They recommended both investments in research and development and in the training of personnel in science and engineering computing. ‘The capability of the computer chips in your cell phone today far exceeds that of the supercomputers of the 1980s. The Cray-1 super- computer released in 1975 had a raw computing power of 80 million floating-point operations per second (FLOPS). The iPhone 5s has a graph- ics processor capable of 76.8 Gigaflops, nearly one thousand times more powerful (Nick, 2014). With that growth in capability, there has been a dramatic expansion in the use of simulation for engineering design and research in science, engineering, social science, and the humanities. Over the years, that has led to many efforts to integrate computational science into the curriculum, to calls for development of a workforce prepared to apply computing to both academic and commercial pursuits, and to investments in the computer and networking infrastructure required to meet the demands of those applications. For example, in 2001 the Society for Industrial and Applied Mathematics (SIAM) provided a review of the graduate education programs in science and engineering (SLAM, 2001). They defined computational science and engineering as a multidisciplinary field requiring expertise in computer science, applied mathematics, and a subject field of science and engineering. They pro- vided examples of emerging research, an outline of a curriculum, and curriculum examples from both North America and Europe. Yasar and Landau (2001) provided a similar overview of the interdisci- plinary nature of the field. They also describe the possible scope of programs at the both the undergraduate and graduate levels and provide a survey of existing programs and their content. More recently, Gordon et al. (2008) described the creation of a competency-based undergraduate minor pro- gram in computational science that was put into place at several institutions in Ohio. The competencies were developed by an interdisciplinary group of faculty and reviewed by an industry advisory committee from the perspective of the skills that prospective employers are looking for in students entering the job market. The competencies have guided the creation of several other undergraduate programs. They have also been updated and augmented with graduate-level computational science competencies and competencies for data-driven science. The most recent version of those competencies can be found on the HPC University website (HPC University, 2016). More recently, there have been a number of national studies and panels emphasizing the need for the infrastructure and workforce Introduction to Computational Modeling = 3 required to undertake large-scale modeling and simulation (Council on Competitiveness, 2004; Joseph et al., 2004; Reed, 2005; SBES, 2006). This book provides an introduction to computational science relevant to students across the spectrum of science and engineering. In this chapter, we begin with a brief review of the history or computational modeling and its contributions to the advancement of science. We then provide an overview of the modeling process and the terminology associated with modeling and simulation. As we progress through the book, we guide students through basic programming principles using two of the widely used simulation environments—MATLAB® and Python. Each chapter introduces either a new set of programming principles or applies them to the solution of one class of models. Each chapter is accompanied by exercises that help to build both basic modeling and programming skills that will provide a background for more advanced modeling courses. 1.2 HOW MODELING HAS CONTRIBUTED TO ADVANCES IN SCIENCE AND ENGINEERING ‘There are a myriad of examples documenting how modeling and simulation has contributed to research and to the design and manufacture of new prod- ucts. Here, we trace the history of computation and modeling to illustrate how the combination of advances in computing hardware, software, and scientific knowledge has led to the integration of computational modeling techniques throughout the sciences and engineering. We then provide a few, more recent examples of advances to further illustrate the state-of-the-art. One exercise at the end of the chapter provides an opportunity for students to examine additional examples and share them with their classmates. ‘The first electronic programmable computer was the ENIAC built for the army toward the end of World War II as a way to quickly calculate artillery trajectories. Herman Goldstine (1990), the project leader, and two professors from the University of Pennsylvania, J. Presper Eckert, and John Mauchly sold the idea to the army in 1942 (McCartney, 1999). As the machine was being built and tested, a large team of engineers and mathematicians was assembled to learn how to use it. That included six women mathematicians who were recruited from colleges across the country. As the machine was completed in 1945, the war was near an end. ENIAC was used extensively by the mathematician John von Neumann not only to undertake its original purposes for the army but also to create the first weather model in 1950. That machine was capable of 400 floating- point operations per second and needed 24 hours to calculate the simple

You might also like