25.08.2021 Views

082-Engineering-Mathematics-Anthony-Croft-Robert-Davison-Martin-Hargreaves-James-Flint-Edisi-5-2017

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

20.5 Numerical methods 615

Combining these equations and usingEquation (20.13) toeliminateq i

andq o

gives

dh 2

= ρg ( ρg

h

dt R 1

A 1

− + ρg )

h

2

R 1

A 2

R 2

A 2

+ 1 q

2

A 2

(20.16)

2

Equations (20.14) and (20.16) are the state-space equations for the system and can

be written inmatrix formas

−ρg ρg

⎞ ⎛ ⎞

1

)

(ḣ1

R 1

A 1

R 1

A 1

( )

0

h1

A ( )

1 = ⎜

ḣ 2 ⎝ ρg

− ρg − ρg

⎟ +

q1

⎠ h ⎜ ⎟

2 ⎝ 1 ⎠

q 2

0

R 1

A 2

R 1

A 2

R 2

A 2 A 2

Note that in this case the input vector is two-dimensional as there are two inputs to

the system.The output equation isgiven by

q o

= ( ) ( )

h

0 ρg/R 1

2

h 2

and isobtained directly from Equation (20.15).

20.5 NUMERICALMETHODS

All the techniques we have so far met for solving differential equations are known as

analytical methods, and these methods give rise to a solution in terms of elementary

functionssuchassinx,e x ,x 3 ,etc.Inpractice,mostengineeringproblemsinvolvingdifferential

equations are too complicated to be solved easily using analytical techniques.

It is therefore frequently necessary to make use of computers. One such approach is to

use analogue simulation, which we discussed in Section 20.2. Another, more common,

approachistouse digital computers.

There are a variety of computer software packages available for solving differential

equations,includingMATLAB ® whichhasalreadybeenintroduced.Oftenthedetailof

howthecomputersolvestheequationishiddenfromtheuseranditusesoneofarange

of numericalmethods.Wewillexaminesomeofthemethodsthatmightbeappliedby

the computer inthissection.

Whenusingnumericalmethodsitisimportanttonotethattheyresultinapproximate

solutions to differential equations and solutions are only calculated at discrete intervals

oftheindependentvariable,typicallyxort.Weshallbeginbyexaminingthefirst-order

differential equation

dy

dx =f(x,y)

subject to the initial condition y(x 0

) = y 0

. Usually the solution is obtained at equally

spaced values of x, and we call this spacing the step size, denoted by h. By choosing

a suitable value ofhwe can control the accuracy of the approximate solution obtained.

Weshallwritey n

forthisapproximatesolutionatx =x n

,whereaswewritey(x n

)forthe

true solution atx = x n

. Generally these values will not be the same although we try to

ensure the difference issmallfor obvious reasons.

The simplest numerical method forthe solution of the differential equation

dy

dx =f(x,y)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!