1 / 16

ChE 250 Numeric Methods

ChE 250 Numeric Methods. Lecture #1, Chapra Chapters 1 &2 20070119. Outline. Chapter 1 “Mathematical Modeling and Engineering Problem Solving” Parachutist and Newton’s 2 nd Law Chapter 2 “Programming and Software” Structured, Modular Matlab & Excel.

newton
Download Presentation

ChE 250 Numeric Methods

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ChE 250 Numeric Methods Lecture #1, Chapra Chapters 1 &2 20070119

  2. Outline • Chapter 1 “Mathematical Modeling and Engineering Problem Solving” • Parachutist and Newton’s 2nd Law • Chapter 2 “Programming and Software” • Structured, Modular • Matlab & Excel

  3. “Mathematical Modeling and Engineering Problem Solving” • What is a math model? • Describes a natural process in mathematical terms • Idealizes and simplifies reality • Yields reproducible results which can be used to make predictions • Example is Newton’s 2nd Law

  4. “Mathematical Modeling and Engineering Problem Solving” • What is a math model? • Parachutist and Newton’s 2nd Law • Describes motion in terms of the forces acting on a body and the parameter mass • Idealizes and Simplifies by only considering the dominate forces and assuming that mass is constant • Makes predictions of motion for a specific set of forces. • F=ma • F=ma=mg=m(9.8m/s2)

  5. “Mathematical Modeling and Engineering Problem Solving” • What is a math model? • Parachutist and Newton’s 2nd Law • Refining the parachutist problem • Now we consider both the downward pull of the gravity and the resistive drag force. • F=ma • F=Fd+Fu Fd=mg • Fu=cv where c is the drag coefficient and v is velocity • -cv+mg=ma

  6. “Mathematical Modeling and Engineering Problem Solving” • What is a math model? • Parachutist and Newton’s 2nd Law • Refining the parachutist problem • Analytical solution • Solve the differential equation • Boundary condition v=0 @t=0 • Downward coordinates • v=gm/c(1-exp(-tc/m))

  7. “Mathematical Modeling and Engineering Problem Solving” • What is a math model? • Parachutist and Newton’s 2nd Law • Refining the parachutist problem • Analytical solution • Finite difference (Euler’s method) • Assume that dv/dt=Δv/Δt • In terms of increments ‘steps’

  8. “Mathematical Modeling and Engineering Problem Solving” • What is a math model? • Parachutist and Newton’s 2nd Law • Refining the parachutist problem • Analytical solution • Finite difference • Excel solutions • Easily obtained for this problem • Terminal Velocity • Analytical 53.39 • Extra credit: find the numeric limit and number of steps • E-mail spreadsheet by Friday, midnight.

  9. “Mathematical Modeling and Engineering Problem Solving”

  10. “Programming and Software” • Structured Programming • Good style habits for programming • Makes the code easy to understand to someone other than the developer • (i.e. a teacher who is grading your work) • Control structures • Sequence • Selection • Repetition

  11. “Programming and Software” • Structured Programming • Logical Structures • Sequence • Usually obvious in programming that the code is executed starting at the top and working down • Selection • If/Then/ElseIf/Else/EndIf • SelectCase/EndSelect • Repetition • For/Next

  12. “Programming and Software” • Structured Programming • Logical Structures • Modular Programming • Divide the program into independent modules that can be tested separately • Each module should have a separate well-defined purpose • e.g. Function or subroutines • Functions return a single result (could be matrix or array) • Subroutines return a number of outputs • Modules allow you to develop a ‘library’ of tools that can be used on future projects

  13. “Programming and Software” • Structured Programming • Logical Structures • Modular Programming • Excel and VBA • Excel is great for numeric solutions both in the spreadsheeting and in the programming modules using Visual Basic for Applications (VBA) • Cell formula • =$B$8*(1-EXP($B$9*E8)) • =I10+(H11-H10)*($B$3-$B$2/$B$1*I10)

  14. “Programming and Software” • Structured Programming • Logical Structures • Modular Programming • Excel and VBA • Excel is great for numeric solutions both in the spreadsheeting and in the programming modules using Visual Basic for Applications (VBA) • Cell formula • =$B$8*(1-EXP($B$9*E8)) • =I10+(H11-H10)*($B$3-$B$2/$B$1*I10)

  15. “Programming and Software” • Structured Programming • Logical Structures • Modular Programming • Excel and VBA • Matlab • Also Scilab is available for free download • Very similar to Matlab environment, but there are some differences in function calls=

  16. Preparation for Jan 22nd • Reading • Chapra Chapter 3: Approximations and Round-Off Errors • Homework problem set #1 • 1.2, 1.4, 1.6, 1.11 • 2.1, 2.8 • 3.2, 3.4, 3.7

More Related