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

Page - 162 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Image of the Page - 162 -

Image of the Page - 162 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Text of the Page - 162 -

162 5 SolvingPartialDifferentialEquations Weshouldalsomentionthat thediffusionequationmayappearafter simplifying morecomplicatedpartialdifferentialequations. Forexample,flowofaviscousfluid between two flat and parallel plates is described by a one-dimensional diffusion equation,whereu then is thefluidvelocity. A partial differential equation is solved in some domain ˝ in space and for a time interval Ε’0;T . The solution of the equation is not unique unless we also prescribe initialandboundaryconditions. The typeandnumberof suchconditions dependonthe typeofequation. For thediffusionequation,weneedone initialcon- dition,u.x;0/, statingwhatu iswhen theprocess starts. In addition, thediffusion equation needs one boundary condition at each point of the boundary @˝ of˝. Thisconditioncaneitherbe thatu isknownor thatweknowthenormalderivative, ru nD@u=@n (ndenotesanoutwardunit normal to@˝). Let us look at a specific application andhow the diffusion equationwith initial andboundaryconditions thenappears.Weconsider theevolutionof temperature in aone-dimensionalmedium,morepreciselya longrod,where thesurfaceof therod iscoveredbyan insulatingmaterial. Theheatcan thennotescape fromthesurface, which means that the temperature distribution will only depend on a coordinate along the rod,x, and time t. Atoneendof the rod,xDL,wealsoassume that the surface is insulated, but at theother end,x D 0,we assume thatwehave somede- vice forcontrolling the temperatureof themedium.Here, a functions.t/ tellswhat the temperature is in time.We thereforehaveaboundaryconditionu.0;t/D s.t/. At the other insulated end,x D L, heat cannot escape,which is expressed by the boundary condition@u.L;t/=@x D 0. The surface along the rod is also insulated andhencesubject to the sameboundarycondition (heregeneralized to@u=@nD 0 at thecurvedsurface). However, sincewehave reduced theproblemtoonedimen- sion,wedonot need this physical boundarycondition in ourmathematicalmodel. Inonedimension,wecanset˝ D Ε’0;L . To summarize, thepartial differential equationwith initial andboundarycondi- tions reads @u.x;t/ @t DΛ‡@ 2u.x;t/ @x2 Cg.x;t/; x2 .0;L/;t 2 .0;T ; (5.1) u.0;t/D s.t/; t 2 .0;T ; (5.2) @ @x u.L;t/D0; t 2 .0;T ; (5.3) u.x;0/DI.x/; x2 Ε’0;L : (5.4) Mathematically,we assume that at t D 0, the initial condition (5.4) holds and that thepartialdifferentialequation(5.1)comesintoplayfor t >0. Similarly,at theend points, theboundaryconditions (5.2)and (5.3)governuand theequation therefore isvalid forx2 .0;L/. Boundaryandinitialconditionsareneeded! The initial and boundary conditions are extremely important. Without them, the solution is not unique, and nonumericalmethodwillwork. Unfortunately, many physical applications have one ormore initial or boundary conditions as unknowns. Such situationscanbedealtwith ifwehavemeasurementsofu, but themathematical framework ismuchmorecomplicated.
back to the  book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python
Title
Programming for Computations – Python
Subtitle
A Gentle Introduction to Numerical Simulations with Python
Authors
Svein Linge
Hans Petter Langtangen
Publisher
Springer Open
Date
2016
Language
English
License
CC BY-NC 4.0
ISBN
978-3-319-32428-9
Size
17.8 x 25.4 cm
Pages
248
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