You are on page 1of 38

Department

of Mechanical Engineering Monash University

MEC3456 Engineering Computational Analysis

Lecture 01 Introduction

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

My details Dr. Zhe Liu Room 219, Building 82 (New Horizons) Phone 990 53627 EMAIL: zhe.liu@monash.edu Available consultation hours: Monday: 2pm-5pm

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

What is Engineering computing?


In general, engineers are required to relate physical phenomena to mathematical models. An example is to design the racing car to obtain the optimal aerodynamic performance.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

What is Engineering computing?


A mathematical model is broadly defined as a formulation or equation that expresses the essential feature of a physical system.
Dependent variables independent forcing = f , parameters, function variables

Unit overview
Lecture Textbook Assessment

Often it is difficult to get an analytical solution. A computer model is thus required to solve the mathematical models, often, repetitively. Solving simultaneous equations Solving ordinary or partial differential equations integration

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Why do this project? Why would an engineer use a computer to solve problems?
Problem may be difficult to test in practice High precision required Economic concerns Fast results required Many models to test Computer Scien:sts learn how to program:

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

They have not learnt about: Thermodynamics Solid Mechanics Fluid Mechanics Kinema:cs

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Why do this subject? Computer can model where experiments cant venture (e.g., crack propagation and dislocation motion)

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Abraham F. F. et.al. PNAS;2002;99:5783-5787

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Why do this subject? Computer model can predict (e.g., weather forecast)

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Why do this subject? Today, 97 of the top 100 industrial companies invest in engineering simulation as a key strategy to win in a globally competitive environment.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

How?

Hardware
http://www.top500.org/

The world fastest computer: Sequoia


Manufacturer --- IBM

Location --- Lawrence Livermore National Laboratory, California, US Funded by --- National Nuclear Security Administration as part
of the Advanced Simulation and Computing Program (ASC)

Unit overview
Lecture Textbook Assessment

Processors and speed --- A total of 1,572,864 cores; 16.32 petaflop/s Power consumption --- 7.890 MW.

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

How?

Hardware
31th on the top 500 list

Fastest computer in Australia: AVOCA


Victorian Life Sciences Computation Initiative Processors and speed:
65,536 cores; 65 TB of RAM; 690,197 GFlop/s

Unit overview
Lecture Textbook Assessment

Power consumption: 328.75 kW Application:


Life science and medical science research

Computa:onal errors
Round o error Trunca:on error

In 2013, ANU will have a new supercomputer manufactured by Japanese ICT and Fujitsu performing at 1.2TFlop/s.

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

How?

Software/Programming

Computer program are merely a set of instructions that direct the computer to perform certain tasks.
Simple information representation Advanced information representation Input/output Mathematical formulas Logic representation Modular programming

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

How?

Software/Programming

To program, we will use a computer package called MATLAB


MATLAB is specically designed for scien:c and engineering research It is very accurate at modeling It is very easy to visualize your data

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview In this unit, you will learn how to use computer to do the followings
Finding roots of functions/interpolation Numerical Integrate and Numerical Differentiation Solving O.D.E.s Initial-value problems Boundary-value problems Solving P.D.E.s 1D. Problem 2D. Problem Fourier analysis

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

We will focus on
Techniques to solve problems Accuracy of the technique Stability of the technique Efficiency of the technique

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview

At the end of this unit, you will be able to


Problem solving Programming A critical approach to a complex problems

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview: Ideas and Attitudes Ideas


Computational solutions: Having errors May never get an answer May take a long time to obtain May be complex

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Attitudes
Confidence in writing/using/developing codes Be critical of numerical results they may be wrong

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview Lectures


Interpolation and root finding (3 lectures) Open and close methods Newton & Lagrange interpolation Cubic spline Higher dimensional interpolation

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Numerical integration
Newton-Cotes technique Richardson/Romberg technique Gauss quadrature

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview Lectures


Solution of ODE (8 lectures) Runge-Kutta method Multi-step method Implicit method Initial and boundary value problems Eigenvalue problem

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Solution of PDE (11 lectures)


Finite difference method Finite element method

Fourier analysis (2 lectures)

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview Textbooks


One prescribed textbook Several other textbooks will also be used in this course

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Numerical Methods for Engineers, Chapra & Canale, 6th edi:on McGraw-Hill. Large number of engineering- related methods detailed. Virtually no programming, but substan:al theory.

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview
Recommended texts and readings
Applied Numerical Methods with Matlab for Engineers and Scien:sts, Steven C. Chapra, McGraw Hill, 2005. This text is good because it marries both MATLAB programming and the applica:on of Numerical Methods. Numerical Methods in Engineering with Matlab, Kiusalaas, Cambridge University, 2005. This text is also good because it marries both MATLAB programming and the applica:on of Numerical Methods.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview
Recommended texts and readings
Numerical Methods, J. Faires and R. Burden 3rd Ed. Thomson Brooks/Cole, 2003 An excellent textbook. Goes into a lot of detail, some programming - uses the "Maple" programming language.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Numerical Recipes in C, Flannery, Ve_erling, Press & Teukolsky. (also available in Pascal, C++ and Fortran.) Explana:ons & code for a wide range of numerical algorithms. Advanced techniques.

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview

How do I deliver this subject


Lectures (in class, three hours per week, recorded videos uploaded online after lectures) Tutorial questions related to computer lab practices Computer labs (2 hours per week) --- instruction videos posted online before computer labs.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview Assessment and feedback


Final exam paper and in class quiz (70%)
Four in-class quiz (2%) will cover the main topics: root-finding and interpolation, numerical integration, ODE, and PDE.

Unit overview
Lecture Textbook Assessment

Computer lab attendance and reports (30%)


Attendance accounts 2%, and lab reports contribute 28% Laboratories will start in the 2nd week of semester The first laboratory is a MATLAB tutorial, and will not be assessed. Every two weeks, you submit lab reports in pair by Friday 5pm (week 3, 5, 7, 10, and 12), e.g., lab report 1 and 2 submitted on week 3, lab report 3 and 4 submitted on week 5, and so on.

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview Online lecture notes and other readings


Lecture notes will be online (Moodle) one week before the courses Also, several articles and links to topics of interest arranged by lecture topic.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview
Tutorial Questions and Solutions
Several practical questions of math derivation and hand calculations for each topic.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview
Computer laboratories
Students must attend computer laboratory session assigned via Allocate+ system. Please contact me ASAP to report any clashes. Lab questions will be available on Moodle. An instruction video will be provided before the lab session. You are suggested to read the laboratory handout and watch the instruction video prior to arriving at the laboratory class.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview
Computer laboratory contents

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Unit Overview Feedbacks


Lecture contents
You are welcome to ask questions during/after the lectures. Every week, office hours on Monday from 2pm to 5pm (Room 219, New Horizons Building) Moodle online forum.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Computer labs: programming and lab reports


You are welcome to ask me and our demonstrators during the lab sessions. Comments will be provided in you marked lab reports. Any disagreements related to report marks will be discussed during the lab session.

Department of Mechanical Engineering Monash University

Lecture 01 computational error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Computational Error Although the numerical technique yields estimate that close to the exact analytical solution, there was a discrepancy or error. There are two types of computational errors in our numerical models.
Round-off error (induced by hardware) Truncation error (induced by algorithm)

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Round-off Error How do computer store numbers?


Computer handles two types of numerical data
Integer (fixed point numbers) E.g., 0, -21, 973, Real number (floating point numbers) E.g., 0.921, 0.249110-1

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

IEEE binary floating point arithmetic standard 754-1985


The manner of a real number expressed and stored in computer memory (b=2 for binary number system)

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Round-off Error How computer store numbers?


Typically, real number is stored 32 bit (single precision) in a computer. This is only enough to maintain 7-8 significant figures within between 10-40 to 1040 The typical relative error is called machine accuracy (m) The machine accuracy of a 32bit computer is about:

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error


m ~ 310-8

Round-off error is accumulative. Every time a floating point arithmetic operation is performed an error will be introduced of size m.

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Round-off Error How round-off error develop?


These errors mostly add up randomly. After N operations the error is typically approximately Total error = N 1/2 m However, it is possible that these errors could all be of the same sign and then the error estimate is: Total error = N m

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Round-off Error How round-off error develop?


Some arithmetic operations will result in significant loss of accuracy. For example, the adding a small number 0.0010 to a large number 4000

Unit overview
Lecture Textbook Assessment

0.4000

i10 4

Computa:onal errors
Round o error Trunca:on error

0.0000001 i10 4 0.4000001 i10 4

For a hypothe:cal computer with 4-digit man:ssa, the nal result is 0.4000104

The subtraction two nearly equal floating point numbers

b b 2 4 ac x= 2a

This will produce big errors if b2 >> 4ac

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Truncation Error
Truncation errors are those that results from using an approximation in place of an exact mathematical formula. Truncation error is due to the algorithm used. Think truncation in terms of the removal of higher-order terms in a Taylors series expansion.

Unit overview
Lecture Textbook Assessment

f ( xi +1 ) = f ( xi ) + f '( xi )( xi +1 xi ) + f ''( xi )( xi +1 xi )2 + ...


In this course, we will keep using a discrete method to approximate a continuous problem (e.g., numerical differentiation)
In the limit of using more and more terms, or points, or intervals, the approximation should become increasingly accurate.

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Stability of the Solution Technique Another important issue is STABILITY.


This is associated with the interaction between the roundoff error and the numerical algorithm. Any error that exists at some stage of the solution process is magnified (usually exponentially) so that after a certain stage the error swamps the solution and the approximation is meaningless. We will later look at ways to determine the stability properties of a given method.

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Examples A round-off error


Consider the simple program snippet in MATLAB: pi = 3.141592653589793238462643; MATLAB will only store the underlined digits fprintf('%30.25f\n',pi)

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

with output: 3.1415926535897931000000000

More digits than are stored in pi

The digits underlined are incorrect.

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Examples A truncation error


Consider the Taylor series expansion of ln(1+x)
(1)i +1 i y( x ) = ln(1 + x ) = x i i 1 1 1 1 1 = x x 2 + x 3 x 4 + x 5 x 6 + ... 2 3 4 5 6

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

( x) y
(0.5) = 0.5 y y(0.5) = ln(1 + 0.5) = 0.405465108
The TRUNCATION error is true - approxima:on = 0.405465108 0.5 = -0.094534892 (23%)

Outline What is engineering compu:ng? Why do this object? How?


Hardware SoBware/ programming

Summary In this lecture, we have learned


What is engineering computational analysis? computer models to solve mathematical equations numerically. Why do we need this object? It can provide information that cant be provided by experiments and theory. How to do it? the topic of this unit! Numerical errors
Round-off error (induced by hardware) Truncation error (induced by algorithm)

Unit overview
Lecture Textbook Assessment

Computa:onal errors
Round o error Trunca:on error

In the next lecture, I will give you a brief introduction of MATLAB.

You might also like