CSE 3802 / ECE 3431 Numerical Mehods in Scienific Compuaion Jinbo Bi Deparmen of Compuer Science & Engineering hp://www.engr.uconn.edu/~jinbo 1
Ph.D in Mahemaics The Insrucor Previous professional experience: Siemens Medical Soluions Inc. Deparmen of Defense, Bioanalysis Massachuses General Hospial Research ineress: biomedical informaics, machine learning, daa mining, opimizaion, mahemaical programming, Apply machine learning echniques in medical image analysis, paien healh records analysis Resume is a hp://www.engr.uconn.edu/~jinbo 2
Class Meeings Lecures are Tuesday and Thursday, 9:30 10:45 am No specific lab ime, bu significan compuer ime expeced. Compuers are available in ITEB C25 and C27. 3
Class Assignmens Homework will be assigned once every week or wo and due usually he following week. You may collaborae on he homework, bu your submissions should be your own work. Grading: Homework 30% Exam 1 and 2 40% Final Exam 30% 4
Mahemaical Background MATH 2110Q Mulivariae Calculus Taylor series MATH 2410Q Inroducion o Differenial Equaions Inegraion Linear Algebra 5
Compuer Background Languages o be used: Malab, C, C++ CSE 1100/1010 programming experience Any OS is accepable 6
Syllabus Go over he course syllabus Course websie hp://www.engr.uconn.edu/~jinbo/fall2011_ Numerical_Mehods.hm 7
Today s Class: Inroducion o numerical mehods Basic conen of course and class expecaions Mahemaical modeling 8
Inroducion Wha are numerical mehods? echniques by which mahemaical problems are formulaed so ha hey can be solved wih arihmeic operaions. (Chopra and Canale) Wha ype of mahemaical problems? Roos, Inegraion, Opimizaion, Curve Fiing, Differenial Equaions, and Linear Sysems 9
Inroducion How do you solve hese difficul mahemaical problems? Example: Wha are he roos of x 2-7x+12? Three general non-compuer mehods Analyical Graphical Manual 10
Analyical Soluions This is wha you learned in mah class Gives exac soluions Example: x 7x + 12 Roos a 3 and 4 2 = ( x 3)( x 4) No always possible for all problems and usually resriced o simple problems wih few variables or axes The real world is more complex han he simple problems in mah class 11
Graphical Soluion 12
Manual Soluion Using pen and paper, slide rules, ec. o solve an engineering problem Very ime consuming Error-prone 13
Numerical Mehods Wha are numerical mehods? echniques by which mahemaical problems are formulaed so ha hey can be solved wih arihmeic operaions. (Chopra and Canale) Arihmeic operaions map ino compuer arihmeic insrucions Numerical mehods allow us o formulae mahemaical problems so hey can be solved numerically (e.g., by compuer) 14
Course Overview Wha is his course abou? Using numerical mehods o solve mahemaical problems ha arise in engineering Mos of he focus will be on engineering problems 15
Basic Maerials Inroducion Programming Mahemaical Modeling Error Analysis Mahemaical Problems Roos, Inegraion, Opimizaion, Curve Fiing, Differenial Equaions, and Linear Sysems 16
Mahemaical Modeling A mahemaical model is he formulaion of a physical or engineering sysem in mahemaical erms. Empirical Theoreical 17
Mahemaical Modeling Dependen variable = f ( independen variables, parameers, forcing funcions ) In an elecrical circui, I = V/R; The curren, I, is dependen on resisance parameer, R, and forcing volage funcion, V. 18
Example 1 Wha is he velociy of a falling objec? Firs sep is o model he sysem Newon s second law F dv F = ma a = = m d Toal force is graviy and air resisance F m F = F Graviy + F Air = mg cv 19
Example 1 dv d = F m = mg cv m = g c m v Firs order differenial equaion Analyical soluion v( ) = gm c (1 e mc ) 20
Example 1 m=68.1kg, c=12.5 kg/s 21
Example 1 Wha if we can find an analyical soluion? How do you ge a compuer o solve he differenial equaion? Use numerical mehods 22
Euler s Mehod Use he finie divided difference approximaion of he derivaive dv d = v( i+ 1 ) ( i) i+ 1 v i The approximaion becomes exac as Δ 0 23
Using Euler s mehod, we can approximae he velociy curve Euler s Mehod ) ( ) ( ) ( 1 1 i i i i i v m c g v v d dv = = + + + = + + ) ( ) ( ) ( ) ( 1 1 i i i i i v m c g v v 24
Euler s Mehod Assume Δ=2 v( 0) = 0 c v( 2) = v(0) + 2 g v(0) = 19.6 m c v( 4) = v(2) + 2 g v(2) = 32.0 m 25
Euler s mehod 26
Euler s Mehod Avoids solving differenial equaion No an exac approximaion of he funcion Ges more exac as Δ 0 How do we choose Δ? Dependen on he olerance of error. How do we esimae he error? 27
Example 2 Find i() swich resisor Vol supply capacior 28
Example 2 V i( ) dv d = Ri( ) + v ( ) dvc = C d 1 = ( V RC Analyical soluion c c v v c( ) V 1 e i( ) c = RC dvc = C d 29 = ( )) V R e RC
Example 2 Numerical soluion V = Ri( ) + v ( ) di 0 = R + d di 0 = R + d c dvc d i( ) C di d = 1 RC i( ) 30
Example 2 di d 1 = i( j ) RC = i( i( ) i( ) ( 1 j+ 1 = j j+ j+ 1 ) ( j ) j+ 1 j i j i( j ) ) RC Iniial value of i()=v/r i (0) = V R i(0) V 2 i(2) = i(0) 2 = 1 RC R RC.. 31
Nex class Programming and Sofware Read Chapers 1 & 2 32