◇ OpenCyber Academy
Engineering · Chapter 6 · English

Chapter 06 — Calculus II

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Chapter 06 — Calculus II

Lesson map

Lesson 06 published. Map, example, EX011.

flowchart TD
  N0["Learning outcomes and connection"]
  N1["6.1 Accumulation"]
  N2["6.2 Numerical integration"]
  N3["6.3 Recovery trajectories and model fit"]
  N4["6.4 Boundary conditions"]
  N5["Chapter synthesis"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5
  N5 --> EX["Worked example"]
  EX --> Q["Exercise EX011"]

Logical drawing

flowchart LR
  N0["Learning outcomes and connection"]
  N1["6.1 Accumulation"]
  N2["6.2 Numerical integration"]
  N3["6.3 Recovery trajectories and model fit"]
  N4["6.4 Boundary conditions"]
  N5["Chapter synthesis"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> Q["EX011"]
[Learning outcomes and connection]
    |
    v
[6.1 Accumulation]
    |
    v
[6.2 Numerical integration]
    |
    v
[6.3 Recovery trajectories and model fit]
    |
    v
[6.4 Boundary conditions]
    |
    v
[Chapter synthesis]
    |
    v
[Worked example] --> [Exercise EX011]

Learning outcomes and connection

After this chapter you can (1) compute accumulated backlog and accumulated waiting as integrals; (2) fit a simple recovery model to observations and judge the fit; (3) state boundary conditions that make a model valid; and (4) explain how integral-based measures change capacity decisions. It builds on Chapter 1 and prepares Chapters 29, 32 and 36.

6.1 Accumulation

If $\lambda(t)$ and $\mu(t)$ are arrival and service rates, the backlog is the accumulated difference,

$$Q(t) = Q(0) + \int_0^t \big(\lambda(s) - \mu(s)\big)\,ds,$$

clipped at zero. A second integral matters more for people affected by an incident: the accumulated waiting $W = \int_0^T Q(t)\,dt$, measured in case-hours. Two plans that clear the backlog at the same moment can differ greatly in $W$; the one that clears high-severity work first can have similar $W$ but very different harm. That is why "time to clear" alone is a poor objective.

6.2 Numerical integration

Real rates are samples, not formulas. The trapezoidal rule approximates $\int f$ by summing $(f_i + f_{i+1})h/2$; Euler's method, used in Lab 1, updates $Q \leftarrow Q + (\lambda - \mu)h$. Halving the step and comparing results is a simple convergence check: if the answer changes in the second significant digit, the step is too large. Lab 1 reports $W \approx 371$ case-hours for the 12 hours after the outage starts (Chapter 1). For Lab 1 the check means rerunning with a step of 0.05 h and confirming that the 371 case-hours change only in the third digit.

6.3 Recovery trajectories and model fit

Service recovery often looks like exponential approach to normal: performance $P(t) = P_\infty - (P_\infty - P_0)e^{-t/\tau}$, where $\tau$ is the time constant — after $\tau$, about 63% of the gap is closed. Fitting $\tau$ to observations by taking logs of the remaining gap turns the problem into linear regression. The fit is only a description: check residuals; if recovery happens in steps (a database comes back, then the portal), a smooth exponential hides the structure that matters for planning, and a piecewise model by dependency (Chapter 13) is better. The area between full performance and $P(t)$ is the resilience-loss measure proposed by Bruneau et al. (2003); for an exponential recovery it equals $(P_\infty - P_0)\tau$.

6.4 Boundary conditions

A model is valid inside stated conditions: initial backlog, staffing, arrival pattern and the assumption that work is not lost or merged. State them. "The backlog clears in 20 h assuming constant staffing of six, arrivals following last month's daily profile and no second incident" is a defensible statement; "the backlog clears in 20 h" is not.

The Lab 1 backlog figures carry their own conditions: a constant capacity of 12 cases/h, the sinusoidal daily profile, one outage between hours 2 and 6, and no merging of duplicate reports. Once any of these changes, such as a second outage or merged reports, the 37 cases waiting at hour 12 must be recomputed.

6.5 Worked example (synthetic): staffing a surge

HVSS considers adding two analysts (capacity 12 → 16 cases/h) from hour 4 to hour 10 of the Chapter 1 outage. Modify Lab 1 so MU is a function of time. Running the modified model gives a peak of 41.9 cases (down from 49.9) and $W \approx 250$ case-hours (down from 371). The peak falls only modestly because the extra staff arrive two hours into the surge; much of the reduction in $W$ comes from the faster drain between hours 6 and 10, when the base team alone would remove only 1–4 cases per hour. A cheaper design might defer low-severity cases during the surge and concentrate surge staff on the drain phase, where each added case/hour of capacity removes waiting that would otherwise persist for many hours.

6.6 Errors and limits

The surge-staffing example shows why the first error matters at HVSS. Measured by peak alone, two extra analysts look weak, cutting 49.9 cases to 41.9. Measured by accumulated waiting, they remove about 121 case-hours, and most of that saving comes during the drain phase between hours 6 and 10. Rerunning the modified model without the max(0.0, ...) clip would show the last error, since the backlog would go negative whenever arrivals fell below capacity.

Exercises — chapter 06

EX011 — Accumulated waiting. Objective: compute $W$ by hand. Inputs: backlog rises linearly from 0 to 40 cases over 4 h, then falls linearly to 0 over 8 h. Steps: compute $W$; compute it again if the fall takes 4 h. Expected evidence: two numbers in case-hours. Rubric: 3 = 240 and 160 case-hours; 2 = one; 1 = method; 0 = none.

EX012 — Surge staffing. Objective: use the model for a decision. Inputs: Lab 1. Steps: implement MU(t) = 16 for $4 \le t < 10$, else 12; report peak backlog and $W$; compare with base. Expected evidence: code change, two numbers each case, recommendation. Rubric: 3 = correct numbers and a recommendation that considers severity or timing; 2 = numbers only; 1 = attempt; 0 = none.

Chapter synthesis

Integrals measure what people experience: accumulated backlog, waiting and lost service. Compute them numerically with checked step sizes, fit recovery models only where their shape matches reality, and attach boundary conditions to every estimate.

Continue studying — chapter 06 of 50

← Chapter 05 · Course chapter index · Chapter 07 →

Continue to the next authored lesson.