Chapter 4 Differential Equations

MEE3017 Computer Modeling Techniques in Engineering Chapter 4 Differential Equations 4.1 Ordinary Differential Equations (ODE) The subject of ODE i...
Author: Angel Weaver
5 downloads 1 Views 417KB Size
MEE3017 Computer Modeling Techniques in Engineering

Chapter 4 Differential Equations 4.1

Ordinary Differential Equations (ODE)

The subject of ODE is an essential tool for modeling many physical situation: springmass systems, resistor-capacitor-inductance circuits, bending of beams, chemical reactions, pendulums, the motion of a rotating mass around another body, and so forth. These equations have also demonstrated their usefulness in ecology and economics. The predator-prey problem has become a classic example of differential equations. The prominence of ODE in applied mathematics is due to the fact that most scientific laws are more readily expressed in terms of rates of change. For example,

du = −0.27(u − 60) 5 / 4 dt is an equation describing (approximately) the rate of change of temperature u of a body losing heat by natural convection with constant-temperature surroundings. This is termed a first-order differential equation because the highest-order derivative is the first. If the equation contains derivatives of nth order, it is said to be an nth-order differential equation. For example, a second-order equation describing the oscillation of a weight acted upon by a spring, with resistance to motion proportional to the square of the velocity, might be 2

d 2x  dx  + 4  + 0.6 x = 0 2 dt  dt  where x is the displacement and t is time. The solution to a differential equation is the function that satisfies the differential equation and that also satisfies certain initial conditions on the function. Our procedure will be to explore several methods of solving first-order equations, and then to show how these same methods can be applied to systems of simultaneous firstorder equations and to higher-order differential equations. We will use for our typical first-order equation the form dx = f ( x, y ), dt y ( x0 ) = y 0

We develop the relation between y and x by finding the coefficients of the Taylor series in which we expand y about the point x=x0: 1

MEE3017 Computer Modeling Techniques in Engineering

y ' ' ' ( x0 ) y ' ' ( x) ( x − x 0 ) 3 + L. ( x − x0 ) 2 + 3! 2! If we let x-x0=h, we can write the series as y ( x) = y ( x0 ) + y ' ( x0 )( x − x 0 ) +

y ( x) = y ( x0 ) + y ' ( x0 )h +

y ' ' ( x) 2 y ' ' ' ( x0 ) 3 h + h + L. 2 6

4.1.1 Euler and Modified Euler Methods

We know that the error in a Taylor series will be small if the step size h is small. In act, if we make h small enough, we may only need a few terms of the Taylor-series expansion for good accuracy. The Euler method follows this idea to the extreme for first-order differential equations – it uses only the first two terms of the Taylor series! Suppose that we have chosen h small enough that we may truncate after the first-derivative term. Then y ' ' ( ξ) h 2 y ( x 0 + h) = y ( x 0 ) + y ' ( x 0 ) + , 2

x0 < ξ < x0 + h,

where we have written the usual form of the error term for the truncated Taylor series. 4.1.2 The Runge-Kutta Methods

Two German mathematicians, Runge and Kutta, developed algorithms that solve a differential equation efficiently and yet are the equivalent of approximating the exact solution by matching the first n terms of the Taylor-series expansion. To impart some idea of how the Runge-Kutta methods are developed, we will show the derivation of a simple second-order method. Here, the increment to the y is a weighted average of two estimates of the increment which we call k1 and k2. Thus for the equation dy/dx = f(x,y), y n +1 = y n + ak1 + bk 2 , k1 = hf ( x n , y n ), k 2 = hf ( x n + αh, y n + βk1 ) 4.2

Partial Differential Equations

Many problems in applied science, physics, and engineering are modeled mathematically with partial differential equations. A differential equation involving more than one independent variable is called a Partial Differential Equation (PDE). It is not necessary to have taken a specialized course in PDEs to understand the rudimentary principles involved in obtaining computer solutions. 2

MEE3017 Computer Modeling Techniques in Engineering

The Standard Form

The standard form of a second-order, linear, partial differential equation in two independent variables is Au xx + Bu xy + Cu yy = f ( x, y, u, u x , u y ), or A

∂ 2u ∂ 2u ∂ 2u ∂u ∂u + B + C = F ( x, y , u , , ) 2 2 2 ∂x∂y ∂x ∂y ∂x ∂y

where u(x,y) is the dependent variable, and F(x,y,u, ∂u/∂x,∂u/∂y) is an arbitrary function of x and y, and linear in u and its first derivatives. A,B and C are constants, is called quasilinear. There are three types of quasilinear equations: If B 2 − 4 AC < 0, the equation is called elliptic. If B 2 − 4 AC = 0, the equation is called parabolic. If B 2 − 4 AC > 0, the equation is called hyperbolic. A few common examples are given in the following table:

3

MEE3017 Computer Modeling Techniques in Engineering

Boundary Conditions Dirichlet

The values of only the function, u, are given on a boundary.

Neumann

The values of only the normal derivatives of the function are given on a boundary.

Cauch

The values of both the function and its normal derivative are specified on the same boundary.

Classifications of PDEs Poisson’s Equation – Elliptic Poisson’s equation can be used to determine the equilibrium values of the static electric potential. The natural conditions would be to specify the function or its derivative (the electric field); i.e., Dirichlet or Neumann conditions, on a surrounding boundary and then to determine the potential everywhere in the interior. The Diffusion Equation – Parabolic The diffusion or heat flow equation can be used to determine the temperature distribution in a metal bar as a function of position and time. The natural conditions would be to specify the temperature everywhere in the bar at time t=0, and use the differential equation to determine the temperature at later times by stepping along the time axis. The Wave Equation – Hyperbolic If a string is tightly connected between two horizontally separated points, ignoring gravity, the transverse or vertical displacement of the string is a function of position along the string, x, and time, t; i.e., y(x,t). This function is then obtained by solving the wave equation. The appropriate boundary conditions for such a problem would be to fix the ends (y(0,t)=0, y(L,t)=0) and to specify the initial displacement of the string.

4

MEE3017 Computer Modeling Techniques in Engineering

The methods are either of an initial value type, requiring stepping methods for a solution, or of a boundary value type, requiring iterative techniques. For numerical work, this distinction is more important than is the classification of elliptic, parabolic, or hyperbolic. These results are summarised in the following chart:

5