Math Lane Proof — KaTeX Build-Time Rendering

Math+Mermaid lane proof page — not production content.

Hand-crafted from real chapter excerpts (see LANE-REPORT-math.md for exact source files/line ranges) to verify remark-math + rehype-katex and rehype-mermaid render correctly at build time. Delete this page, its sibling test-*.md files, and this layout once Phase 1 closes.

Source A: Mathematical Foundations for IoT — The Derivation

(content/capstone/mathematical-foundations.qmd, lines 165-231)

Free-space radio begins with transmit power PtP_t spread over area 4πd24\pi d^2:

S=PtGt4πd2S = \frac{P_tG_t}{4\pi d^2}

An antenna collects with effective aperture:

Ae=Grλ24πA_e = \frac{G_r\lambda^2}{4\pi}

So Friis is:

Pr=PtGtGr(λ4πd)2P_r = P_tG_tG_r\left(\frac{\lambda}{4\pi d}\right)^2

and free-space path loss is:

FSPL=(4πdλ)2\mathrm{FSPL} = \left(\frac{4\pi d}{\lambda}\right)^2

Because λ=c/f\lambda = c/f:

FSPLdB=20log10(d)+20log10(f)+20log10(4πc)\mathrm{FSPL}_{dB} = 20\log_{10}(d) + 20\log_{10}(f) + 20\log_{10}\left(\frac{4\pi}{c}\right)

Decibels come from power ratios:

LdB=10log10(P2P1)L_{dB} = 10\log_{10}\left(\frac{P_2}{P_1}\right)

so multiplied gains and losses become addition:

Prx,dBm=Ptx,dBm+Gtx,dB+Grx,dBLpath,dBP_{rx,dBm} = P_{tx,dBm} + G_{tx,dB} + G_{rx,dB} - L_{path,dB}

Sampling repeats a spectrum every fsf_s hertz:

Xs(f)=k=X(fkfs)X_s(f) = \sum_{k=-\infty}^{\infty}X(f-kf_s)

Non-overlap requires:

fmaxfsfmaxf_{max} \leq f_s - f_{max}

therefore:

fs2fmaxf_s \geq 2f_{max}

Quantization step size is:

q=VFS2Nq = \frac{V_{FS}}{2^N}

Uniform rounding noise has mean-square value:

e2=q212\overline{e^2} = \frac{q^2}{12}

For a full-scale sine wave:

SNRdB=10log10(1.5×22N)\mathrm{SNR}_{dB} = 10\log_{10}\left(1.5 \times 2^{2N}\right)

SNRdB6.02N+1.76\mathrm{SNR}_{dB} \approx 6.02N + 1.76

For an RC low-pass filter, the capacitor law i=CdV/dti = C\,dV/dt and Ohm’s law give exponential settling with:

τ=RC\tau = RC

and cutoff:

fc=12πRCf_c = \frac{1}{2\pi RC}

Battery runtime is charge divided by average current:

Iavg=IititiI_{avg} = \frac{\sum I_i t_i}{\sum t_i}

thours=capacitymAhIavg,mAt_{hours} = \frac{\mathrm{capacity}_{mAh}}{I_{avg,mA}}

Worked numbers (same source, lines 237-242 — dense mixed inline math + prose, exactly the “up to 36 instances in one file” density the pilot flagged):

Source A continued: Calculus, Exponentials, Logs

(same file, lines 429-620)

Notation: dxdt\frac{dx}{dt} means “the rate at which x changes with respect to time t”

The PID formula uses derivatives:

P(t)=Kpe(t)+Kie(t)dt+Kdde(t)dtP(t) = K_p \cdot e(t) + K_i \cdot \int e(t)dt + K_d \cdot \frac{de(t)}{dt}

Notation: f(x)dx\int f(x)dx means “sum up all the tiny pieces of f(x)”

Total energy consumed by an IoT device:

Etotal=0TP(t)dtE_{total} = \int_0^T P(t) \, dt

Ecycle=(50mW×10ms)+(0.01mW×990ms)=0.5mJ+0.0099mJ0.51mJE_{cycle} = (50mW \times 10ms) + (0.01mW \times 990ms) = 0.5mJ + 0.0099mJ \approx 0.51mJ

The exponential function: y=exy = e^x where e2.718e \approx 2.718

PhenomenonFormula
Capacitor dischargeV(t)=V0et/τV(t) = V_0 \cdot e^{-t/\tau}
Signal attenuationP=P0eαdP = P_0 \cdot e^{-\alpha d}
Sensor warm-upT(t)=Tfinal(1et/τ)T(t) = T_{final}(1 - e^{-t/\tau})
Battery self-dischargeQ(t)=Q0eλtQ(t) = Q_0 \cdot e^{-\lambda t}

τ=R×C=100Ω×10μF=1ms\tau = R \times C = 100\Omega \times 10\mu F = 1ms

Definition: If bx=yb^x = y, then logb(y)=x\log_b(y) = x

dB=10log10(PoutPin)dB = 10 \log_{10}\left(\frac{P_{out}}{P_{in}}\right)

C=Blog2(1+SNR)C = B \log_2(1 + SNR)

dBm=10log10(PmW)dBm = 10 \log_{10}(P_{mW})

Source A continued: Vectors and Matrices

(same file, lines 687-773)

Notation: v=[xyz]\vec{v} = \begin{bmatrix} x \\ y \\ z \end{bmatrix} or simply [x,y,z][x, y, z]

Magnitude (Length): How “big” is the vector?

v=x2+y2+z2|\vec{v}| = \sqrt{x^2 + y^2 + z^2}

Example: Accelerometer reads [0.5,0.3,0.8]g[0.5, 0.3, 0.8]g

a=0.52+0.32+0.82=0.980.99g|\vec{a}| = \sqrt{0.5^2 + 0.3^2 + 0.8^2} = \sqrt{0.98} \approx 0.99g

Notation:

M=[abcd]M = \begin{bmatrix} a & b \\ c & d \end{bmatrix}

Rotating sensor data to align with a reference frame:

x=xcosθysinθy=xsinθ+ycosθ\begin{aligned} x' &= x\cos\theta - y\sin\theta \\ y' &= x\sin\theta + y\cos\theta \end{aligned}

State vector might be [position,velocity,acceleration][position, velocity, acceleration]:

x=[pva]\vec{x} = \begin{bmatrix} p \\ v \\ a \end{bmatrix}

State transition predicts next state:

xk+1=Fxk\vec{x}_{k+1} = F \cdot \vec{x}_k

Describes uncertainty in measurements:

P=[σx2σxyσxyσy2]P = \begin{bmatrix} \sigma_x^2 & \sigma_{xy} \\ \sigma_{xy} & \sigma_y^2 \end{bmatrix}

Example: Transforming a 3D point (a wide equation — deliberately kept in this proof page to test the overflow-protection rule in TestMathLayout.astro; see its <style> comment):

[200020002][123]=[246]\begin{bmatrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix} \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ 4 \\ 6 \end{bmatrix}


Source B: Fresnel Zones and Deployment

(content/networking-core/net-prop-fresnel.qmd, lines 74-119 — a real “net-prop-*” file, the task brief’s own example)

At a point with distances (d_1) and (d_2) from the two antennas, the first-zone radius is

r1=λd1d2d1+d2.r_1=\sqrt{\frac{\lambda d_1d_2}{d_1+d_2}}.

The zone is widest near the path midpoint. Lower frequencies have longer wavelengths and therefore larger Fresnel radii for the same geometry.

ITU-R P.526 uses clearance equal to 60% of the first-zone radius as a boundary for the diffraction zone. Treat (0.6r_1) as a useful screening target, not as a guarantee of availability or delivery.

For wavelength (lambda), the radius at one location along the path is

r1=λd1d2d1+d2,r_1=\sqrt{\frac{\lambda d_1d_2}{d_1+d_2}},

where (d_1) and (d_2) use the same distance unit and the result follows that unit.

With distance in kilometres and frequency in gigahertz, a convenient form is

r1(m)=17.32d1d2f(d1+d2).r_1(\text{m})=17.32\sqrt{\frac{d_1d_2}{f(d_1+d_2)}}.

At the midpoint of a total path (D), (d_1=d_2=D/2), so

r1,mid=8.66Dfr_{1,\text{mid}}=8.66\sqrt{\frac{D}{f}}

for (D) in kilometres, (f) in gigahertz, and radius in metres.

Worked Path-Profile Decision

(same file, lines 231-241)

Consider a hypothetical 5 km path at 915 MHz with an obstacle 2 km from the transmitter and 3 km from the receiver.

r1=17.322×30.915×519.8 m,r_1=17.32\sqrt{\frac{2\times3}{0.915\times5}}\approx19.8\text{ m},

so the 60% screen is about 11.9 m at that location.

Suppose the direct path line is 18 m above the common datum there and the surveyed obstacle top is 9 m. The geometric clearance is 9 m, or

919.845% of r1.\frac{9}{19.8}\approx45\%\text{ of }r_1.

The obstacle enters the 60% screen.


Coverage check: \begin{align}

(content/coap/coap-api-design.qmd, lines 845-861 verbatim — estate-wide grep of content/*/*.qmd for \begin{[a-zA-Z*]+} turns up exactly three environments in use: aligned (35), align (14), bmatrix (13; all exercised above via Source A). This block is a real align instance, picked from coap since it overlaps this lane’s hand-picked module.)

CON (Confirmable) message energy:

TX message (50 ms @ 10 mA)=50×103×10×103=0.5 mAsRX ACK (100 ms @ 5 mA)=100×103×5×103=0.5 mAsTotal per message=1.0 mAs=0.278 μAh\begin{align} \text{TX message (50 ms @ 10 mA)} &= 50 \times 10^{-3} \times 10 \times 10^{-3} = 0.5 \text{ mAs} \\ \text{RX ACK (100 ms @ 5 mA)} &= 100 \times 10^{-3} \times 5 \times 10^{-3} = 0.5 \text{ mAs} \\ \text{Total per message} &= 1.0 \text{ mAs} = 0.278 \text{ } \mu\text{Ah} \end{align}

Annual comparison (525,600 messages):

CON energy=525,600×0.278=146 mAhSleep energy=0.005×24×365=44 mAhTotal CON=146+44=190 mAh (battery life=220/190=1.16 years)NON energy=525,600×0.139=73 mAhTotal NON=73+44=117 mAhBattery life=220117=1.88 years\begin{align} \text{CON energy} &= 525{,}600 \times 0.278 = 146 \text{ mAh} \\ \text{Sleep energy} &= 0.005 \times 24 \times 365 = 44 \text{ mAh} \\ \text{Total CON} &= 146 + 44 = 190 \text{ mAh (battery life} = 220/190 = 1.16 \text{ years)} \\ \\ \text{NON energy} &= 525{,}600 \times 0.139 = 73 \text{ mAh} \\ \text{Total NON} &= 73 + 44 = 117 \text{ mAh} \\ \text{Battery life} &= \frac{220}{117} = 1.88 \text{ years} \end{align}