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

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

Bild der Seite - 241 -

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

Text der Seite - 241 -

8.4 Oscillating1DSystems:ASecondOrderODE 241 wechoose the bodyto beat rest, butmovedawayfromits equilibriumposition: x(0)=X0, x′(0)=0 . The exact solution of (8.42) with these initial conditions isx(t)=X0cosωt. This caneasilybeverifiedbysubstituting into (8.42)andcheckingthe initial conditions. The solution tells us that such a spring-mass system oscillates back and forth as describedbya cosinecurve. The differential equation (8.42)appears in numerousother contexts. A classical example is a simple pendulumthat oscillates back and forth. Physics booksderive, fromNewton’s second lawofmotion, that mLθ′′+mgsinθ=0, wherem is the mass of the body at the end of a pendulum with lengthL,g is the acceleration of gravity, and θ is the angle the pendulum makes with the vertical. Consideringsmall angles θ, sinθ ≈ θ, and we get (8.42)withx = θ,ω=√g/L, x(0) = Θ, and x′(0) = 0, if Θ is the initial angle and the pendulum is at rest at t=0. 8.4.2 NumericalSolution We have not looked at numerical methods for handling second-order derivatives, and such methods are an option, but we know how to solve first-order differential equationsandevensystemsoffirst-orderequations.Witha little, yetverycommon, trick we can rewrite (8.42) as a first-order system of two differential equations. We introduce u = x and v = x′ = u′ as two new unknown functions. The two corresponding equations arise from the definition v = u′ and the original equation(8.42): u′ =v, (8.43) v′ =−ω2u. (8.44) (Notice that we can use u′′ = v′ to remove the second-order derivative from Newton’ssecond law.) We cannowapply theForwardEulermethodto (8.43)–(8.44),exactlyaswedid inSect. 8.3.2: un+1 −un Δt =vn, (8.45) vn+1 −vn Δt =−ω2un, (8.46)
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