Web-Books
im Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Seite - 301 -
  • Benutzer
  • Version
    • Vollversion
    • Textversion
  • Sprache
    • Deutsch
    • English - Englisch

Seite - 301 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition

Bild der Seite - 301 -

Bild der Seite - 301 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition

Text der Seite - 301 -

9.2 FiniteDifferenceMethods 301 This equation is to be solved for un+1. If f is linear in u, it is a linear equation, but iff is nonlinear inu, one needs approximate methods for nonlinear equations (Chap.7). Inourcase, we haveasystem of linear ODEs(9.9)–(9.11).TheBackwardEuler schemeapplied to eachequation leads to un+10 −un0 Δt = s′(tn+1), (9.16) un+1i −uni Δt = β Δx2 (un+1i+1 −2un+1i +un+1i−1)+gi(tn+1), (9.17) i=1,.. .,N−1, un+1N −unN Δt = 2β Δx2 (un+1N−1 −un+1N )+gi(tn+1). (9.18) This is a system of linear equations in the unknownsun+1i , i= 0,.. .,N, which is easy to realize by writing out the equations for the caseN = 3, collecting all the unknowntermsontheleft-handsideandall theknowntermsontheright-handside: un+10 =un0 +Δts′(tn+1), (9.19) un+11 −Δt β Δx2 (un+12 −2un+11 +un+10 )=un1 +Δtg1(tn+1), (9.20) un+12 −Δt 2β Δx2 (un+11 −un+12 )=un2 +Δtg2(tn+1). (9.21) Asystemof linearequations like this, isusuallywrittenonmatrix formAu=b, whereA is a coefficient matrix,u= (un+10 ,.. .,nn+1N ) is the vector of unknowns, andb is a vectorof knownvalues. Thecoefficientmatrix for the case (9.19)–(9.21) becomes A= ⎛ ⎜ ⎝ 1 0 0 −Δt β Δx2 1+2Δt β Δx2 −Δt β Δx2 0 −Δt 2β Δx2 1+Δt 2β Δx2 ⎞ ⎟ ⎠ In the general case (9.16)–(9.18), the coefficient matrix is an (N+1)× (N +1) matrixwithzeroentries, except for A1,1 =1 (9.22) Ai,i−1 =−Δt β Δx2 , i=2,.. .,N−1 (9.23) Ai,i+1 =−Δt β Δx2 , i=2,.. .,N−1 (9.24) Ai,i =1+2Δt β Δx2 , i=2,.. .,N−1 (9.25)
zurück zum  Buch Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Titel
Programming for Computations – Python
Untertitel
A Gentle Introduction to Numerical Simulations with Python 3.6
Band
Second Edition
Autoren
Svein Linge
Hans Petter Langtangen
Verlag
Springer Open
Datum
2020
Sprache
englisch
Lizenz
CC BY 4.0
ISBN
978-3-319-32428-9
Abmessungen
17.8 x 25.4 cm
Seiten
356
Schlagwörter
Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
Kategorie
Informatik
Web-Books
Bibliothek
Datenschutz
Impressum
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python