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 - 259 -
  • Benutzer
  • Version
    • Vollversion
    • Textversion
  • Sprache
    • Deutsch
    • English - Englisch

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

Bild der Seite - 259 -

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

Text der Seite - 259 -

8.4 Oscillating1DSystems:ASecondOrderODE 259 Note that with the choices f(u′) = 0, s(u) = ku, andF(t) = 0 we recover the originalODEu′′+ω2u=0 withω=√k/m. How can we solve (8.66)? As for the simple ODE u′′ +ω2u = 0, we start by rewriting thesecond-orderODEasa systemof two first-orderODEs: v′ = 1 m (F(t)−s(u)−f(v)), (8.68) u′ =v. (8.69) The initial conditionsbecomeu(0)=U0 andv(0)=V0. Any method for a system of first-order ODEs can be used to solve foru(t) and v(t). The Euler-Cromer Scheme An attractive choice from an implementational, ac- curacy, and efficiency point of view is the Euler-Cromer scheme where we take a forwarddifference in (8.68)andabackwarddifference in (8.69): vn+1 −vn Δt = 1 m ( F(tn)−s(un)−f(vn) ) , (8.70) un+1 −un Δt =vn+1, (8.71) We caneasily solve for thenewunknownsvn+1 andun+1: vn+1 =vn+Δt m ( F(tn)−s(un)−f(vn) ) , (8.72) un+1 =un+Δtvn+1 . (8.73) Remarkonthe orderingof the ODEs The ordering of the ODEs in the ODE system is important for the extended model (8.68)–(8.69). Imagine that we write the equation foru′ first and then the one for v′. The Euler-Cromer method would then first use a forward differenceforun+1 andthenabackwarddifferenceforvn+1.Thelatterwould lead toa nonlinearalgebraicequationforvn+1, vn+1 +Δt m f(vn+1)=vn+Δt m ( F(tn+1)−s(un+1) ) , iff(v) is a nonlinear function of v. This would require a numerical method fornonlinearalgebraicequations tofindvn+1,whileupdatingvn+1 througha forwarddifferencegivesanequationforvn+1 that is linearandtrivial tosolve byhand.
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