Web-Books
in the Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Page - 269 -
  • User
  • Version
    • full version
    • text only version
  • Language
    • Deutsch - German
    • English

Page - 269 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Image of the Page - 269 -

Image of the Page - 269 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Text of the Page - 269 -

8.5 RateofConvergence 269 where Fn is a short notation for F(tn). Equation (8.81) is linear in the unknown un+1, so wecaneasily solve for thisquantity: un+1 = (2mun+(b 2 Δt−m)un−1 +Δt2(Fn−s(un)))(m+ b 2 Δt)−1 . (8.82) As in the case withoutdamping,we need to derivea special formula foru1. The initial condition u′(0) = 0 implies also now that u−1 = u1, and with (8.82) for n=0,weget u1 =u0+Δt 2 2m (F0−s(u0)). (8.83) In themoregeneralcasewith anonlineardampingtermf(u′), mu′′+f(u′)+s(u)=F(t), weget m un+1−2un+un−1 Δt2 +f(u n+1−un−1 2Δt )+s(un)=Fn, which is a nonlinearalgebraicequation forun+1 that must be solved bynumerical methods.Amuchmoreconvenientschemearises fromusingabackwarddifference foru′, u′(tn)≈ u n−un−1 Δt , because the dampingtermwill thenbeknown, involvingonlyun andun−1, andwe caneasily solve forun+1. The downside of the backward difference compared to the centered differ- ence (8.80) is that it reduces the order of the accuracy in the overall scheme from Δt2 toΔt. In fact, theEuler-Cromerschemeevaluatesanonlineardampingtermas f(vn)whencomputingvn+1,andthis isequivalenttousingthebackwarddifference above. Consequently, the convenience of the Euler-Cromer scheme for nonlinear damping comes at a cost of lowering the overall accuracy of the scheme from second to first order inΔt. Using the same trick in the finite difference scheme for the second-orderdifferential equation, i.e., using the backwarddifference inf(u′), makes this scheme equallyconvenientandaccurate as the Euler-Cromerscheme in thegeneralnonlinearcasemu′′+f(u′)+s(u)=F. 8.5 RateofConvergence In this chapter, we have seen how the numerical solutions improve as the time step Δt is reduced, just like we would expect. Thinking back on numerical computation of integrals (Chap. 6), we experienced the same when reducing the
back to the  book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Title
Programming for Computations – Python
Subtitle
A Gentle Introduction to Numerical Simulations with Python 3.6
Volume
Second Edition
Authors
Svein Linge
Hans Petter Langtangen
Publisher
Springer Open
Date
2020
Language
English
License
CC BY 4.0
ISBN
978-3-319-32428-9
Size
17.8 x 25.4 cm
Pages
356
Keywords
Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
Category
Informatik
Web-Books
Library
Privacy
Imprint
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python