Energy-Optimal Wireless Transmission by Water Filling¶
Background¶
A transmitter with a hard deadline should avoid spending equal power at every instant when channel quality changes predictably. More data can be sent per joule during favorable channel conditions, but the complete payload must still arrive before the deadline and transmit power is bounded.
This example represents a receiver passing an access point: channel quality improves, reaches a peak, and then fades. The optimal-control result is checked against the classical water-filling allocation computed independently with a scalar root solve.
Problem formulation¶
Let \(q(t)\) be the remaining data and \(P(t)\) transmit power. The received SNR per watt is prescribed as
Using a Shannon-rate model with bandwidth \(B=1\) MHz gives
The remaining-data dynamics are
For a payload \(D=18\) Mbit and deadline \(T=10\) s, the endpoint conditions are
The objective and path constraints are
Variables, parameters, and units¶
| Symbol | Meaning | Value or unit |
|---|---|---|
| \(t\) | Time | s |
| \(q\) | Data remaining before the deadline | Mbit |
| \(P\) | Transmit power | W |
| \(g\) | Received SNR per watt | W⁻¹ |
| \(R\) | Information rate | Mbit/s |
| \(B\) | Channel bandwidth | \(1\) MHz |
| \(D\) | Required payload | \(18\) Mbit |
| \(T\) | Transmission deadline | \(10\) s |
| \(P_{\max}\) | Power limit | \(5\) W |
| \(E\) | Transmit energy | J |
Clipped water-filling reference¶
The terminal condition is equivalent to the integral payload constraint
Applying the KKT stationarity condition to energy minimization gives the unconstrained positive-power relation
where \(\nu\) is a constant water level. Including both power bounds gives
The reference calculation uses Brent's method to choose \(\nu\) so that the dense-grid payload integral equals 18 Mbit. It does not use the Pockit trajectory, so agreement is an independent optimality check rather than a restatement of the collocation constraints.
Modeling choices¶
Remaining data is a state, making the delivery deadline an explicit terminal condition. The queue bounds also rule out sending more than the payload and then compensating mathematically. A \(100\times2\) Lobatto mesh uses piecewise- linear interpolation, which preserves the nonnegative queue and power bounds between nodes.
The deterministic channel profile is known over the entire horizon. This is an offline scheduling assumption; it is stronger than causal channel-state information available in many communication systems.
Independent validation¶
At 4,001 times, the script reconstructs \(q\) and \(P\), computes rate, and forms cumulative delivered data by numerical quadrature. It checks the queue identity
throughout the horizon, not just at \(T\). It then constructs the clipped water-filling reference, compares the full power histories and energies, and checks all dense path bounds.
Verified result¶
| Quantity | Verified value |
|---|---|
| Transmit energy | \(16.97876379\) J |
| Delivered payload by dense quadrature | \(18.00004347\) Mbit |
| Analytical water level \(\nu\) | \(2.60489943\) W |
| Maximum water-filling power error | \(5.779\times10^{-4}\) W |
| Maximum cumulative queue-balance error | \(1.978\times10^{-3}\) Mbit |
| Maximum dense path-bound violation | \(0\) |
The schedule raises power around the channel-quality peak and uses less power when the link is poor. The independent clipped water-filling result matches the optimized power within \(0.6\) mW over the dense grid.

Scope and limitations¶
The model assumes a deterministic perfectly known channel, a Shannon capacity rate law, continuous power control, and no coding delay. It omits circuit and idle power, interference, packetization, retransmissions, latency for individual packets, discrete modulation and coding, channel-estimation error, and fading uncertainty. Those effects can materially change an implementable radio policy.
Run the example¶
Save the figure without opening a window:
system, phase = build_problem()
guess = initial_guess(phase)
solution = solve_problem(system, guess)
plot_solution(solution)
Source code¶
See the complete runnable example:
examples/wireless_data_transmission.py.