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

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

Bild der Seite - 308 -

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

Text der Seite - 308 -

308 9 SolvingPartialDifferentialEquations ∂u/∂x = 0. Reformulate the problem in Exercise 9.6 such that we compute only forx ∈ [0,1]. Display the solution and observe that it equals the right part of the solution inExercise9.6. Filename:symmetric_gaussian_diffusion.py. Remarks In 2D and 3D problems, where the CPU time to compute a solution of PDEcanbehoursanddays, it isvery important toutilizesymmetryaswedoabove to reduce thesize of theproblem. Also note the remarks in Exercise 9.6 about the constant area under theu(x,t) curve: here, the area is 0.5 and u → 0.5 as t → 0.5 (if the mesh is sufficiently fine—onewill get convergenceto smaller values for smallσ if the mesh is not fine enoughtoproperlyresolvea thin-shapedinitial condition). Exercise9.9:ComputeSolutionsas t→∞ Many diffusion problems reach a stationary time-independent solution as t →∞. The model problem from Sect.9.2.4 is one example whereu(x,t)= s(t)= const for t→∞.Whenudoesnotdependon time, thediffusionequationreduces to −βu′′(x)=f(x), inonedimension,and −β∇2u=f(x), in 2D and 3D. This is the famous Poisson equation, or iff = 0, it is known as the Laplaceequation. In this limit t→∞, there is noneed foran initial condition,but theboundaryconditionsare thesameas for thediffusionequation. We nowconsidera one-dimensionalproblem −u′′(x)=0, x∈ (0,L), u(0)=C, u′(L)=0, (9.38) which is known as a two-point boundary value problem. This is nothing but the stationary limit of the diffusion problem in Sect.9.2.4. How can we solve such a stationaryproblem(9.38)?Thesimplest strategy,whenwealreadyhaveasolver for the corresponding time-dependentproblem, is to use that solver and simulate until t → ∞, which in practice means that u(x,t) no longer changes in time (within some tolerance). A nice feature of implicit methods like the Backward Euler scheme is that one can takeonevery long time step to“infinity”andproducethesolutionof (9.38). a) Let (9.38)bevalidatmeshpointsxi inspace,discretizeu′′ byafinitedifference, and set up a system of equations for the point valuesui,i= 0,.. .,N, whereui is theapproximationat meshpointxi. b) Showthat ifΔt→∞ in (9.16)–(9.18), it leads to thesame equationsas in a). c) Demonstrate, by running a program, that you can take one large time step with the Backward Euler scheme and compute the solution of (9.38).The solution is veryboringsince it is constant:u(x)=C. Filename:rod_stationary.py.
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