DN40 ht för I Numeriska metoder 0-08-06 DN40 umi3
F Översikt F, 6 Ö, X Lab. - följer Lärare Davoud Saffar Shamshigar Ludwig Af Kliteberg Jesper Oppelstrup Eamiatio Matlab-lab, mutlig redovisig, projekt, skriftlig Teta som alla Numme GK (DN,4, ) kryssfrågedel för betyg E med räkeuppgifter 0-08-06 DN40 umi3
A( i)coveiet truth It is hard to uderstad a ocea because it is too big. It is hard to uderstad a molecule because it is too small. It is hard to uderstad uclear physics because it is too fast. It is hard to uderstad the greehouse effect because it is too slow. [Super]Computers break these barriers to uderstadig. They, i effect, shrik oceas, zoom i o molecules, slow dow physics, ad fast-forward climates. Clearly a scietist who ca see atural pheomea at the right size ad the right speed lears more tha oe who is faced with a blur. Al Gore, 990, Scietific Computig 0-08-06 DN40 umi3 3 3
Wikipedia: Scietific computig (or computatioal sciece) is cocered with costructig mathematical models ad umerical solutio techiques ad [ ] usig computers to aalyze ad solve scietific, social scietific, ad egieerig problems. Scietific Computig Numerical aalysis is the study of algorithms for the problems of cotiuous mathematics [ ] to compute quatities that are typically ucomputable, [ ] with lightig speed (L.N.Trefethe 99) The purpose of computig is isight, ot umbers. (R.W.Hammig) "The Ureasoable Effectiveess of Mathematics" (980) 0-08-06 DN40 umi3 4
Computer simulatio is the third paradigm of sciece Simulatio has become recogized as the third paradigm of sciece, the first two beig eperimetatio ad theory. High Performace Computig ad Commuicatios: Foudatio for America's Iformatio Future (Supplemet to the Presidet s FY 996 Budget) 0-08-06 DN40 umi3 5
Atea i rear-view mirror: Directivity, EMC, Dedritic solidificatio Mawell simulator (T.Rylader & al, CTU) Phase-field simulator (G.Amberg & al, KTH) There are three kids of lies: Lies, dam lies, ad colorful computer pictures (P.Colella) 0-08-06 DN40 umi3 6
Differetial Equatio Models Shortest path Micro-wave tomography Tsuami 0-08-06 DN40 umi3 7
Computatioal Materials Sciece From quatum mechaics to structures: Goals: σ ij i µ(u, j Predict macroscopic properties from first priciples Desig ew materials (e. ao-techology) Scale: space 0 8, time 0 5 QM: May-D A HΨEΨ DFT MD ij σ, j Fi Dislocatio field + u,i j ) λu,k k δ ij Navier cm 0-08-06 DN40 umi3 8
Success Story I: MATLAB Major tool for egieerig computig, Numerical aalysis, visualizatio 974 Matri Laboratory C.Moler Now: MathWorks > 000 pers. 0th aiversary 005: Success Story II: comsol Multiphysics FE software S.Littmarck 995: MATLAB PDEToolBo Now: Comsol > 50 pers. 0-08-06 DN40 umi3 9
Numerical Methods 0" 0. Why umerical methods? What ca be computed?. Approimatio, iteratio, liearizatio, algorithm 3. Ordiary differetial equatios: simulatio, eamples. Partial differetial equatios: simulatio, eempel 0-08-06 DN40 umi3 0
Most solutios are approimatios! Compute but how? ±. Calculator... but how does it do it?. Mathematics: ±.44 (+ ) / / k + k 8 + 6 3 5 8 3 +... k0 0-08-06 DN40 umi3
() / ( 5 6 + 7 6 )/ 5 4 (+ 7 5 )/ 5 4 + 7 5 8 7 5 + 6 7 5 3 5 8 7 5 3 +... ( + 0.400 0.0098 + 0.004...). 445.5 (Puh despite the covergece acceleratio) 0-08-06 DN40 umi3
0-08-06 3 Liearisatio ad iteratio: Newto's method ( ) ( ) + + + f f f f : ) (..., 0 : ) ( 0.5.47.446.4436 Mmm! DN40 umi3
Lijära ekvatiossystem Fi (,,, ) så att A b, A (a ij ) NAM:.4,.5,.6 (ite.6.),.7,.8 eller mistakvadrat-lösig mi A b NAM Olijär ekvatio Fi så att f() 0 NAM 6 Olijära ekvatiossystem Fi så att f() 0 NAM 6.8, 6.9 eller mistakvadrat-lösig mi f() NAM 6.0 0-08-06 DN40 umi3 4
Iitialvärdesproblem för ordiära differetialekvatioer Fi y(t) för t > 0 då dy/dt f(t,y), y(0) c NAM 8.-8.6 plus etra Radvärdesproblem för ordiära differetialekvatioer Fi y() för a < < b då dy/d f(,y), G(y(a),y(b)) 0 NAM 8.7 plus etra Partiella differetialekvatioer Iitial/radvärdesproblem: Fi T(,t) för 0 < < L, t > 0 då T (,0) 0 T T ρc k ; 0 < < t T (0, t) T, T ( L, t) T f ( ) L L; t > 0 0-08-06 DN40 umi3 5
Kvadratur Beräka b I f ( ) d a I f, y) ddy Beräka f ( ) då f ( i ) yi, i,,..., m ( Iterpolatio / Approimatio D - Tabeller NAM 5 Ite 5..4,5..5; - Polyom P k () Optimerig - Splie-fuktioer Fi ma. för f() i - Bézier-kurvor a < < b NAM 7 (ite 7..) plus etra 0-08-06 DN40 umi3 6
Lijära ekvatiossystem Fi (,,, ) så att A b, A (a ij ) NAM:.4,.5,.6 (ite.6.),.7,.8 Formulerig Gauss-elimiatio Pivoterig Arbetsvolym k i j Pivot - rad k :för i k +, k +,..., a ij a ij m ik a kj, j k +,..., m ik a a ik kk Atal mult.& add :, k ( k) 3 3 + O( ) 0-08-06 DN40 umi3 7
Eempel: Approimatio, iteratio, lijariserig, algoritm: Newto-Raphsos metod för lösig av f() 0. Approimatio med lijariserig: av y f() med tagete i ( 0,f( 0 )), som har ollställe i f ) / f ( ) 0 ( 0 0. Iteratio: Upprepa! (*): f ( ) / f ( ),,... 3. Algoritm: a) välj 0 och toleras ε b) Iterera med (*) tills ε c) är ärmevärde till ollstället y f() 0-08-06 DN40 umi3 8 y 0 y f(0)+(-0)f (0)
Eempel. Kvadratrote (Heros metod) 0-08-06 DN40 umi3 9 +... : ) (, ) ( f f. Divisio uta divisios-istruktio ( ) / : ) ( ) ( a a f a f Cray, 976 60 Mflops
Divisio uta divisio aalys. f ( ) / a; f / + a Vi vill se hur kovergerar mot /a och betraktar felet E /a : / a E + med l + ae l E / a får vi + l+ l + l a För tillämpige på divisio av biära flyttal är bara ½ < a < itressat, så vi tar a och l 0 -; a a(/ a l - : E e - ) : 0-08-06 DN40 umi3 HT 0