---
title: "Program for normal depth in trapezoidal channel"
subject: "Hydraulics"
chapter: 6
key: "semester_4/hydraulics:algorithm-normal-depth-trapezoidal"
source: https://www.bctengineer.com/q/semester_4/hydraulics/algorithm-normal-depth-trapezoidal
site: BCT Engineering
---

# Program for normal depth in trapezoidal channel

Hydraulics · Chapter 6: Uniform flow in open channel

- Asked in: 2076 Baisakh, 8 marks
- Video: [Find Normal Depth In Open Channel: Newton-Raphson & Excel Solver Methods for All Channel Shapes](https://www.youtube.com/watch?v=F1Z_5P2JmTk) —  Give Value for Water 
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/hydraulics/algorithm-normal-depth-trapezoidal
- Whole chapter: https://www.bctengineer.com/md/semester_4/hydraulics/chapter-6

## Question

Write an algorithm, flow chart and computer program in any high level language to determine normal depth in a trapezoidal channel.

## Short answer

Use bisection on f(y)=AR^{2/3} - nQ/√S₀ =0, with A=(b+zy)y, P=b+2y√(1+z²). Set lo=0.0001, hi=1; while f(hi)<0, hi*=2. Repeat mid=(lo+hi)/2: if f(mid)>0, hi=mid else lo=mid, until hi-lo<1e-6. Output mid as normal depth.

## Answer

The normal depth $y_n$ satisfies Manning's equation, which cannot be solved directly for $y$. It is found numerically by the bisection method on
$$
f(y)=AR^{2/3}-\frac{nQ}{\sqrt{S_0}}=0,\qquad A=(b+zy)y,\quad P=b+2y\sqrt{1+z^2},\quad R=\frac AP
$$
$f(y)$ increases with $y$, so the root is unique.

#### Algorithm
1. Read $b$, $z$, $n$, $Q$, $S_0$.
2. Compute the target value $K_0=nQ/\sqrt{S_0}$.
3. Set lower limit $y_{lo}=0.0001$ and upper limit $y_{hi}=1$; while $f(y_{hi})<0$, double $y_{hi}$.
4. Repeat: $y_{mid}=(y_{lo}+y_{hi})/2$. If $f(y_{mid})>0$ set $y_{hi}=y_{mid}$, else $y_{lo}=y_{mid}$.
5. Stop when $y_{hi}-y_{lo}<10^{-6}$ (or 100 iterations).
6. Print $y_n=(y_{lo}+y_{hi})/2$.

#### Flow chart
```text
        [Start]
           |
   [Read b,z,n,Q,S0]
           |
   [ylo=0.0001, yhi=1]
           |
     /-----------\ yes
   < f(yhi) < 0 ? >-----> [yhi = 2*yhi] --+
     \-----------/                         |
           | no  <-------------------------+
           v
   [ymid = (ylo+yhi)/2]<---------+
           |                     |
     /-----------\ yes           |
   < f(ymid) > 0 >--> [yhi=ymid] |
     \-----------/               |
           | no                  |
      [ylo=ymid]                 |
           |                     |
     /---------------\ no        |
   < yhi-ylo < 1e-6 ? >----------+
     \---------------/
           | yes
   [Print yn = (ylo+yhi)/2]
           |
        [Stop]
```

#### C program
```c
#include <stdio.h>
#include <math.h>

/* f(y) = A*R^(2/3) - n*Q/sqrt(S): zero at the normal depth */
double f(double y, double b, double z, double n, double Q, double S)
{
    double A = (b + z * y) * y;                 /* flow area        */
    double P = b + 2.0 * y * sqrt(1.0 + z * z); /* wetted perimeter */
    double R = A / P;                           /* hydraulic radius */
    return A * pow(R, 2.0 / 3.0) - n * Q / sqrt(S);
}

int main(void)
{
    double b, z, n, Q, S, lo, hi, mid;
    int i;

    printf("Enter b (m), z (H:1V), n, Q (m3/s), S0: ");
    scanf("%lf %lf %lf %lf %lf", &b, &z, &n, &Q, &S);

    lo = 0.0001;
    hi = 1.0;
    while (f(hi, b, z, n, Q, S) < 0.0)   /* bracket the root */
        hi *= 2.0;

    for (i = 0; i < 100; i++) {          /* bisection */
        mid = 0.5 * (lo + hi);
        if (f(mid, b, z, n, Q, S) > 0.0)
            hi = mid;
        else
            lo = mid;
        if (hi - lo < 1e-6)
            break;
    }
    printf("Normal depth yn = %.4f m\n", 0.5 * (lo + hi));
    return 0;
}
```

#### Sample run
Input: `b = 5, z = 1.5, n = 0.015, Q = 20, S0 = 0.0004`

Output: `Normal depth yn = 1.7563 m`

(The result was checked independently: $A=13.409$ m², $R=1.183$ m, $AR^{2/3}=15.000$ and $nQ/\sqrt{S_0}=15.000$.)

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is the normal depth found numerically?
   A. Manning's equation cannot be solved directly for y in a trapezoid
   B. Depth is not defined in a trapezoid
   C. Manning's equation is invalid
   D. Q is unknown
   Answer: A. A and R depend on y in a way that cannot be rearranged for y. (Key point: Why numerical)

2. What function is set to zero in the bisection?
   A. f(y) = A R^(2/3) - nQ/sqrt(S0)
   B. f(y) = A - Q
   C. f(y) = R - y/2
   D. f(y) = Fr - 1
   Answer: A. Manning's equation rearranged gives A R^(2/3) = nQ/sqrt(S0). (Key point: Function)

3. If f(ymid) > 0, what is done?
   A. Set ylo = ymid
   B. Stop
   C. Set yhi = ymid
   D. Double yhi
   Answer: C. f increases with y, so f > 0 means ymid is too large and the root lies below it. (Key point: Bisection step)

4. What is the purpose of doubling yhi while f(yhi) < 0?
   A. To reduce iterations
   B. To make sure the root lies between ylo and yhi
   C. To compute critical depth
   D. To avoid division by zero
   Answer: B. A negative f at yhi means the root is above it, so the upper limit is raised until it brackets the root. (Key point: Bracketing)

## Related in Hydraulics

- [Program for critical depth in trapezoidal channel](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Aalgorithm-critical-depth-trapezoidal) — Hydraulics, chapter 7
- [Normal depth in compound channel](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Acompound-channel-normal-depth-berms) — Hydraulics, chapter 6
- [Program for uniform depth in rectangular channel](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Aalgorithm-uniform-depth-rectangular) — Hydraulics, chapter 6
- [Program for alternate depths in rectangular channel](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Aalgorithm-alternate-depths-rectangular) — Hydraulics, chapter 7
- [Bed slope for critical normal depth](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Abed-slope-for-critical-flow-at-normal-depth) — Hydraulics, chapter 7
- [Distance to within 5% of normal depth](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Awide-channel-5m3s-depth-3-5m-5-percent-normal) — Hydraulics, chapter 8

## Related in other subjects

- [Efficient trapezoidal section and triangular channel depth](https://www.bctengineer.com/question.md?key=semester_6%2Fhydro_power%3Atriangular-channel-normal-depth-trap) — Hydro Power, chapter 1, asked 2×
- [High level languages and natural language](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Ahll-similar-natural-language) — Computer Programming, chapter 1
- [Normal depth in triangular channel (1:1)](https://www.bctengineer.com/question.md?key=semester_6%2Fhydro_power%3Atriangular-channel-normal-depth-0-0004) — Hydro Power, chapter 1, asked 2×
- [Remez exchange algorithm with flow chart](https://www.bctengineer.com/question.md?key=semester_7%2Fdigital_signal_analysis_and_processing%3Aremez-flowchart-explain) — Digital Signal Analysis and Processing, chapter 5, asked 4×
