You are on page 1of 15

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Part 2: Ordinary Differential Equations (ODEs)


(This is new material, see Kreyszig, Chapters 1-6, and related numerics in Chaps. 19, 20, 20.1-20.7, and 21.1-21.3.)

Fundamentals of Differential Equations


The calculus problems weve reviewed have mostly been involved with finding the numerical value of one magnitude or another. For example, weve sought the location x0 and value f(x0) of the maxima of a function, the locations x where f(x)=0 (roots of f(x)), the slope (derivative) of f(x) at x, or the value of a definite integral

f ( x )dx .

But now we are going to solve engineering and science problems where the unknown is itself a function, that is, we are going to develop and solve models that express the dependence of certain variables on others (Petrovskii, 1956). What kind of questions can these models answer? Here are some examples from hydrology. How will drawdown in an aquifer change with distance from a pumping well? How will the discharge from a lake, flowing over a weir, vary in time? How does the velocity profile in the atmospheric boundary layer vary with distance above the ground surface? How does moisture content vary with depth? In these cases the dependent (unknown) variables are, respectfully, drawdown [L]1, discharge [L3], velocity [L/t], and moisture content [L3/ L3/]=[-]. The respective independent (known) variables are distance [L], time [t], elevation [L], and depth [L]. The problem of finding these functions is most often addressed by solving differential equations, that is, equations in which not only the unknown function(s) occurs, but also its derivatives of various orders. Examples: 1.

dh + h = h0 + P dt

Q ' d 2 1 1 2. = 0 w 2 dx T
3. C C 2C +v D 2 =0 t x x

In the first example the unknown is denoted by the letter h, which represents the water level in a lake, and the independent variable by the letter t, which represents time. As there is one independent variable, it is an ordinary differential equation (ODE). As there is only one first order derivative it
1

The notation [L] for length and its like (e.g., [M] for mass or [t] for time) is used to indicate units or dimensions of a variable, similar to using standard units like m (meter), s (second), or kg (kilogram). So velocity units can be indicated by [L/t] or [ms-1]. Among other things we use units to keep track of dimensional homogeneity, such that units balance in all terms on each side of an equation. See next page.
- 58 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

is a first order equation (see below). The other symbols (, h0, P)2 denote parameters with no dependence on the unknown, h. Mathematically, its possible that all three vary with the independent variable, t, but in hydrologic practice only h0 and P typically vary with time. In the second example the unknown is denoted by the Greek letter , representing hydraulic head in a confined aquifer, and the independent variable by the letter x, representing location. As there is still just one independent variable, it is also an ordinary differential equation (ODE). However, as a second derivative of is the highest order derivative it is a second order equation. The symbols , 0, and Qw denote parameters that are known. In the third example the unknown is denoted by the letter C, representing solute concentration in a flowing river, and there are two independent variables, denoted by the letters x (space) and t (time). As there are now two (or more) independent variables, it is a partial differential equation (PDE). The highest order derivative in x defines it as a second order equation in space, while the highest order derivative in t defines it as a first order equation in time. (Later well see that this particular type of PDE is called mixed hyperbolic-parabolic PDE.) The symbols v and D denote parameters, the mean river velocity and a dispersion coefficient. In each equation the left side contains the unknown and its derivatives, while the right side contains known loadings or forcings. For example, in the first equation the forcing is precipitation, P [L/t]. In the second equation it is pumping Qw [L/t] and head in a vertically adjacent aquifer, 0 [L]. There is no forcing in the third equation (later well see that forcing for that equation comes from the boundary and initial conditions instead). We often rewrite different equations so that they fit this template: unknowns and their derivatives on the left, forcings on the right. As we shall see below, mathematicians take this convention a step further. In short, the first equation is a first order ODE, the second equation is a second order ODE, and the third equation is a second order in space first order in time PDE. In this section we concentration only on problems with one independent variable, that is, on ODEs. Dimensional homogeneity Each of these DEs is (and must be) dimensionally homogeneous. We can take advantage of this to help detect errors and to improve solutions. For example, the second equation is Q ' d 2 1 1 = 0 w 2 dx T Here head and distance x have units of length [L], parameter [L2] includes (=TB/K) the influence of aquifer transmissivity (T [L2/t]) and aquitard leakance (B/K [Lt/L]), where B is aquitard thickness [L] and K is aquitard vertical conductivity[L/t], and Qw [L/t] is pumping per unit area. All terms in the second equation have units of [1/L]. Order of equation (text, 1.1) An ordinary differential equation of order n, in one unknown function y, is a relation of the form F [ x, y ( x ), y ' ( x ), y ' ' ( x ),...., y n ( x )] = 0 Between the (one) independent variable x and the quantitites
2

The physical meaning of parameters like these will become known to you later.
- 59 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

y ( x ), y ' ( x ), y ' ' ( x ),...., y n ( x )


The order of the ODE is the order to the highest derivatve of the unknown function appearing in the differential equation. Well focus on 1st and 2nd order ODEs, respectively Chaps 1 and 2 of the textbook. In our applications, time is usually the independent variable in 1st order ODEs, while it is almost always space in 2nd order ODEs. The major exception to these observations is in geophysics, involving seismic, electromagnetic, and other signals, where 2nd order ODEs in time are also encountered. Operator We can write an equation in the form of an operator L( ), where

L(unknown)= forcing or
In the examples above, the operators are: 1. L( ) =

L( )= forcing.

d( ) + ( ) dt d 2( ) 1 () dx 2

2. L( ) =

( ) ( ) 2 ( ) +v D 3. L( ) = t x x 2 An operator can be an algebraic, differential or integral operator. Our examples only demonstrate differential operators.
Linear dependence There are tremendous advantages of a linear model in deriving and applying solutions. For example, if we have a linear model, then we can scale or convolute the model result to represent a new forcing, that is, a new solution, without having to resolve the equation. If we have a linear model we can use certain solution methods that take advantage of linearity, such as LaPlace or Fourier transform methods. Even if the model is nonlinear, if the nonlinearity is mild we might be able to linearize (approximate) the model and still take advantage of linearity.

On the other hand there are certain problems that have a sufficient non-linearity that it must be addressed directly. Consider chaotic behavior, as in climate models, which is the result of one kind of non-linearity that cannot be ignored. In vadose zone hydrology the multiphase flow equations are highly non-linear. The land-surface energy balance involves highly non-linear radiation terms. Taking advantage of the operator notation, there are three conditions necessary for an operator (and its differential equation) to be linear. Letting x and y represent unknowns, and a and b constants, these are (a) L( ax ) = aL( x )

- 60 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

(b) L( x + y ) = L( x ) + L( y ) (c) L( ax + by ) = aL( x ) + bL( y ) As you can see the last condition covers the other two. Lets take a look at two algebraic examples. Example a: bx+c =0 has the operator L( ) = b( ), so that L(x)=-c. Show that L meets the requirements for a linear operator. Example b: ax2+ bx+c =0 has the operator L( ) = a( )2 + b( ), so that L(x)=-c. Show that L does not meets the requirements for a linear operator. That is, this is a non-linear algebraic equation. Aside: if b=0, show that the operator remains non-linear in x, but that a transform of variables to z=x2 leads to a new problem az+c =0 which is linear in z. We often look for such simple transformations to (exactly) linearize a problem (such transformations are common in vadose zone hydrology and infiltration models used for hillslope or watershed hydrology, and for simple models of phreatic aquifers through the so-called linearized Dupuit Approximation). Now, lets examine operators for differential equations. dh d( ) + h = h0 + P has the operator L( ) = + ( ) . If is a constant, is this Example c: dt dt operator linear? dh d( ) + h1 / 2 = P has the operator L( ) = + ( )1 / 2 . If is a constant, is this dt dt operator linear? Example c:

Example e: What conditions on v and D are needed for L( ) = linear operator?

( ) ( ) 2 ( ) +v D to be a t x x 2

Hint: regarding linearity, look to see if the unknown is of the same form (order of magnitude; power) in each term; but formally you need to apply rule (c) above.
Concept of a solution (text, 1.1) F [ x, y ( x ), y ' ( x )] = 0 Given the first order ode

(4)

a function

y = h( x )

is called a solution to (4) on some open interval a < x < b (including a,b = -,+ ) if
- 61 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

h(x) is defined and differentiable throughout the interval, and if the equation becomes an identity if y and y are replaced with h and h, respectively.

The curve (graph) of h(x) is called a solution curve.


Verify a solution. Always test a solution by substituting it into the original ode and solving. Solution curves. (text, 1.1)

The family of solutions is called the general solution (see next page). Each of these many solutions is equally valid. How do we choose a single one of these solutions from within the family? Such a single solution is called the particular solution. We need some additional information. In this example of a 1st order equation, we need just need one value of the solution y(x0) at some location within the domain, x0, to find the particular solution. In fact, we almost always pick a location on the end(s) of the domain. For 1st order ODEs this is the initial location, x0, and the value y(x0) is the initial value of the solution. In the example to the right, the selected solution is the one shown in the highlighted line, with a particular value, y(x0) = y() = -2, used to select the particular (highlighted) solution.

y(x0) = y() = -2

1st Order ODEs


(Textbook, Chap. 1)
Exponential growth, exponential decay (text, 1.1)

- 62 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

General solution: arbitrary constant c and the family of solution curves as in Figures 2 & 3. Particular solution: a particular value of c and a particular curve, e.g., one of the curves in Figures 2 & 3.

Introduction to initial value problems (text, 1.1)


Generally, a particular solution to a first order problem is obtained by specifying an initial condition (IC), y(x0) = y0, a known value of y at x=x0. We then seek the solution, y, for x>x0. That is, we use the IC to determine the particular solution. This type of problem is called an initial value problem. .
y ' = f ( x, y ), y( x0 ) = y0

(5)

which includes the ODE (left) and IC (right). Since we are solving a first order equation we need only one IC. Later, well see that a second order ODE requires two ICs for an initial value problem.
Geometric Meaning of y=f(x,y) (text, 1.2) A first order ODE y ' = f ( x, y )

(1)

has a simple geometric interpretation. A solution curve of (1) that pass through a point (x0,y0) must have at that point the slope y ' ( x0 ) equal to the value of f at that point; that is,
y' ( x0 ) = f ( x0 , y 0 )

You can indicate the direction of solution curves of (1) by drawing short straight-line segments (lineal elements) in the xy-plane (see figure) and then fitting approximate solution curves through the resulting direction field.
- 63 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Isoclines of y= f(x,y) = xy = k= const., along which the slope is constant.

(a) By Matlab, or by a CAS = computer algebra system, like Maple,

Why do this, especially since it is of limited accuracy? 1. You dont have to solve (1), which is especially convenient when the solution to (1) is challenging. 2. You see in graphical form the entire family of solutions and their propertieses.

- 64 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Separable ODEs (previously mentioned in our calculus review on pp. 35-37 of these notes)

This method of solution is called the method of separation of variables and (1) is called a separable equation: x appears only on the right and y appears only on the left. Example: The ODE y-1=y2 is separable because it can be written as dy = dx 1 + y2 By integration the solution is arctan y = x + c or
y = tan( x + c )

- 65 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Modeling

- 66 -

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

All of these examples have hydrologic relevance. As you can see from them, many hydrologic problems have an exponential response to some IC, either decay or growth.

Keep in mind, for this and all homologous 1st order problems: Rate constant = 0.693 x half-life k =0.693 x H

67

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Most of these problems are forward problems. Given the ODE, IC, and parameter values, how does the unknown vary with the independent variable? Step 4 is an example of an inverse, or parameter estimation, problem. Given the ODE, IC, and observatioions of the dependent variable, what is an estimate for one or more parameters

Bordas coefficient of contraction, Cc=0.60, so that A=CcD2/4.


68

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

What kind of ode is this? Order, linearity, other

How does the velocity, v, and discharge, vA, vary with time?

69

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Reduction to Separable Form

Exact ODEs. Integrating Factors


Basics of Exact ODEs

70

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

The function u needs to satisfy (4a,b)


u =M x u =N y

The necessary and sufficient condition for exactness is (see text, p. 20)

We can equally apply (4b) to get the following. If (6) doesnt work, then try (7). (7) (See text, page 23, for example.)
u = Ndy + l ( x ) )

71

New Mexico Tech Hydrology Program

Hyd 510 Quantitative Methods in Hydrology

Reduction to Exact Form. Integrating Factors

We multiply a given nonexact equation

by a function F that, in general, will be a function of both x and y. We want the result to be an exact equation

so we can solve it as just discussed. Such a function F(x, y) is then called an integrating factor of (12). (See text, p. 24 , for example.)
How to Find Integrating Factors

72

You might also like