mathematical modelling lecture

  • Upload
    reborn2

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

  • 7/30/2019 mathematical modelling lecture

    1/10

    MATH3203 Lecture 1

    Mathematical Modelling and ODEs

    Dion WeatherleyEarth Systems Science Computational Centre,

    University of Queensland

    February 27, 2006

    Abstract

    Contents

    1 Mathematical Modelling 2

    1.1 Definition of a mathematical model . . . . . . . . . . . . . . . . . . . . . . 21.2 The mathematical modelling recipe . . . . . . . . . . . . . . . . . . . . . . 2

    2 A simple mathematical model - the Malthus population model 3

    3 A refined model - the logistic equation 3

    4 Further refinements - predator-prey and beyond 4

    5 From ODEs to PDEs 5

    5.1 Definition of a partial derivative and some useful tips . . . . . . . . . . . . 65.2 A simple PDE model - the 1D heat equation . . . . . . . . . . . . . . . . . 75.3 Some definitions of PDE types and order . . . . . . . . . . . . . . . . . . . 75.4 Linear vs. nonlinear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85.5 Arbitrary functions vs. arbitrary constants . . . . . . . . . . . . . . . . . . 8

    1

  • 7/30/2019 mathematical modelling lecture

    2/10

    1 Mathematical Modelling

    (From Chapter 1, Applied Differential Equations, J.D. Logan, Springer, 2004.)Many important concepts of Mathematics were developed in the framework of physical

    science. For example, calculus has its origins in efforts to describe the motion of bodies.Indeed one of the inventors of calculus was Newton. Mathematical equations provide alanguage in which to formulate concepts in physics - Maxwells equations describe elec-

    trodynamical phenomena, Newtons equations describe mechanical systems, Schrodingersequation describes quantum phenomena etc. Over the years mathematicians and scien-tists have extended these connections to almost every field of mathematics and science,resulting in the birth of the field of mathematical modelling.

    1.1 Definition of a mathematical model

    A mathematical model is an equation or set of equations whose solution describes thephysical behaviour of a related physical system.

    Formulation of the equations is based on experimentation, physical observations and

    intuition.A mathematical model is always a simplified description, or caricature, of physicalreality expressed in mathematical terms.

    1.2 The mathematical modelling recipe

    The recipe for mathematical modelling of a physical system, is essentially a corrollary forthe scientific method:

    1. experimentation and physical observations

    2. selection of the relevant physical variables

    3. formulation of equations governing the inter-dependance of these variables

    4. solution of the equations via analysis and numerical simulation

    5. validation of the mathematical model via comparison with observations

    The last step, validation, involves comparison of simulation results and solutions withphysical observations to ascertain whether the model describes the physical phenomenon.Since the mathematical model is invariably a simplification, there are alaways discrep-ancies between model solutions and physical observations. These discrepancies motivaterefinement of the model, so the recipe above is repeated ad infinitum.

    Refinement of the mathematical model eventually results in a set of equations thatare not amiable to analytical solution, particularly when nonlinear terms are included.Numerical simulation provides an avenue for solving nonlinear equations but requiresconsiderable care to ensure that the numerical solution is a valid solution of the equations.

    This course aims to provide basic skills in the use of numerical simulation to solvemathematical models and analyse the results. The first module introduces partial dif-ferential equations, their application in mathematical modelling, and one of the mostcommon numerical solution methods, explicit finite differences. The second module pro-vides skills in computer visualisation of simulation results in both 2- and 3D. In the thirdmodule, a number of other numerical solution methods will be discussed, and finally there

    will be some discussion of the use of parallel supercomputers for numerical simulation.

    2

  • 7/30/2019 mathematical modelling lecture

    3/10

    2 A simple mathematical model - the Malthus pop-

    ulation model

    As an example of mathematical modelling in action, we shall consider a physical systemgoverned by a 1D Ordinary Differential Equation (ODE). A typical model in populationecology is the Malthus model. Its aim is to model the growth of a population of organisms

    (could be people, animals, bacteria, viruses etc.).The conjecture underlying the model is that the rate of increase of a population isproportional to the size of the population. This conjecture is expressed mathematicallyas:

    dU

    dt= rU, t > 0, (1)

    where U = U(t) is the population at some time t and the real number r is a given physicalparameter representing the growth rate. Physical parameters typically are measurablequantities. In this case, by observing the population we could measure r.

    In mathematical modelling parlance, U(t) is the state variable and the time-evolution

    of the state variable is governed by equation 1. ODEs are suitable for modelling theevolution of one or more state variables that depend only each other and one independantvariable (usually time). In this course we will focus predominantly upon PDE models, inwhich state variables depend on two or more independant variables (usually 1 or morespace variables and possibly time).

    At this point, we have completed steps 1-3 of the mathematical modelling recipe. Nextis solution of the model equations via analysis and/or numerical simulation. Solution ofthe model involves finding an expression for the state variable U(t), that is a function ofthe independant variable and possibly some other known or measurable quantities.

    In the case of equation 1, the solution may be obtained analytically (by inspection):

    U(t) = U0ert, t > 0, (2)

    where U0 represents the population size at time t = 0.Having successfully completed step 4, it is time to validate the mathematical model, by

    comparison with physical observation and experimentation. The Malthus model predictsexponential growth of the population. While this accurately models the beginning stagesof growth of some populations, the model fails at some time in the time-history of thepopulation.

    Why does the model fail? It fails because the model does not account for other factorsthat affect the growth of a population. For example, competition for resources, predation

    and/or disease etc.

    3 A refined model - the logistic equation

    The Malthus equation accurately describes the initial stages of population growth butfails thereafter. Specifically, observations of real populations show that populations oftenstabilise after the initial growth period and the size of the population does not continueto increase exponentially. In other words, the population reaches a steady-state wherethe growth rate approximately balances the mortality rate.

    3

  • 7/30/2019 mathematical modelling lecture

    4/10

    The logistic equation was introduced as a refinement to the malthus model. Theadditional conjecture it embodies is that their is some finite maximum carrying capacityfor the population, K. This carrying capacity is another physical parameter, that can bemeasured via physical observations.

    Let N(t) be the size of the population at time t. The logistic equation is:

    dN

    dt =

    rN(K N)

    K, t >

    0,

    (3)where r is the Malthusian growth rate. By dividing both sides by K and setting U(t) =N(t)K

    , we obtain the more common form of the logistic equation:

    dU

    dt= rU(1 U), t > 0. (4)

    Now we have entered the realm of nonlinear differential equations. This ODE isnonlinear because it involves a nonlinear function of the state variable, namely U2. Inmost cases, nonlinear equations cannot be solved analytically and numerical methodsmust be applied. In this case, an analytical solution can be found, namely:

    U(t) =1

    1 +

    1U0

    1

    ert, t > 0, (5)

    where again, U0 is the initial population size, at t = 0. What happens as t ?U(t) 1 i.e. N(t) K, the population size approaches the carrying capacity, K.Thus, the logistic model satisfies the physical observation that populations often reach aconstant size, after an initial period of exponential growth.

    4 Further refinements - predator-prey and beyond

    One might be tempted to close the book on population ecology at this point...problemsolved. However, comparison with physical observations (step 5 again) shows that thislogistic equation is only applicable if the ecosystem consists of only a single species witha constant supply of nutrients e.g. bacteria in petri dish supplied with a constant amountof glucose.

    Suppose we are interested in modelling an ecosystem containing two species, one ofwhich predates solely upon the other species as its source of nutrients. Lets also supposethe prey has a constant supply of nutrients. In this case, the carrying capacity of thepredator species will depend upon the population of the prey species. Furthermore, thegrowth rate of the prey species will depend upon the population of the predator species.

    Mathematically, we can express this as a set of two coupled equations. Let U1(t) andU2(t) represent the population of the prey and predators respectively. The prey populationmight be governed by a modified logistic equation in which the growth rate is governedby the current population of the predator species:

    dU1dt

    = (r1 p12U2)U1(K1 U1)

    K1, t > 0, (6)

    where p12 is a physical parameter defining the death rate of prey per unit predator pop-ulation and K1 is the carrying capacity of the prey, thanks to the constant food supply.The predator population may be described by another modified logistic equation:

    4

  • 7/30/2019 mathematical modelling lecture

    5/10

    dU2dt

    = r2U2(K21U1 U2)

    K21U1, t > 0, (7)

    where now the carrying capacity depends upon the prey population and a physical param-eter (K21) defining the carrying capacity per unit prey population. As the prey populationincreases, the carrying capacity of the predator population increases and vice versa.

    We now have quite a complicated model for our ecosystem involving two state variables(U1 and U2) whose evolution are coupled to each other, as well as upon the independantvariable, time. We will not attempt to examine the solution of this mathematical model.Indeed it is quite a complicated problem with a number of different solutions dependingupon the values of the physical parameters and the initial populations of predators andprey. One such solution is a stable ecosystem in which the populations of both predatorsand prey fluctuate about some mean value. Another solution is mass extinction: thepredators increase in number too rapidly, eat all the prey, then die of starvation.

    Despite the complicated nature of the mathematical model and its solution space,these coupled equations are quite readily studied, particularly with the aid of numericalsimulations in which various physical parameters may be tried systematically and the

    numerical solutions analysed.We may also wish to go a step further and consider a mathematical model for an

    ecosystem consisting of a number of different species, many of which are prey of somespecies and predators of others. Careful definition of the evolution equation for eachspecies and the coupling coefficients between the species, allows us to formulate a math-ematical model which is a system of coupled differential equations, of the form:

    dUdt

    = f(t, U; r, K, p), t > 0, , = 1, 2, . . . , N (8)

    where N is the number of different species in the ecosystem.

    Such systems of coupled differential equations are quite common in the sciences. Ifthe functions f have certain properties, chiefly linearity or weak nonlinearity, the systemmay be described as a matrix equation of the form:

    U = FU (9)

    where F is an NxN matrix defining the coupling between each of the elements of the vectorU representing the populations of each species. The matrix may be sparsely occupied (i.e.most elements are zero), diagonal, tri-diagonal, banded or densely populated. Dependingupon the structure of the matrix, different numerical solution methods must be employedto solve the equations. As we shall see later, many partial differential equation models

    may be expressed as systems of equations of this form. We shall discuss some of thenumerical methods for solving such equations later in the course.

    5 From ODEs to PDEs

    The population ecology examples demonstrate the power of ODEs for mathematical mod-elling of physical systems. However, in all the cases examined, the solutions are simplyfunctions of a single independant variable representing time. From our own experience,physical systems often evolve not only in time but also in at least three spatial dimen-sions. For example, if one observes a cloud over a period of an hour, its shape (or spatial

    5

  • 7/30/2019 mathematical modelling lecture

    6/10

    structure) will change in addition to the cloud floating slowly across the sky as a singlebank. We could model the cloud as a spherical body moving at constant velocity usingan ODE but this model would not capture much of the cloud dynamics we can observe.

    Partial differential equation models permit one to model state variables that dependon more than one independant variable. Often these independant variables are time andone or more spatial dimensions or in so-called steady-state problems, two or more spatialdimensions only. Suppose we make some physical observations of a phenomenon (step 1)

    and select a single relevant state variable (step 2) that varies both spatially and temporally.For simplicity, lets assume that the physical system can be described one-dimensionallyi.e. the state variable U = U(x, t). We now formulate an equation describing the evolutionof the state variable (step 3). On physical grounds, we are likely to summise that theform of this equation will involve the time rate-of-change of the state variable and alsothe spatial rate-of-change (or gradient) of the state variable.

    5.1 Definition of a partial derivative and some useful tips

    The definition of a partial differential is of use in formulating such equations. For a

    function of two indendant variables (x and t) we can define two partial differentials,namely:

    U

    t= lim

    t0

    U(x, t + t) U(x, t)

    t(10)

    and:

    U

    x= lim

    x0

    U(x + x, t) U(x, t)

    x. (11)

    Recalling the definition of the total derivative of a function of a single variable, one cansee that these two defines imply that we compute partial derivatives with respect to oneindependant variable by treating the other independant variable as a constant parameter.Hence, most of the tricks learnt to compute total derivatives can be directly applied tocomputing partial derivatives e.g.

    U(x, t) = Axt2,U

    t= 2Axt,

    U

    x= At2 . (12)

    or,

    U(x, t) = A sin(x)ert,U

    t= rA sin(x)ert,

    U

    x= A cos(x)ert . (13)

    To avoid lawsuits because of MATH3203-induced RSI, we will employ a shorthandnotation to represent derivatives:

    Ut =U

    t, Ux =

    U

    x(14)

    We can also define higher order partial derivatives:

    Utt =

    t

    U

    t

    =

    2U

    t2, (15)

    Uxx =

    xU

    x =

    2U

    x2, (16)

    6

  • 7/30/2019 mathematical modelling lecture

    7/10

    and

    Utx =

    t

    U

    x

    , (17)

    If U(x, t) is a sufficiently well-behaved function (i.e. continuous or piece-wise continuousetc.), a useful identity that is valid more often than not is Utx = Uxt i.e. the order in

    which the partial derivatives are computed is unimportant.

    5.2 A simple PDE model - the 1D heat equation

    Having dispensed with the preliminaries, we can now begin using PDEs for mathematicalmodelling. Consider the problem of determining the temperature of a laterally insulatedmetal bar of length l and unit cross-sectional area, whose two ends are maintained ata constant temperature of zero degrees and whose temperature initially varies along thebar and is given by a fixed function (x). Lets represent the temperature in the bar asU = U(x, t), our state variable for this problem defined for interval t > 0 and for thedomain 0 < x < l.

    The equation governing the evolution of temperature is called the heat equation andit has the form:

    Ut = kUxx, (18)

    which is a partial differential equation i.e. an equation involving various partial derivativesof the state variable U. The constant k is called the thermal diffusivity and as its namesuggests, it is a physical parameter determining the rate at which temperature diffusesalong the bar. The thermal diffusivity can be determined in terms of the density, specificheat and thermal conductivity of the metal, all of which can be measured in laboratoryexperiments.

    We can also express the other information in the original problem via additional con-straints:

    U(0, t) = 0, U(l, t) = 0, t > 0, (19)

    which are called boundary conditions because they impose conditions on the state variableon the boundary of the spatial domain. We can also write an initial condition, expressingthe initial temperature along the bar:

    U(x, 0) = (x), 0 < x < l. (20)

    The set of three equations (the PDE and and auxillary conditions) defines the mathe-matical model for heat flow in the bar. Such problems are called initial boundary valueproblems in PDE parlance.

    5.3 Some definitions of PDE types and order

    Some physical systems do not depend upon time, but rather only spatial variables. Suchmodels are called steady state or equilibrium models. For example, Laplaces equation in3D has the form:

    Uxx + Uyy + Uzz = 0 (x,y ,z )

    , (21)

    7

  • 7/30/2019 mathematical modelling lecture

    8/10

    where is a specified spatial domain. If we also specify a time-independant function onthe boundary of the domain, e.g.

    U(x,y ,z ) = f(x,y ,z ), (x,y ,z ) , (22)

    we have a boundary value problem. Solving Laplaces equation as defined in the twoequations above is also known as solving the Dirichlet problem.

    In general, a PDE in one spatial variable and time is an equation of the form:

    G(x,t,U,Ux, Ut, Uxx, Utt, Uxt, . . .) = 0, x , t I, (23)

    where I is a given time interval (typically t > 0).The order of a PDE is the order of highest derivative that appears in the equation. A

    PDE model is a PDE supplemented with initial and boundary conditions as appropriate,and the model may also contain one or more physical parameters.

    PDEs are classified according to their order and other properties. For example, a PDEis linear if the function G is a linear function of the state variable U and all its derivative,otherwise the PDE is nonlinear. A linear equation is homogeneous if every term involves

    U or some derivative of U i.e. there is no explicit time-dependance.

    5.4 Linear vs. nonlinear

    The partitioning of PDEs into linear and nonlinear is quite significant. Solutions of linearequations superimpose. Suppose f(x, t) and g(x, t) are both solutions of a given linearPDE. Then all linear combinations (Aff(x, t) + Agg(x, t)) of these two solutions are alsosolutions of the PDE, where Af, Ag are constant coefficients. This is a very significantadvantage for solving linear PDEs. If we are able to find a set of particular solutions ofthe PDE, we can construct all other solutions as linear combinations of these.

    Nonlinear equations do not share this property of superposition and are usually muchharder to solve and the solutions more difficult to analyze. It is common in mathematicalmodelling to attempt to approximate a nonlinear phenomenon in nature with a linearmodel. While these linear models provide insight into the nature of the phenomenon, oftenthey are insufficient to describe some of the important aspects and one must introducenonlinear terms to the model. Usually nonlinear models cannot be solved by hand, sonumerical methods must be devised. This course will largely ignore nonlinear equationsand focus on the basis tools for numerical solutions of PDEs.

    5.5 Arbitrary functions vs. arbitrary constants

    Whereas the solutions of ODEs often involve arbitrary constants, often called integrationconstants, the solutions of PDEs are often arbitrary functions. Consider the followingPDE:

    ux = t sin(x) (24)

    This equation can be solved by direct integration. We integrate both size with respect tox, holding t fixed:

    infty

    uxx =infty

    t sin(x) (25)

    8

  • 7/30/2019 mathematical modelling lecture

    9/10

    u(x, t) = t cos(x) + (t) (26)

    where is an arbitrary function. Notice that integration with respect to one independantvariable results in an arbitrary function of the other independant variables, not an arbi-trary constant as in ODEs. This last equation defines the general solution of the PDE.One can check that it is a solution for any differentiable function (t) by substituting it

    back into the original PDE.In summary, PDEs have arbitrary functions in their general solutions; the number ofarbitrary functions usually agrees with the order of the equation.

    9

  • 7/30/2019 mathematical modelling lecture

    10/10

    References

    10