Water Engineering  ·  Level 6
Calculus And Differential Methods
Chapter 3: Solve Ordinary differential equations
📚 4 Topics
⚑ What you will be able to do

By the end of this chapter, you will be able to:

  • confidently solve first order differential equations using the method of undetermined coefficients
  • accurately solve second order differential equations using the method of undetermined coefficients
  • correctly apply specific boundary conditions to solve first order differential equations
  • precisely solve second order differential equations with given boundary conditions

Mastering these skills will help you tackle real-world problems in engineering and technology with confidence and accuracy.

Water engineering professionals frequently encounter dynamic systems where flow rates, pressures, and contaminant concentrations change over time or space. Understanding how to model and solve these changes accurately is essential for designing and managing water supply, treatment, and distribution systems. This chapter focuses on solving ordinary differential equations (ODEs), which describe such dynamic processes in water engineering, using methods tailored to first and second order equations. Mastery of these techniques enables engineers to predict system behavior and optimize performance in real-world Kenyan water projects.

3.1 First order differential equations

First order differential equations arise in water engineering when modeling processes such as the rate of change of contaminant concentration in a reservoir, flow velocity changes, or water volume in tanks over time. These equations involve the first derivative of the unknown function and are fundamental for transient analysis. The method of undetermined coefficients provides a systematic approach to solving linear first order ODEs with constant coefficients and specific forcing functions common in engineering contexts.

3.1.1 Method of undetermined coefficient

The method of undetermined coefficients solves linear first order differential equations with constant coefficients and forcing functions that are polynomials, exponentials, sines, cosines, or combinations thereof. The general form is:

$$ \frac{dy}{dx} + py = g(x) $$

where \(p\) is a constant and \(g(x)\) is a known function. The solution is the sum of the complementary function (CF) and a particular integral (PI). The CF solves the homogeneous equation (\(dy/dx + py = 0\)), and the PI is guessed based on the form of \(g(x)\) with unknown coefficients determined by substitution.

Worked Examples

Example 1: Flow rate change in a water tank.

Given: The flow rate \(Q(t)\) satisfies

$$ \frac{dQ}{dt} + 3Q = 6 $$

Find \(Q(t)\).

Step 1: Complementary function solves

$$ \frac{dQ}{dt} + 3Q = 0 $$

Step 2: Solve homogeneous equation:

$$ \frac{dQ}{dt} = -3Q $$

Separate variables:

$$ \frac{dQ}{Q} = -3 dt $$

Integrate:

$$ \ln|Q| = -3t + C $$

Exponentiate:

$$ Q_c = Ce^{-3t} $$

Step 3: Guess particular integral \(Q_p = A\) (constant), substitute into original:

$$ 0 + 3A = 6 \implies A = 2 $$

Step 4: General solution:

$$ Q(t) = Ce^{-3t} + 2 $$

Answer: \(Q(t) = Ce^{-3t} + 2\) (units as per \(Q\), e.g., m³/s)


Example 2: Contaminant concentration with exponential input.

Given:

$$ \frac{dy}{dx} + 2y = e^{3x} $$

Find \(y(x)\).

Step 1: CF solves

$$ \frac{dy}{dx} + 2y = 0 $$

Step 2: Solve homogeneous:

$$ \frac{dy}{dx} = -2y $$

Integrate:

$$ \ln|y| = -2x + C $$

$$ y_c = Ce^{-2x} $$

Step 3: Guess PI \(y_p = Ae^{3x}\), substitute:

$$ \frac{d}{dx}(Ae^{3x}) + 2Ae^{3x} = e^{3x} $$

$$ 3Ae^{3x} + 2Ae^{3x} = e^{3x} $$

$$ 5Ae^{3x} = e^{3x} \implies A = \frac{1}{5} $$

Step 4: General solution:

$$ y = Ce^{-2x} + \frac{1}{5} e^{3x} $$

Answer: \(y = Ce^{-2x} + \frac{1}{5} e^{3x}\)


Example 3: Flow velocity with sinusoidal forcing

Given:

$$ \frac{dv}{dt} + 4v = \sin 2t $$

Find \(v(t)\).

Step 1: CF solves

$$ \frac{dv}{dt} + 4v = 0 $$

Step 2: Solve homogeneous:

$$ v_c = Ce^{-4t} $$

Step 3: Guess PI:

Since RHS is \(\sin 2t\), try

$$ v_p = A \cos 2t + B \sin 2t $$

Step 4: Differentiate:

$$ \frac{dv_p}{dt} = -2A \sin 2t + 2B \cos 2t $$

Step 5: Substitute into original:

$$ (-2A \sin 2t + 2B \cos 2t) + 4 (A \cos 2t + B \sin 2t) = \sin 2t $$

Group terms:

$$ (2B + 4A) \cos 2t + (-2A + 4B) \sin 2t = \sin 2t $$

Step 6: Equate coefficients:

For \(\cos 2t\):

$$ 2B + 4A = 0 $$

For \(\sin 2t\):

$$ -2A + 4B = 1 $$

Step 7: Solve system:

From first:

$$ 2B = -4A \implies B = -2A $$

Substitute into second:

$$ -2A + 4(-2A) = 1 $$

$$ -2A - 8A = 1 \implies -10A = 1 \implies A = -\frac{1}{10} $$

Then:

$$ B = -2 \times (-\frac{1}{10}) = \frac{1}{5} $$

Step 8: PI:

$$ v_p = -\frac{1}{10} \cos 2t + \frac{1}{5} \sin 2t $$

Step 9: General solution:

$$ v = Ce^{-4t} - \frac{1}{10} \cos 2t + \frac{1}{5} \sin 2t $$

Answer: \(v = Ce^{-4t} - \frac{1}{10} \cos 2t + \frac{1}{5} \sin 2t\)


Example 4: Pump discharge with polynomial forcing

Given:

$$ \frac{dQ}{dt} + 5Q = t^2 $$

Find \(Q(t)\).

Step 1: CF solves

$$ \frac{dQ}{dt} + 5Q = 0 $$

Step 2: CF:

$$ Q_c = Ce^{-5t} $$

Step 3: Guess PI:

Since RHS is polynomial \(t^2\), try

$$ Q_p = At^2 + Bt + C $$

Step 4: Differentiate:

$$ \frac{dQ_p}{dt} = 2At + B $$

Step 5: Substitute:

$$ (2At + B) + 5(At^2 + Bt + C) = t^2 $$

Expand:

$$ 2At + B + 5At^2 + 5Bt + 5C = t^2 $$

Group terms:

$$ 5A t^2 + (2A + 5B) t + (B + 5C) = t^2 + 0 t + 0 $$

Step 6: Equate coefficients:

$$ 5A = 1 \implies A = \frac{1}{5} $$

$$ 2A + 5B = 0 \implies 2 \times \frac{1}{5} + 5B = 0 \implies \frac{2}{5} + 5B = 0 \implies B = -\frac{2}{25} $$

$$ B + 5C = 0 \implies -\frac{2}{25} + 5C = 0 \implies C = \frac{2}{125} $$

Step 7: PI:

$$ Q_p = \frac{1}{5} t^2 - \frac{2}{25} t + \frac{2}{125} $$

Step 8: General solution:

$$ Q = Ce^{-5t} + \frac{1}{5} t^2 - \frac{2}{25} t + \frac{2}{125} $$

Answer: \(Q = Ce^{-5t} + \frac{1}{5} t^2 - \frac{2}{25} t + \frac{2}{125}\)


Example 5: Reservoir water level with exponential decay input

Given:

$$ \frac{dh}{dt} + 0.1 h = 5 e^{-0.2 t} $$

Find \(h(t)\).

Step 1: CF:

$$ h_c = Ce^{-0.1 t} $$

Step 2: Guess PI:

Try

$$ h_p = Ae^{-0.2 t} $$

Step 3: Differentiate:

$$ \frac{dh_p}{dt} = -0.2 A e^{-0.2 t} $$

Step 4: Substitute:

$$ -0.2 A e^{-0.2 t} + 0.1 A e^{-0.2 t} = 5 e^{-0.2 t} $$

Simplify:

$$ (-0.2 A + 0.1 A) e^{-0.2 t} = 5 e^{-0.2 t} $$

$$ -0.1 A = 5 \implies A = -50 $$

Step 5: General solution:

$$ h = Ce^{-0.1 t} - 50 e^{-0.2 t} $$

Answer: \(h = Ce^{-0.1 t} - 50 e^{-0.2 t}\)

Practice Questions

  1. Solve \( \frac{dy}{dx} + 4y = 8 \) for \(y(x)\). (5 marks)
  2. Find the general solution of \( \frac{dv}{dt} + 3v = e^{2t} \). (6 marks)
  3. Determine \(Q(t)\) if \( \frac{dQ}{dt} + 6Q = \cos 3t \). (8 marks)
  4. Solve \( \frac{dh}{dt} + 0.5 h = t \) for \(h(t)\). (7 marks)
  5. Find the solution to \( \frac{dy}{dx} + 2y = 3x^2 \). (8 marks)
The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒3.2 Second order differential equations

Second order differential equations describe many water engineering phenomena involving acceleration, oscillation, or dynamic response such as water hammer effects, oscillations in pumping systems, or sediment transport dynamics. These equations involve the se…

🔒3.3 First order differential equations

First order differential equations are fundamental in modelling dynamic processes in water engineering such as flow rate changes, contaminant concentration variations, and reservoir level fluctuations. These equations relate a function and its first derivative…

🔒3.4 Second order differential equations

Second order differential equations frequently model dynamic systems with acceleration or curvature, such as water hammer effects in pipelines, oscillations in reservoir levels, and sediment transport dynamics. These equations involve the second derivative of…

Chapter Summary

This chapter covered solving ordinary differential equations, beginning with first order differential equations and the method of undetermined coefficients to find particular solutions. It then progressed to second order differential equations, emphasizing the method of undetermined coefficients for solving non-homogeneous cases. Further exploration of first order differential equations included additional solution techniques and applications relevant to engineering contexts. The study of second order differential equations continued, focusing on more complex forms and solution strategies. Throughout the chapter, emphasis was placed on understanding the structure of differential equations and applying systematic methods to obtain explicit solutions. The methods presented are foundational for modelling and solving real-world problems in civil engineering and other technical fields. Mastery of these techniques enables accurate analysis of dynamic systems and processes described by ordinary differential equations.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

Written Assessment

  1. Solve the first order differential equation for flow rate \(Q\) in a pipe where \(\frac{dQ}{dt} + 3Q = 12\), given that \(Q=0\) at \(t=0\). (2 marks)

  2. A water tank empties at a rate proportional to its volume \(V\). If \(\frac{dV}{dt} = -0.5V\) and the initial volume is 2000 litres, find the volume after 4 hours. (2 marks)

🔒18 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. A water tank leaks at a rate proportional to the volume of water remaining. If the initial volume is 5000 litres and the leakage rate constant is 0.02 per hour, find the volume of water after 5 hours using the first order differential equation method. (4 marks)
  2. Solve the differential equation \(\frac{dy}{dx} + 3y = 6\) given \(y(0) = 2\), which models the concentration of a pollutant in a water reservoir. (4 marks)
🔒20 more in this section.
Flashcards 21 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

19 more in this section.

Create a free account
Test Yourself 14 questions Start quiz ▾
0%
0 / 2
🔒

12 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • confidently solve first order differential equations using the method of undetermined coefficients
  • accurately solve second order differential equations using the method of undetermined coefficients
  • correctly apply specific boundary conditions to solve first order differential equations
  • precisely solve second order differential equations with given boundary conditions

Tick each one you can genuinely do.

So, are you there yet?

You're competent when you can confidently do 50% or more of what this chapter promised.

Sign in to record how you're doing.