kmu 206 numerical analysis with matlab® -...

25
KMU 206 Numerical Analysis with MATLAB® Hacettepe University Department of Chemical Engineering 2009-2010 Spring Semester Selis Önel, PhD

Upload: nguyenque

Post on 06-May-2018

291 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

KMU 206 Numerical Analysis with MATLAB®

Hacettepe University

Department of Chemical Engineering

2009-2010 Spring Semester

Selis Önel, PhD

Page 2: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

2Selis Önel, PhD

KMU206 Staff: Instructor

Selis Önel, PhD

Room: 14, 2nd floor

E-mail: [email protected]

[email protected]

Web: http://yunus.hacettepe.edu.tr/~selis

Office hours: Mon. 9:00-10:00

Page 3: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

3Selis Önel, PhD

KMU206 Staff: Assistant

Aslıhan Bayraktar

Room: Z01-Basement

E-mail: [email protected]

Office hours:

Mon. 11:00-12:00

Wed. 11:00-12:00

Page 4: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

4Selis Önel, PhD

Importance of Numerical Analysis

Numerical methods?

Techniques used for solving mathematical

problems that cannot be solved or are

difficult to solve analytically

Analytical solution →Exact answer

Numerical solution →Approximate value

Numerical solutions can be very accurate!

Calculations are iterated until desired

accuracy is achieved

Start

Read r

Read V

),(1 rVf

V

),(2 rVf

r

End

Page 5: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

5Selis Önel, PhD

Energy Optimization of the Yankee Hood Dryerin collaboration with

İpek Kağıt A.Ş., Yalova

and

Pulp and Paper Foundation of Turkey

Master’s Thesis Advisor: Dr. Güniz Gürüz, Professor

Department of Chemical Engineering

Middle East Technical University, Ankara, Turkey

My Research Background, MS

Macro Scale Thermodynamic Systems

Page 6: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

6Selis Önel, PhD

Mathematical Modeling of the Thermal Drying

System NaturalGas

Steam in

Fresh air

Dry paper out

Fresh airFresh air

Exhaust air

Wet

hoodDry

hood

System 1

Wet paper in

TransferAir

Recycle air

Blowingair

Blowingair

Steam+condensate out

Yankee Speed 1250-1650 m/min

Production 2.5-3.6 ton/h

Paper width 2.7 m

Paper basis weight 15-20 g/m2

Paper moisture content at

Yankee entrance 60 %

Yankee exit 4-7 %

Page 7: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

7Selis Önel, PhD

My Research Background, PhD

Comparison and Extension of Free Dendritic Growth

Models through Application to Ag-15%Cu Alloy

PhD Thesis Advisor: Dr. Teiichi Ando, Professor

Advanced Materials Processing Lab (AMPL)

Department of Mechanical and Industrial Engineering

Northeastern University, Boston, MA, USA

Nano Scale Thermodynamic Systems

Page 8: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

8Selis Önel, PhD

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-7.6

-7.5

-7.4

-7.3

-7.2

-7.1

-7

-6.9

-6.8x 10

4

Mole fraction of Cu

Gib

bs

Fre

e E

ner

gy,

G (

J/m

ol)

Molar Free Energy Curves for Ag-Cu at 1060 K

CLeqC

Seq

C0

G*

CS* C

L*

2L

1L

2'

1'

GL

G

G shifted by Gr

Start

Read r

),(1 rVf

),(2 rVf

End

rr TGT ,,*

*

)(

0

*

*

,

)(

)(

LL

rL

eqL

eqS

CdC

TTd

LC

C

rL

eq

S

rL

eq

L

mk

TTCC

TTCC

** ,, SL CkC ),,,,,,,,,( **** BABAGCCTG LLL

rLS rLS GCCT ,,, ***

),,,,,,(

),,,,,,(

),,,,,,(

BABACT

BABATC

BABATC

LLL

LL

LLL

S

LLL

L

Read V

r

V

100

101

102

10-9

10-8

10-7

10-6

10-5

10-4

T (K)

r (m

)

Total Supercooling vs. Tip Radius

LKT

TLK

Modified TLK

BCT

DA

New

Liquid

Vr

CL

*

kT *

T

C0

z

Solid

Paraboloid

of

Revolution

ΔT

C0

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1200

400

600

800

1000

1200

1400

1600

Composition (mol.fr. Cu)

Tem

pera

ture

(K

)

Metastable Phase Diagram for Ag-Cu System

1052.1 K

Eutectic point

(0.399,1052.1 K)

Critical point (0.61,1366.45 K)

0.9510.399

o Experimental data by Heycock et al.

Calculated phase boundaries

0 20 40 60 80 100 120 140 160 180 2000

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

T (K)

Fra

ctions o

f S

uperc

oolin

g (

K/K

)

Components of Total Supercooling (DA model)

Tr/T

Tt/T

Tc/T

Tk/T

Mathematical Modeling of

Crystal Growth

Page 9: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

9Selis Önel, PhD

Rapid Solidification Problems

Thermal

spray

Rapid

solidificationProperties

& Quality

Uniform droplet size

and microstructure

Nanostructures

Metastable phases

Advanced materials: automotive, aerospace, semiconductor, electronic

industries

Purpose Controlling the nano-structures of advanced materials that form during

rapid solidification

Improves mechanical,

chemical, thermal,

electrical, magnetic,

optical properties

Biomedicine: “Cryobiology”!

Purpose Reducing the amount of

poisonous cryoprotectants and formation of

ice crystals detrimental to cells during the

freezing/vitrification of cells for

cryopreservation Cooling rate

Cell

via

bil

ity Solution effects

Intracellular ice

formation

Droplet

vitrification

Bulk vitrification

%100 Viability

Page 10: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

10Selis Önel, PhD

Numerical Methods have a long history

Babylonians used (~3700 years ago )

Numerical solutions to quadratic equations

Approximations to square root of an integer

Linear interpolation to solve problems involving compound interest

Chinese Han Dynasty used (2000 years ago)

Matrix notation

What we call Gauss elimination to solve linear systems of equations

Successive approximations

Chinese Sung Dynasty used (1000 years ago) successive approximations to numerically solutions of higher degree equations

Indians used methods for obtaining square and cube roots

Greek mathematics used large number of regions of known area to estimate the desired area (letter from Archimedes to Eratosthenes)

Middle Eastern mathematicians such as Omar Khayyam and Jemshid Al-Kashi worked on algebra and solving cubic equations using iterative and trigonometric methods. The method we call Horner’s method was actually found by Jemshid Al-Kashi.

Page 11: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

11Selis Önel, PhD

History of Numerical Methods:

Omar Khayyam (1048-1112)

Seljuk mathematician, philosopher, astronomer, poet

Lived in Khorasan, the Seljuk capital

Wrote Rubaiyat of Omar Khayyam

Wrote “Treatise on Demonstration of Problems of

Algebra” giving a geometric method for solving cubic

equations by intersecting a hyperbola with a circle:

“Whoever thinks algebra is a trick in obtaining unknowns

has thought it in vain. No attention

should be paid to the fact that algebra and geometry

are different in appearance. Algebras

are geometric facts which are proved by propositions

five and six of Book two of Elements.”

—Omar Khayyam

Cubic equation and

intersection of conic

sections" the first page

of two-chaptered

manuscript kept in

Tehran University

Page 12: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

12Selis Önel, PhD

KMU206 Course Goals

Teach fundamentals of numerical methods

Enhance students’ programming skills using

the MATLAB environment to implement

algorithms

Teach the use of MATLAB as a tool (using

built-in functions) for solving problems in

science and engineering

Page 13: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

13Selis Önel, PhD

In my time there were …

Hardly any PC’s in the department

Long lines for the public PC’s in the dorms

Slower processors and smaller memories

No memory sticks

Really slow inkjet printers

So take advantage of the high technology

Page 14: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

14Selis Önel, PhD

My Expectations from You

Attend classes

Do homework !

(Group study is allowed as long as you submit

your own work)

Review your Math notes

Get familiar with MATLAB®

Turn homework in on time

Avoid plagiarism and copying!

Page 15: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

15Selis Önel, PhD

Plagiarism ??

transitive verb to steal and pass off (the ideas

or words of another) as one's own : use (another's

production) without crediting the source

intransitive verb to commit literary theft

: present as new and original an idea or product

derived from an existing source

Reference:http://www.merriam-webster.com/dictionary/plagiarizing

Page 16: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

16Selis Önel, PhD

Useful Textbooks

L. v. Fausett, Applied Numerical Analysis Using MATLAB® 2/E, Prentice Hall, ISBN: 0132397285

A. Constantinides and N. Mostoufi, Numerical Methods for Chemical Engineers with MATLAB Applications, Prenctice-Hall Inc., NJ, 1999, ISBN: 0130138517

S. Nakamura, Numerical Analysis and Graphic Visualization with MATLAB®, 2/e, Prentice Hall, 2002, ISBN:01306548921

A. Gilat and V. Subramaniam, Numerical Methods for Engineers and Scientists, John Wiley & Sons, Inc., 2008, ISBN: 9780471734406

C. Moler, Numerical Computing with MATLAB®, Electronic edition: The MathWorks, Inc., Natick, MA, 2004, http://www.mathworks.com/moler. Print edition: SIAM, Philadelphia, 2004.http://ec-securehost.com/SIAM/ot87.html

J. H. Mathews and K. D. Fink, Numerical Methods Using MATLAB®, 3rd ed, Upper Saddle River, NJ: Prentice Hall, 2004, ISBN: 0130652482

J. Kiusalaas, Numerical Methods in Engineering with MATLAB® , Cambridge University Press, 2005, ISBN: 0521852889

Page 17: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

17Selis Önel, PhD

Grade Percentages

Quizes 15%

Homeworks 10%

Midterm I 30%

Final (Class exam+Take Home) (25%+25%) 50%

Total 105%

Page 18: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

18Selis Önel, PhD

Homeworks

1. Problems to be solved by hand

Improve understanding of numerical methods

Carry out few steps of numerical methods by hand

2. Problems to be programmed in MATLAB®

Improve programming skills

Learn MATLAB® toolboxes

3. Problems in math, science and engineering and

mathematical modeling

Identify engineering problems that need to be solved by

using numerical methods

Page 19: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

19Selis Önel, PhD

Midterms

Midterm I : Between March 16/18

Midterm II: Between April 20/22

Finals week: May 24-31

Midterm questions may be reviewed in an

additional tutorial hour if requested

Page 20: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

20Selis Önel, PhD

What are your expectations?

Please write in a paragraph or list

1. Programming languages you are familiar with

2. Your familiarity with MATLAB®

3. Your expectations from this course, the instructor and the assistant

4. How you think this course will help you in your education and career

Page 21: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

21Selis Önel, PhD

MATLAB Feautures

ComputationLanguage

Graphics

Programming

GUI Toolboxes

MATLAB

Reproduced from: S. Lyshevski, Engineering and Scientific Computations Using Matlab, 2003, p.2

Page 22: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

22Selis Önel, PhD

MATLAB is …

A high level computer language

For scientific computing and data visualization

Built around an interactive programming environment

Where MATLAB programs

Can be tested and debugged quickly

Do not need to be compiled, linked and executed after

each correction

Can be developed much faster than FORTRAN or C

programs

BUT

You need to have MATLAB installed on your computer

Page 23: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

23Selis Önel, PhD

MATLAB® …

is the short for "matrix laboratory“

was designed by Cleve Moler in late 1970s to give his students access to LINPACK and EISPACK without having to learn Fortran

(C. Moler: chairman of the computer science dept. at the Univ. of New Mexico at that time, now chairman at The Mathworks)

was enjoyed by the applied mathematics community

was rewritten by Cleve Moler, Steve Bangert, and Jack Little in C and set the foundation for The MathWorks in 1984

(rewritten libraries were known as JACKPAC)

Page 24: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

24Selis Önel, PhD

MATLAB® …

was first adopted by control design engineers, Little's

specialty, but quickly spread to different fields

is also used in education (linear algebra and numerical

analysis) and is popular amongst scientists involved with

image processing

offers toolboxes for solving mathematical problems in many

popular fields

Page 25: KMU 206 Numerical Analysis with MATLAB® - Hacettepeyunus.hacettepe.edu.tr/~selis/teaching/WEBkmu206/ppt/KMU206Num... · KMU 206 Numerical Analysis with MATLAB ... Numerical Methods

25Selis Önel, PhD

Links for

Information on MATLAB

http://www.mathworks.com/products/matlab/

http://www.cyclismo.org/tutorial/matlab/

http://kgptech.blogspot.com/2005/07/matlab.h

tml

http://www.mathworks.com/matlabcentral/