Sunteți pe pagina 1din 10

MATH3203 Lecture 1 Mathematical Modelling and ODEs

Dion Weatherley
Earth Systems Science Computational Centre, University of Queensland

February 27, 2006


Abstract

Contents
1 Mathematical Modelling 1.1 Denition of a mathematical model . . . . . . . . . . . . . . . . . . . . . . 1.2 The mathematical modelling recipe . . . . . . . . . . . . . . . . . . . . . . 2 A simple mathematical model - the Malthus population model 3 A rened model - the logistic equation 4 Further renements - predator-prey and beyond 5 From ODEs to PDEs 5.1 Denition of a partial derivative and some useful tips 5.2 A simple PDE model - the 1D heat equation . . . . . 5.3 Some denitions of PDE types and order . . . . . . . 5.4 Linear vs. nonlinear . . . . . . . . . . . . . . . . . . 5.5 Arbitrary functions vs. arbitrary constants . . . . . . 2 2 2 3 3 4 5 6 7 7 8 8

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

Mathematical Modelling

(From Chapter 1, Applied Dierential 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 eorts to describe the motion of bodies. Indeed one of the inventors of calculus was Newton. Mathematical equations provide a language in which to formulate concepts in physics - Maxwells equations describe electrodynamical phenomena, Newtons equations describe mechanical systems, Schrodingers equation describes quantum phenomena etc. Over the years mathematicians and scientists have extended these connections to almost every eld of mathematics and science, resulting in the birth of the eld of mathematical modelling.

1.1

Denition of a mathematical model

A mathematical model is an equation or set of equations whose solution describes the physical behaviour of a related physical system. Formulation of the equations is based on experimentation, physical observations and intuition. A mathematical model is always a simplied description, or caricature, of physical reality expressed in mathematical terms.

1.2

The mathematical modelling recipe

The recipe for mathematical modelling of a physical system, is essentially a corrollary for the scientic 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 with physical observations to ascertain whether the model describes the physical phenomenon. Since the mathematical model is invariably a simplication, there are alaways discrepancies between model solutions and physical observations. These discrepancies motivate renement of the model, so the recipe above is repeated ad innitum. Renement of the mathematical model eventually results in a set of equations that are not amiable to analytical solution, particularly when nonlinear terms are included. Numerical simulation provides an avenue for solving nonlinear equations but requires considerable 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 solve mathematical models and analyse the results. The rst module introduces partial differential equations, their application in mathematical modelling, and one of the most common numerical solution methods, explicit nite dierences. The second module provides skills in computer visualisation of simulation results in both 2- and 3D. In the third module, a number of other numerical solution methods will be discussed, and nally there will be some discussion of the use of parallel supercomputers for numerical simulation. 2

A simple mathematical model - the Malthus population model

As an example of mathematical modelling in action, we shall consider a physical system governed by a 1D Ordinary Dierential Equation (ODE). A typical model in population ecology 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 is proportional to the size of the population. This conjecture is expressed mathematically as: dU = rU, t > 0, (1) dt where U = U (t) is the population at some time t and the real number r is a given physical parameter representing the growth rate. Physical parameters typically are measurable quantities. 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 the evolution of one or more state variables that depend only each other and one independant variable (usually time). In this course we will focus predominantly upon PDE models, in which state variables depend on two or more independant variables (usually 1 or more space variables and possibly time). At this point, we have completed steps 1-3 of the mathematical modelling recipe. Next is solution of the model equations via analysis and/or numerical simulation. Solution of the model involves nding an expression for the state variable U (t), that is a function of the 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) = U0 ert , 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 predicts exponential growth of the population. While this accurately models the beginning stages of growth of some populations, the model fails at some time in the time-history of the population. Why does the model fail? It fails because the model does not account for other factors that aect the growth of a population. For example, competition for resources, predation and/or disease etc.

A rened model - the logistic equation

The Malthus equation accurately describes the initial stages of population growth but fails thereafter. Specically, observations of real populations show that populations often stabilise after the initial growth period and the size of the population does not continue to increase exponentially. In other words, the population reaches a steady-state where the growth rate approximately balances the mortality rate.

The logistic equation was introduced as a renement to the malthus model. The additional conjecture it embodies is that their is some nite maximum carrying capacity for the population, K . This carrying capacity is another physical parameter, that can be measured via physical observations. Let N (t) be the size of the population at time t. The logistic equation is: dN rN (K N ) (3) = , t > 0, dt K where r is the Malthusian growth rate. By dividing both sides by K and setting U (t) = N (t) , we obtain the more common form of the logistic equation: K dU = rU (1 U ), t > 0. (4) dt Now we have entered the realm of nonlinear dierential equations. This ODE is nonlinear because it involves a nonlinear function of the state variable, namely U 2 . In most cases, nonlinear equations cannot be solved analytically and numerical methods must be applied. In this case, an analytical solution can be found, namely: U (t) = 1 1+
1 U0

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 satises the physical observation that populations often reach a constant size, after an initial period of exponential growth.

Further renements - predator-prey and beyond

One might be tempted to close the book on population ecology at this point...problem solved. However, comparison with physical observations (step 5 again) shows that this logistic equation is only applicable if the ecosystem consists of only a single species with a constant supply of nutrients e.g. bacteria in petri dish supplied with a constant amount of glucose. Suppose we are interested in modelling an ecosystem containing two species, one of which predates solely upon the other species as its source of nutrients. Lets also suppose the prey has a constant supply of nutrients. In this case, the carrying capacity of the predator species will depend upon the population of the prey species. Furthermore, the growth 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) and U2 (t) represent the population of the prey and predators respectively. The prey population might be governed by a modied logistic equation in which the growth rate is governed by the current population of the predator species: dU1 U1 (K1 U1 ) = (r1 p12 U2 ) , t > 0, (6) dt K1 where p1 2 is a physical parameter dening the death rate of prey per unit predator population and K1 is the carrying capacity of the prey, thanks to the constant food supply. The predator population may be described by another modied logistic equation:

dU2 U2 (K21 U1 U2 ) = r2 , t > 0, (7) dt K21 U1 where now the carrying capacity depends upon the prey population and a physical parameter (K21 ) dening the carrying capacity per unit prey population. As the prey population increases, 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 independant variable, time. We will not attempt to examine the solution of this mathematical model. Indeed it is quite a complicated problem with a number of dierent solutions depending upon the values of the physical parameters and the initial populations of predators and prey. One such solution is a stable ecosystem in which the populations of both predators and prey uctuate about some mean value. Another solution is mass extinction: the predators 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 numerical simulations 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 dierent species, many of which are prey of some species and predators of others. Careful denition of the evolution equation for each species and the coupling coecients between the species, allows us to formulate a mathematical model which is a system of coupled dierential equations, of the form: dU (8) = f (t, U ; r , K , p ), t > 0, , = 1, 2, . . . , N dt where N is the number of dierent species in the ecosystem. Such systems of coupled dierential equations are quite common in the sciences. If the functions f have certain properties, chiey linearity or weak nonlinearity, the system may be described as a matrix equation of the form: = FU U (9)

where F is an NxN matrix dening the coupling between each of the elements of the vector U 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. Depending upon the structure of the matrix, dierent numerical solution methods must be employed to solve the equations. As we shall see later, many partial dierential equation models may be expressed as systems of equations of this form. We shall discuss some of the numerical methods for solving such equations later in the course.

From ODEs to PDEs

The population ecology examples demonstrate the power of ODEs for mathematical modelling of physical systems. However, in all the cases examined, the solutions are simply functions 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 dimensions. For example, if one observes a cloud over a period of an hour, its shape (or spatial 5

structure) will change in addition to the cloud oating slowly across the sky as a single bank. We could model the cloud as a spherical body moving at constant velocity using an ODE but this model would not capture much of the cloud dynamics we can observe. Partial dierential equation models permit one to model state variables that depend on more than one independant variable. Often these independant variables are time and one or more spatial dimensions or in so-called steady-state problems, two or more spatial dimensions 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-dimensionally i.e. the state variable U = U (x, t). We now formulate an equation describing the evolution of the state variable (step 3). On physical grounds, we are likely to summise that the form of this equation will involve the time rate-of-change of the state variable and also the spatial rate-of-change (or gradient) of the state variable.

5.1

Denition of a partial derivative and some useful tips

The denition of a partial dierential is of use in formulating such equations. For a function of two indendant variables (x and t) we can dene two partial dierentials, namely: U U (x, t + t) U (x, t) = lim t0 t t and: U U (x + x, t) U (x, t) (11) = lim . x0 x x Recalling the denition of the total derivative of a function of a single variable, one can see that these two denes imply that we compute partial derivatives with respect to one independant 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 to computing partial derivatives e.g. U (x, t) = Axt2 , or, U U = rA sin(x)ert , = A cos(x)ert . (13) t x To avoid lawsuits because of MATH3203-induced RSI, we will employ a shorthand notation to represent derivatives: U (x, t) = A sin(x)ert , U U , Ux = t x We can also dene higher order partial derivatives: Ut = Utt = Uxx = t x U t U x 6 = = 2U , t2 2U , x2 (14) U = 2Axt, t U = At2 x . (12) (10)

(15) (16)

and Utx = t U x , (17)

If U (x, t) is a suciently well-behaved function (i.e. continuous or piece-wise continuous etc.), 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 mathematical modelling. Consider the problem of determining the temperature of a laterally insulated metal bar of length l and unit cross-sectional area, whose two ends are maintained at a constant temperature of zero degrees and whose temperature initially varies along the bar and is given by a xed function (x). Lets represent the temperature in the bar as U = U (x, t), our state variable for this problem dened for interval t > 0 and for the domain 0 < x < l. The equation governing the evolution of temperature is called the heat equation and it has the form: Ut = kUxx , (18)

which is a partial dierential equation i.e. an equation involving various partial derivatives of the state variable U . The constant k is called the thermal diusivity and as its name suggests, it is a physical parameter determining the rate at which temperature diuses along the bar. The thermal diusivity can be determined in terms of the density, specic heat and thermal conductivity of the metal, all of which can be measured in laboratory experiments. We can also express the other information in the original problem via additional constraints: U (0, t) = 0, U (l, t) = 0, t > 0, (19)

which are called boundary conditions because they impose conditions on the state variable on the boundary of the spatial domain. We can also write an initial condition, expressing the initial temperature along the bar: U (x, 0) = (x), 0 < x < l. (20)

The set of three equations (the PDE and and auxillary conditions) denes the mathematical model for heat ow in the bar. Such problems are called initial boundary value problems in PDE parlance.

5.3

Some denitions of PDE types and order

Some physical systems do not depend upon time, but rather only spatial variables. Such models are called steady state or equilibrium models. For example, Laplaces equation in 3D has the form: Uxx + Uyy + Uzz = 0 (x, y, z ) , 7 (21)

where is a specied spatial domain. If we also specify a time-independant function on the 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 dened in the two equations 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 classied according to their order and other properties. For example, a PDE is 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 signicant. Solutions of linear equations superimpose. Suppose f (x, t) and g (x, t) are both solutions of a given linear PDE. Then all linear combinations (Af f (x, t) + Ag g (x, t)) of these two solutions are also solutions of the PDE, where Af , Ag are constant coecients. This is a very signicant advantage for solving linear PDEs. If we are able to nd a set of particular solutions of the PDE, we can construct all other solutions as linear combinations of these. Nonlinear equations do not share this property of superposition and are usually much harder to solve and the solutions more dicult to analyze. It is common in mathematical modelling to attempt to approximate a nonlinear phenomenon in nature with a linear model. While these linear models provide insight into the nature of the phenomenon, often they are insucient to describe some of the important aspects and one must introduce nonlinear terms to the model. Usually nonlinear models cannot be solved by hand, so numerical methods must be devised. This course will largely ignore nonlinear equations and 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 integration constants, the solutions of PDEs are often arbitrary functions. Consider the following PDE: ux = t sin(x) (24)

This equation can be solved by direct integration. We integrate both size with respect to x, holding t xed:
inf ty inf ty

ux x =

t sin(x)

(25)

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

(26)

where is an arbitrary function. Notice that integration with respect to one independant variable results in an arbitrary function of the other independant variables, not an arbitrary constant as in ODEs. This last equation denes the general solution of the PDE. One can check that it is a solution for any dierentiable function (t) by substituting it back into the original PDE. In summary, PDEs have arbitrary functions in their general solutions; the number of arbitrary functions usually agrees with the order of the equation.

References

10

S-ar putea să vă placă și