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 - XIX -
  • User
  • Version
    • full version
    • text only version
  • Language
    • Deutsch - German
    • English

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

Image of the Page - XIX -

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

Text of the Page - XIX -

Contents xix 8.3.8 IncorporatingVaccination. . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 8.3.9 DiscontinuousCoefficients:A VaccinationCampaign . . . . 237 8.4 Oscillating1D Systems:A SecondOrderODE . . . . . . . . . . . . . . . . . 239 8.4.1 DerivationofaSimpleModel . . . . . . . . . . . . . . . . . . . . . . . . 240 8.4.2 NumericalSolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 8.4.3 ProgrammingtheFE Scheme; theSpecialCase. . . . . . . . . . 242 8.4.4 A MagicFix of theNumericalMethod . . . . . . . . . . . . . . . . . 243 8.4.5 The Second-Order Runge-Kutta Method (or Heun’s Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 8.4.6 Software forSolvingODEs . . . . . . . . . . . . . . . . . . . . . . . . . . 249 8.4.7 TheFourth-OrderRunge-KuttaMethod . . . . . . . . . . . . . . . . 254 8.4.8 MoreEffects:Damping,Nonlinearity,andExternal Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 8.4.9 IllustrationofLinearDamping. . . . . . . . . . . . . . . . . . . . . . . . 260 8.4.10 IllustrationofLinearDampingwith Sinusoidal Excitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 8.4.11 Spring-MassSystemwith SlidingFriction . . . . . . . . . . . . . . 264 8.4.12 A FiniteDifferenceMethod;Undamped,LinearCase . . . . 266 8.4.13 A FiniteDifferenceMethod;LinearDamping . . . . . . . . . . . 268 8.5 Rate ofConvergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 8.5.1 AsymptoticBehaviorof theError . . . . . . . . . . . . . . . . . . . . . 270 8.5.2 Computing the ConvergenceRate . . . . . . . . . . . . . . . . . . . . . 270 8.5.3 Test Function:ConvergenceRates for the FESolver. . . . . . 272 8.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 9 SolvingPartialDifferentialEquations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 9.1 Example:TemperatureDevelopment in aRod . . . . . . . . . . . . . . . . . . 288 9.1.1 A ParticularCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 9.2 Finite DifferenceMethods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 9.2.1 Reductionofa PDEtoa SystemofODEs . . . . . . . . . . . . . . 290 9.2.2 Construction of a Test Problem with Known Discrete Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 9.2.3 Implementation:ForwardEulerMethod . . . . . . . . . . . . . . . . 293 9.2.4 Animation:HeatConduction ina Rod . . . . . . . . . . . . . . . . . 295 9.2.5 Vectorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 9.2.6 UsingOdespy toSolve theSystemofODEs . . . . . . . . . . . . 299 9.2.7 ImplicitMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 9.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 A InstallationandUse ofPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 A.1 Recommendation: InstallAnacondaandOdespy . . . . . . . . . . . . . . . . 311 A.2 RequiredSoftware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 A.3 AnacondaandSpyder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 A.3.1 SpyderonMac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 A.3.2 InstallationofAdditionalPackages . . . . . . . . . . . . . . . . . . . . 313 A.4 Howto Write andRuna PythonProgram . . . . . . . . . . . . . . . . . . . . . . 314 A.4.1 Spyder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 A.4.2 TextEditors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
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