3 views

Uploaded by ddsfath

- Finite Element Analysis
- Pde
- MS
- Marine Eng Master of Science Programs
- Notes on Stochastic Finance-Nicolas Privaut
- Quantitative Methods in Project Management
- ME582 Thermofluid Finite Elements
- Computational Methods for Geophysics References.pdf
- Uit Rgpv First Year Syllabus
- QE Test
- Extension 2, 4 Unit_2011_Sydney Technical High School HSC Trial Paper
- FSI Methods
- PHY103_Lec_10
- Important Notes of 10th Class Math Exercise 3.4
- the sequential clustered method for dynamic chemical plant simulation
- Rrb Short Cuts
- 219 Suggested Problems 2014
- Trabajo
- RAS203
- SirishaKala

You are on page 1of 3

How to solve IBVPs in one spatial dimension using pdepe

7.1

Specifying an IBVP

The Matlab solver pdepe solves PDEs of the form (x, t, u, ux )ut = xm (xm f (x, t, u, ux ))x +s(x, t, u, ux ) (x (a, b), t (t0 , tnal ])

The constant m may be 0, 1 or 2; if m > 0 then a must be non-negative. The ux term f must depend on ux . The term must be non-negative, and may only be zero at mesh points. Spatial discontinuities in or the source term s are allowed but only at mesh points. The problem has an initial condition of the form u(x, t0 ) = (x) The boundary conditions are pleft (a, t, u(a, t)) + qleft (a, t)f (a, t, u(a, t), ux (a, t)) = 0, pright (b, t, u(b, t)) + qright (b, t)f (b, t, u(b, t), ux (b, t)) = 0 for t t0 , where qleft and qright are either identically zero or never zero. Thus, the mathematical problem is completely dened by the specifying the values m, a, b, t0 , tnal and by the functions , f, s, pleft , qleft , pright , qright , . Example 1 Consider the PDE 2 ut = uxx on 0 < x < 1 and 0 < t 2 with boundary conditions u(0, t) = 0, ux (1, t) = et (a x b).

and initial condition u(x, 0) = sin(x). This models for example the temperature in a rod with c = 2 and K = 1 that is insulated along its length, its left end maintained at constant zero temperature, and ux at the right end given by Kux (1) = et (the negative sign implies that heat ows out of the rod at this end). The specication of the problem for solution by pdepe is m = 0, a = 0, b = 1, t0 = 0, tnal = 2, (x, t, u, ux ) = 2 , f (x, t, u, ux ) = ux , s(x, t, u, ux ) = 0, pleft (a, t, u(a, t)) = u(a, t), qleft (a, t) = 0, pright (b, t, u(b, t)) = et , qright (b, t) = 1, (x) = sin(x). The exact solution for this problem can be obtained by the method of separation of variables: u(x, t) = et sin(x).

Example 2 Consider the PDE ut = x2 (x2 f (x, t, u, ux ))x + s(x, t, u, ux ) where f (x, t, u, ux ) = 5ux x (0, 0.5] , ux x (0.5, 1) s(x, t, u, ux ) = 1000eu x (0, 0.5] eu x (0.5, 1) (0 < x < 1, 0 < t 1),

The boundary conditions are ux (0, t) = 0 and u(1, t) = 1, and the initial condition is 0 x (0, 1) (x) = 1 x = 1. The specication of the problem for solution by pdepe is m = 2, a = 0, b = 1, t0 = 0, tnal = 1, (x, t, u, ux ) = 1, pleft (a, t, u(a, t)) = 0, qleft (a, t) = 1 pright (b, t, u(b, t)) = u(b, t) 1, qright (b, t) = 0. and with f, s, specied as above.

7.2

Solving an IBVP

The syntax of the Matlab PDE solver for a single PDE is sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan) where m is 0, 1 or 2, pdefun is a handle to a function that computes , f and s, with calling syntax [mu,f,s] = pdefun(x,t,u,ux) icfun is a handle to a function that computes the initial condition , with calling syntax phi = icfun(x) bcfun is a handle to a function that computes the boundary condition. Its calling syntax is [pleft,qleft,pright,qright] = bcfun(a,ua,b,ub,t) where ua and ub are the values of u(a, t) and u(b, t). For m > 0 and a = 0 the solver automatically uses the boundary condition ux (0, t) = 0 and ignores the values returned in pleft and qleft. xmesh is a vector of points in [a, b] where the solution is approximated. The solution interval end points a and b are xmesh(1) and xmesh(end), the values of xmesh must be monotonically increasing, and the length of xmesh must be at least 3. 2

tspan is a vector of time values where the solution is approximated. The start and end times t0 and tnal are tspan(1) and tspan(end), the values of tspan must be monotonically increasing, and the length of tspan must be at least 3. sol is a three-dimensional array where sol(i,j,1) is the solution value at time tspan(i) and mesh point xmesh(j). (The third dimension is for systems of PDEs.) Example 1 can be coded by the functions function [mu,f,s] = pdex1pde(x,t,u,ux) mu = pi2; f = ux; s = 0; function phi = pdex1ic(x) phi = sin(pi*x); function [pleft,qleft,pright,qright] = pdex1bc(a,ua,b,ub,t) pleft = ua; qleft = 0; pright = pi * exp(-t); qright = 1; and solved using x = linspace(0,1,20); t = linspace(0,2,5); sol = pdepe(0,@pdex1pde,@pdex1ic,@pdex1bc,x,t); u = sol(:,:,1); surf(x,t,u)

Time t

0.5 0 0

0.2

0.4

0.6

Distance x

The code to solve this example is pdex1 which you can run from the Matlab command line. You can look at it using the command edit pdex1 See pdex2 for the code that solves Example 2. 3

- Finite Element AnalysisUploaded byMahmood Mukhtar
- PdeUploaded byhongleki
- MSUploaded byHarishankar Singh Yadav
- Marine Eng Master of Science ProgramsUploaded byMohammed Gamal
- Notes on Stochastic Finance-Nicolas PrivautUploaded byziokoala
- Quantitative Methods in Project ManagementUploaded byMichael Trumper
- ME582 Thermofluid Finite ElementsUploaded bylarasmoyo
- Computational Methods for Geophysics References.pdfUploaded byabuobida
- Uit Rgpv First Year SyllabusUploaded byYasir Mujtaba
- QE TestUploaded byAtul Tiwari
- Extension 2, 4 Unit_2011_Sydney Technical High School HSC Trial PaperUploaded byMathKeys
- FSI MethodsUploaded byAlexander Narváez
- PHY103_Lec_10Uploaded byShreya
- Important Notes of 10th Class Math Exercise 3.4Uploaded byTayyabah Shah
- the sequential clustered method for dynamic chemical plant simulationUploaded byyalllik
- Rrb Short CutsUploaded bySathiyen Gaja
- 219 Suggested Problems 2014Uploaded byosmanfırat
- TrabajoUploaded byNelly Liliana
- RAS203Uploaded bySaurav Kumar
- SirishaKalaUploaded bycreative_34
- Assignment 4, Valentin PerlovUploaded byKaterina Pearl
- Strategies of Domain Decomposition to Partition Mesh-Based Applications onto Computational GridsUploaded byJournal of Computing
- FM.3(1)Uploaded byArun Verma
- Regents Review 8Uploaded bysweeetmargaretx3
- m340project Sacco MaddenUploaded byDavid Sacco
- Cables 1Uploaded bylibrian_30005821
- 75133828 d 01Uploaded byJhalin Gutierrez
- 02_Computing_Minimum_Edit_Distance_5-54.pdfUploaded byAdvay Rajhansa
- Knowledge and Currriculum Philo EduUploaded byPremaria Mahaputri
- Taylor ExpansionUploaded byJammy4411

- Review Problems 1-85 a Hydraulic Lift is Used to LiftUploaded bypanalopee
- Summary 1Uploaded byguisgs
- Glossary 1Uploaded byZaqzaq Zaq
- Dosya So Ukrayna Kriz MetinlerUploaded byddsfath
- Solid Oxide Fuel Cells for Stationary, Mobile, And Military ApplicationsUploaded byddsfath
- Mass Transfer (Mech-tech.blogsky.com)Uploaded bypal
- Thermo_5th_Chap03P102Uploaded byIENCS
- Thermo_5th_Chap03P061Uploaded byIENCS
- Chapter 1 Introduction and Basic ConceptsUploaded bypanalopee
- How to 071212 Greetings InformalUploaded bytakakhan
- Thermo_5th_Chap03P001Uploaded byJohanna Avila Marcillo
- Us 20120097550Uploaded byddsfath
- Production of Micro-tubular Solid Oxide Fuel CellsUploaded byddsfath
- Performance Anaylsis of an Intermediate Temperature Solid Oxide Fuel Cell Orta Sicaklik Kati Oksit Yakit Pili Performans AnaliziUploaded byddsfath
- using_mlUploaded byddsfath
- Matlab Tutorial5Uploaded byAsterix
- symbtutUploaded byddsfath
- Numerical Analysis in Matlab ContentsUploaded bymounabs
- Partial Differential Equations in MATLABUploaded byAsterix
- Par TiUploaded bycontact 2 web
- matodeUploaded byPointcarre
- Matlab Session 4Uploaded byddsfath
- matlab_chemical Enginer.pdfUploaded byAlsd Cupie
- MatlabUploaded byDINESHKUMARMCE
- Example ProgramUploaded byddsfath
- D2.Followup QuizUploaded byddsfath
- 3 Introduce People (Formal)Uploaded byRodrigo Lopez Martinez
- Numerical Study of Heterogeneous Reactions in an SOFCUploaded byddsfath

- Quadratic FormulaUploaded byange lopez
- Chemical EquationUploaded byChristina T Z-chYn
- Notes - FullUploaded byConnor Hughes
- Course Outline - MSMEUploaded byAbdullah Ilyas
- Mdframed Example TexsxUploaded bymanusansano
- Diff Equation 4 2011 Fall HIGH Order TheoryUploaded byAnna Cristache
- extra - solving quadratic equationsUploaded byapi-320986347
- [Kyoto Workshop on Numerical Analysis of Odes (199(BookSee.org)Uploaded bynidduzzi
- FIRST ORDER ODE.pptUploaded byKuma Ravelu
- quadratic_eq.pdfUploaded byAonnii Tatty
- 5 4-graphing systemsUploaded byapi-299545740
- Opti Assignment 1Uploaded byOjie
- Cálculo Introductorio (Preliminar)Uploaded byElphego Torres
- maths 5 2Uploaded byapi-230427224
- Lecture Notes 11-Initial Value Problem ODEUploaded byTebsu Tebsuko
- ode2Uploaded byRajesh Lingampally
- 7.1 Finite Difference-Taylor FormulaeUploaded byChun Tat Teo
- Legendre–Galerkin Method for the Linear FredholmUploaded bysarsaran
- Differential Equations 5.97Uploaded byHimanshu Vasistha
- FEM 3.pdfUploaded bydonprofaghatise
- Modified Variational Iteration Method of Solution the Fractional Partial Differential Equation ModelUploaded byIOSRjournal
- Volume_of_Fluid_MethodUploaded byMrinal Mantravadi
- A Lattice Boltzmann Method for KDV EquationUploaded bySomdeb Bandopadhyay
- ga_math_aUploaded byjose kadyr choque orellana
- RD Sharma Class 10 Solutions Chapter 1 Real NumbersUploaded bygyanpub
- strong form and weak formUploaded byFatima Khalid
- Application of Adomian Decomposition method to seepage flow derivatives in porous media using fractional calculusUploaded byIJSRP ORG
- Strategic Intervention Material - Linear and Quadratic FunctionsUploaded byApril Gonzales
- Advanced Finite-difference Methods for Seismic ModelingUploaded bydiearz
- 20140216200210_ODE RI SEM 2 20132014Uploaded bySyazwan Salleh