Lung elastance, resistance, compliance and effect of anesthesia on pulmonary mechanism Everything about these from authentic sources- miller, morgan, cambridge book and relevant sources for anesthesiology

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Reading File
Reading File
Loading Image
Reading File
Reading File
Loading Image
Excellent - that airway resistance vs lung volume figure from Morgan is perfect. I now have comprehensive content from all three major anesthesia textbooks. Let me compile the complete, well-organized response.

Lung Mechanics in Anesthesia: Elastance, Resistance, Compliance, and Anesthetic Effects

Sources: Miller's Anesthesia 10e, Morgan & Mikhail's Clinical Anesthesiology 7e, Barash Clinical Anesthesia 9e

1. THE EQUATION OF MOTION - The Foundation

All aspects of lung mechanics unite in the equation of motion, which describes the total airway pressure required to move gas:
P_aw = P_vent + P_musc = (V_t × E_RS) + (R_aw × V̇_I) + PEEP + PEEP_i
Where:
  • P_vent = ventilator-applied pressure
  • P_musc = patient's inspiratory muscle pressure
  • V_t = tidal volume
  • E_RS = respiratory system elastance
  • R_aw = airway resistance
  • V̇_I = inspiratory flow
  • PEEP_i = intrinsic PEEP
Miller's Anesthesia phrases this as: P = R·V̇ + E·V + I·V̈ + P₀, encompassing resistive (R), elastic (E), and inertial (I) components, where inertia is negligible at normal breathing frequencies. All variables - resistance, elastance, pressure, flow, and volume - are interdependent.
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 917
  • Barash Clinical Anesthesia 9e, p. 1105
  • Miller's Anesthesia 10e, p. 5518

2. LUNG MECHANICS - Overview

Morgan defines it clearly: "The movement of the lungs is passive and determined by the impedance of the respiratory system, which can be divided into:
  1. Elastic resistance of tissues and the gas-liquid interface (governs lung volume and associated pressures under static conditions)
  2. Nonelastic resistance to gas flow (relates to frictional resistance to airflow and tissue deformation)"
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 921

3. ELASTIC RESISTANCE

3a. Sources of Elastic Recoil

The lungs' tendency to collapse arises from two sources:
  1. Elastin fiber content - structural elastic proteins in parenchyma
  2. Surface tension forces at the air-fluid interface of alveoli (the larger contributor)
By Laplace's Law: Pressure = 2 × Surface tension / Radius
The pressure within an alveolus is directly proportional to surface tension and inversely proportional to radius. Pulmonary surfactant stabilizes alveoli by reducing surface tension in proportion to its concentration:
  • As alveoli shrink → surfactant becomes more concentrated → surface tension falls → resists collapse
  • As alveoli overdistend → surfactant disperses → surface tension rises → resists overdistention
The chest wall tends to expand outward, while the lungs tend to collapse inward - these opposing forces balance at FRC.
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 921

3b. Compliance

Compliance (C) = ΔVolume / ΔDistending Pressure - the reciprocal of elastance.
ParameterFormulaNormal Value
Lung compliance (C_L)ΔV_lung / ΔP_transpulmonary150-200 mL/cm H₂O
Chest wall compliance (C_W)ΔV_chest / ΔP_transthoracic200 mL/cm H₂O
Total compliance (C_total)1/C_L + 1/C_W = 1/C_total100 mL/cm H₂O
In healthy individuals, C_L ≈ C_CW, so the ratio C_L/C_RS ≈ 0.5.
Key formula: 1/C_RS = 1/C_L + 1/C_CW (analogous to series electrical capacitors)
Transpulmonary pressure (P_L) = P_alveolar - P_pleural. At end-expiration normally: P_intrapleural = -5 cm H₂O, P_alveolar = 0, so P_transpulmonary = +5 cm H₂O.
Transthoracic pressure = P_atmospheric - P_intrapleural.
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 922
  • Barash Clinical Anesthesia 9e, p. 1107

3c. The Pressure-Volume (PV) Curve

Pulmonary pressure-volume relationships at different values of TLC showing sigmoidal curves. Humans normally breathe on the steep, linear part near FRC where compliance is greatest.
Figure from Barash Clinical Anesthesia 9e - PV relationships at varying TLC values
The PV curve is sigmoidal and nonlinear:
  • Peak compliance occurs near FRC, where lung recoil and chest wall recoil balance
  • Moving above or below FRC → compliance worsens
  • Upper Inflection Point (UIP): overdistention/parenchymal strain-stiffening
  • Lower Inflection Point (LIP): maximum alveolar recruitment threshold
  • Lung-protective ventilation targets the linear "safe zone" between LIP and UIP
The curve also exhibits hysteresis - lung volume at any given pressure differs depending on whether you are inflating or deflating. This is due to surfactant biophysics, time-dependent recruitment/derecruitment, and connective tissue friction.
PV curve showing hysteresis with Upper Inflection Point (UIP), Lower Inflection Point (LIP), safe zone, zone of overdistention, and zone of derecruitment/atelectasis
Figure from Miller's Anesthesia 10e - PV curve with clinical zones for protective ventilation
  • Miller's Anesthesia 10e, p. 5532
  • Barash Clinical Anesthesia 9e, p. 1107

3d. Elastance

Elastance = 1/Compliance - describes stiffness. Conditions that increase elastance (reduce compliance) include: consolidation, pulmonary edema, pneumothorax, atelectasis, interstitial disease, pneumonectomy, lung overdistention, and mainstem intubation.
Respiratory system elastance (E_RS) = E_L + E_CW (elastances add in series, compliances add as reciprocals).
  • Miller's Anesthesia 10e, p. 5519

3e. Dynamic vs Static Compliance

  • Static compliance: measured at zero flow (end-inspiratory pause); reflects purely elastic properties. Computed as: C_static = V_t / (P_plateau - PEEP)
  • Dynamic compliance: measured during breathing; also incorporates the effects of airway resistance. Always ≤ static compliance.

4. DRIVING PRESSURE

Driving Pressure (ΔP) = Plateau Pressure - PEEP = V_t / C_RS
Barash emphasizes driving pressure as a surrogate for global lung strain - a marker of ventilator-induced lung injury (VILI) and predictor of mortality in ARDS. It accounts for pre-existing lung characteristics in a way that tidal volume alone does not.
  • Lower intraoperative driving pressures correlate with lower rates of postoperative pulmonary complications
  • During thoracic surgery, targeting driving pressure minimization outperforms standard ventilation parameters
  • Barash Clinical Anesthesia 9e, p. 1112

5. NONELASTIC RESISTANCE

5a. Airway Resistance

Airway resistance (R) = ΔPressure / Flow (V̇)
Normal total airway resistance: 0.5-2 cm H₂O/L/s
The largest contribution comes from medium-sized bronchi (before the 7th generation):
  • Large bronchi: low resistance (large diameter)
  • Small bronchi: low resistance (large total cross-sectional area)
  • Most resistance = medium bronchi
Flow regimes:
  • Laminar flow (Hagen-Poiseuille): R = 8ηl/πr⁴ - resistance is proportional to viscosity, inversely proportional to the 4th power of radius
  • Turbulent flow: resistance increases in proportion to gas density and inversely to the 5th power of radius - extremely sensitive to airway caliber
Reynolds number = (Linear velocity × Diameter × Gas density) / Gas viscosity
  • <1000: laminar flow
  • 1500: turbulent flow
Laminar flow normally occurs only distal to small bronchioles (<1 mm). Flow in larger airways is predominantly turbulent.
Clinical implication: Helium-O₂ (heliox) has a lower density-to-viscosity ratio than air or O₂, reducing turbulent flow and airway resistance in upper airway obstruction.
The clinical bedside measurement of resistance during volume-cycled ventilation uses: R = (P_peak - P_plateau) / V̇_I
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 928-929
  • Barash Clinical Anesthesia 9e, p. 1115
  • Miller's Anesthesia 10e, p. 5519

5b. Volume-Related Airway Collapse

At low lung volumes, radial traction on small airways is reduced. Airway resistance becomes inversely proportional to lung volume. Increasing lung volume with PEEP reduces airway resistance.

5c. Flow-Related Airway Collapse (Dynamic Compression)

During forced exhalation, positive pleural pressure and large pressure drops across intrathoracic airways cause dynamic airway compression. The terminal portion of the flow-volume curve becomes effort-independent - further muscular effort cannot increase expiratory flow beyond the equal pressure point.
Airway resistance vs. lung volume graph showing positions A (upright/awake), B (supine/awake), C (supine/anesthetized without bronchodilation), and D (supine/anesthetized with bronchodilation)
Figure from Morgan & Mikhail 7e - The interaction of anesthesia, position, and bronchodilation on airway resistance

5d. Tissue Resistance

Often underestimated, tissue resistance may account for up to 50% of total airway resistance. It arises from viscoelastic (frictional) resistance of lung and chest wall tissues during deformation. In adult patients, lung tissue resistance comprises about 60% of subglottal total lung resistance at typical breathing rates. Unlike airway resistance, tissue resistance varies inversely with breathing frequency (a property of viscoelastic materials).
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 933
  • Miller's Anesthesia 10e, p. 5519

5e. Causes of Increased Airway Resistance

CategoryExamples
BronchospasmAsthma, anaphylaxis
Secretions/mucosal edemaInfection, aspiration
Volume-relatedLow FRC, atelectasis
Flow-relatedForced exhalation, obesity
AnatomicalPosterior tongue displacement, laryngospasm, tumor
EquipmentKinked/small ETT, valve malfunction, breathing circuit obstruction

6. WORK OF BREATHING

Work = Pressure × Volume (expressed in joules per liter of ventilation; 1 J = energy to move 1 L across 10 cmH₂O)
Three components must be overcome:
  1. Elastic recoil of chest and lung
  2. Frictional resistance to airflow
  3. Tissue frictional resistance
During inhalation, ~50% of energy is stored as pulmonary elastic recoil potential energy - released during passive exhalation to overcome expiratory airway resistance. Expiration is normally entirely passive.
Respiratory muscles normally consume 2-3% of total O₂ but operate at only ~10% efficiency (90% dissipated as heat). In pathological states, efficiency decreases further until additional ventilation consumes all O₂ gained.
Adaptive responses:
  • Reduced compliance → rapid, shallow breathing (minimizes elastic work)
  • Increased airway resistance → slow, deep breathing (minimizes flow-resistive work)
  • Excessive expiratory resistance → increased FRC breathing (stored elastic energy overcomes resistance)
Mechanical power = work per unit time (J/min) = incorporates rate and flow. Excess mechanical power drives VILI via energy transfer to tissues.
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 934-935
  • Barash Clinical Anesthesia 9e, p. 1106

7. EFFECTS OF ANESTHESIA ON PULMONARY MECHANICS

This is summarized from all three textbooks as the key integration:

7a. Effects on FRC and Lung Volumes

Changes occur almost immediately after induction:
StepFRC Change
Supine position alone0.8-1.0 L
Induction of GA (supine)further ↓ 0.4-0.5 L
Total combined reduction~1.0-1.5 L below upright-awake
Mechanisms of FRC reduction (Barash/Morgan):
  1. Loss of inspiratory muscle tone → diaphragm shifts cephalad, especially the dorsal portion in supine position
  2. Change in chest wall rigidity - loss of tone reduces outward expansion of chest wall
  3. Compression atelectasis - alveolar collapse from increased regional pleural pressure
  4. Increased intrathoracic blood volume
  5. Thoracic spine becomes more lordotic, rib cage moves inward
Key points:
  • FRC reduction is not related to anesthetic depth
  • May persist for hours to days after anesthesia
  • Steep Trendelenburg (>30°) reduces FRC further (increased intrathoracic blood volume)
  • Induction in the sitting position has little effect on FRC
  • Muscle paralysis alone does not significantly change FRC in already-anesthetized patients
Atelectasis under anesthesia is universal:
  • Occurs with any anesthetic (IV or inhalational), spontaneous or controlled ventilation, healthy or sick lungs
  • Up to one-fifth of normally aerated lung can collapse (visualized on CT)
  • Persists in most patients during recovery → prolongs hypoxemia
  • Atelectasis and reduced inspiratory strength can persist weeks to months after median sternotomy
Two mechanisms of atelectasis:
  1. Compressive atelectasis: increased regional pleural pressure (gravity-dependent, worsened by diaphragm cephalad shift) collapses alveoli without positive distending pressure
  2. Resorption atelectasis: gas flow out of alveoli exceeds inflow (when distal airways close); worsened by high FiO₂
  • Barash Clinical Anesthesia 9e, p. 1113-1114
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 936

7b. Effects on Compliance

Overall: lungs become smaller and relatively stiffer under anesthesia (Barash Key Point #4).
The primary driver is atelectasis reducing aerated lung volume, shifting tidal breathing to a less compliant portion of the PV curve. This is worsened by:
ConditionMechanism
ObesityShifts CW pressure-volume curve rightward; lung compliance disproportionately reduced
PneumoperitoneumChanges thoracic cavity shape → reduces CW compliance, relatively preserves C_L
Trendelenburg positionAbdominal contents press against diaphragm
Low tidal ventilationCan increase atelectasis and lower compliance
The PROBESE trial (obese patients under GA): PEEP 12 + recruitment vs. PEEP 4 showed no difference in postoperative pulmonary complications, but the higher PEEP group had lower intraoperative driving pressures and less hypoxemia.
Esophageal pressure monitoring allows separate measurement of C_L and C_CW - useful for distinguishing "lung problem" from "chest wall problem" in low compliance states.
  • Barash Clinical Anesthesia 9e, p. 1113-1114
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 936-937

7c. Effects on Airway Resistance

Net effect of anesthesia on airway resistance is complex - two opposing forces:
ForceEffect on Resistance
↓ FRC (would increase resistance)
Bronchodilating properties of volatile agents
Result: airway resistance does not typically increase under volatile anesthesia because bronchodilation compensates for FRC loss.
Barash clarifies three mechanisms by which anesthesia influences resistance:
  1. Changes in airway diameter - propofol inhibits genioglossus → upper airway collapse; glottic narrowing in laryngospasm; bronchial smooth muscle contraction with stimulation
  2. Changes in lung volume - reduced FRC narrows bronchioles (altered radial stress)
  3. Changes in gas flow - Bernoulli effect: high intrathoracic pressure → flow-related collapse (obesity, pneumothorax)
Endotracheal tubes add significant resistance - more if kinked or obstructed.
Increased airway resistance under anesthesia is more often due to:
  • Posterior displacement of the tongue
  • Laryngospasm
  • Bronchoconstriction
  • Secretions, blood, or tumor in the airway
  • Equipment problems (small ETT, valve malfunction, circuit obstruction)
Miller's notes that volatile anesthetics reduce upper airway resistance at low concentrations via bronchomotor tone changes, with a ceiling effect - low concentrations are most effective.
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 937
  • Barash Clinical Anesthesia 9e, p. 1119
  • Miller's Anesthesia 10e, p. 1120

7d. Intrinsic PEEP (Auto-PEEP) Under Anesthesia

Barash defines intrinsic PEEP as "any additional end-expiratory pressure beyond what is applied." It occurs when exhalation is incomplete due to:
  • Flow limitation
  • Airway closure
The expiratory time constant = R × C. For R = 10 cmH₂O/L/s, C = 0.05 L/cmH₂O → τ = 0.5 sec; ~3 time constants are needed for full exhalation.
High intrinsic PEEP → hyperinflation → ↑ airway pressures → systemic hypotension (reduces venous return).
Clinically detected on ventilator flow-time curves when flow does not return to zero before the next breath begins.
  • Barash Clinical Anesthesia 9e, p. 1119-1120

7e. Effects on Work of Breathing

From Morgan: "Increases in work of breathing under anesthesia are most often secondary to reduced lung and chest wall compliance and, less commonly, increases in airway resistance. The problems of increased work of breathing are usually circumvented by controlled mechanical ventilation."
Miller's Key Point: "Respiratory work is increased during anesthesia as a consequence of reduced respiratory compliance and increased airway resistance."
  • Morgan & Mikhail's Clinical Anesthesiology 7e, p. 937

7f. Effects on Respiratory Pattern

  • Light anesthesia: irregular breathing, breath-holding common
  • Deeper anesthesia: regular breathing returns
  • Inhalation agents in increasing order of respiratory depression: halothane < isoflurane/enflurane < desflurane/sevoflurane

8. SPECIAL SCENARIOS AFFECTING MECHANICS

ScenarioCompliance ChangeKey Mechanism
Obesity↓↓ C_L more than C_CWCW PV curve shifts right
Pneumoperitoneum↓ C_CW, C_L relatively preservedChanged thoracic shape
Trendelenburg↓ FRC → ↓ complianceAbdominal contents
PEEP application↑ FRC → ↑ compliance (up to UIP)Alveolar recruitment
ARDS↓↓ C_LInflammation, edema, atelectasis
COPD↑ C_L (emphysema), ↑ resistanceHyperinflation, loss of radial traction

9. KEY CLINICAL NUMBERS TO REMEMBER

ParameterNormal Value
Lung compliance (C_L)150-200 mL/cm H₂O
Chest wall compliance (C_W)200 mL/cm H₂O
Total compliance (C_RS)~100 mL/cm H₂O
Normal airway resistance0.5-2 cm H₂O/L/s
Transpulmonary pressure at end-expiration+5 cm H₂O
Intrapleural pressure at end-expiration-5 cm H₂O
FRC reduction: supine0.8-1.0 L
FRC reduction: induction of GAadditional 0.4-0.5 L
Respiratory muscle O₂ consumption (normal)2-3% of total
Respiratory muscle efficiency~10%

Summary (Barash Key Points)

  1. Elastic and resistive forces are the major impedances to air delivery into lungs
  2. FRC has a key role in determining oxygen reserves, propensity to atelectasis, and biologic effects of mechanical ventilation
  3. Driving pressure is a surrogate for global lung strain - higher values predict postoperative pulmonary complications
  4. Anesthesia results in smaller and stiffer lungs, primarily due to atelectasis - Trendelenburg, obesity, and pneumoperitoneum further reduce C_RS
  5. Shunt physiology (atelectasis) is the primary etiology of intraoperative hypoxemia - addressed by restoring end-expiratory lung volume (PEEP, recruitment)
  6. Dead space increases during anesthesia; instrumental dead space from breathing devices can be significant
  • Barash Clinical Anesthesia 9e, Key Points, p. 1103

Can u generate a pdf of all this info that is downloadable

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && echo "---" && which weasyprint report…

Running Command

mkdir -p /home/daytona/workspace/lung-mechanics-pdf && ls /home/daytona/workspac…

Writing File

~/lung-mechanics-pdf/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem

OUTPUT = "/home/daytona/workspace/lung-mechanics-pdf/Lung_Mechanics_Anesthesia.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2.2*cm,
    title="Lung Mechanics in Anesthesia",
    author="Compiled from Miller's, Morgan & Mikhail, Barash"
)

W = A4[0] - 4*cm  # usable width

styles = getSampleStyleSheet()

# Custom styles
title_style = ParagraphStyle(
    'CustomTitle', parent=styles['Title'],
    fontSize=22, leading=28, textColor=colors.HexColor('#1a3a5c'),
    spaceAfter=6
)
subtitle_style = ParagraphStyle(
    'Subtitle', parent=styles['Normal'],
    fontSize=11, leading=16, textColor=colors.HexColor('#4a6fa5'),
    spaceAfter=16, alignment=TA_CENTER
)
h1_style = ParagraphStyle(
    'H1', parent=styles['Heading1'],
    fontSize=14, leading=18, textColor=colors.white,
    backColor=colors.HexColor('#1a3a5c'),
    spaceBefore=16, spaceAfter=6,
    leftIndent=-0.5*cm, rightIndent=-0.5*cm,
    borderPad=6
)
h2_style = ParagraphStyle(
    'H2', parent=styles['Heading2'],
    fontSize=12, leading=16, textColor=colors.HexColor('#1a3a5c'),
    spaceBefore=12, spaceAfter=4,
    borderPad=3
)
h3_style = ParagraphStyle(
    'H3', parent=styles['Heading3'],
    fontSize=10.5, leading=14, textColor=colors.HexColor('#2e6da4'),
    spaceBefore=8, spaceAfter=3,
    fontName='Helvetica-BoldOblique'
)
body_style = ParagraphStyle(
    'Body', parent=styles['Normal'],
    fontSize=9.5, leading=14, textColor=colors.HexColor('#222222'),
    spaceAfter=5, alignment=TA_JUSTIFY
)
body_bold = ParagraphStyle(
    'BodyBold', parent=body_style,
    fontName='Helvetica-Bold'
)
cite_style = ParagraphStyle(
    'Cite', parent=styles['Normal'],
    fontSize=8, leading=11, textColor=colors.HexColor('#555555'),
    spaceAfter=4, leftIndent=12,
    fontName='Helvetica-Oblique'
)
bullet_style = ParagraphStyle(
    'Bullet', parent=body_style,
    leftIndent=16, bulletIndent=6, spaceAfter=3
)
keypoint_style = ParagraphStyle(
    'KeyPoint', parent=body_style,
    backColor=colors.HexColor('#eaf2ff'),
    borderPad=6, leftIndent=6, rightIndent=6,
    spaceAfter=4
)
formula_style = ParagraphStyle(
    'Formula', parent=styles['Normal'],
    fontSize=10, leading=15, textColor=colors.HexColor('#003366'),
    fontName='Courier-Bold',
    backColor=colors.HexColor('#f5f5f5'),
    borderPad=5, leftIndent=12, spaceAfter=6
)

def h1(text):
    return Paragraph(f"&nbsp;&nbsp;{text}", h1_style)

def h2(text):
    return Paragraph(text, h2_style)

def h3(text):
    return Paragraph(text, h3_style)

def p(text):
    return Paragraph(text, body_style)

def cite(text):
    return Paragraph(f"<i>{text}</i>", cite_style)

def formula(text):
    return Paragraph(text, formula_style)

def bullet(items):
    return ListFlowable(
        [ListItem(Paragraph(i, bullet_style), leftIndent=20, bulletColor=colors.HexColor('#1a3a5c')) for i in items],
        bulletType='bullet', bulletFontSize=8, leftIndent=10
    )

def make_table(headers, rows, col_widths=None):
    data = [headers] + rows
    if col_widths is None:
        col_widths = [W / len(headers)] * len(headers)
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a3a5c')),
        ('TEXTCOLOR', (0,0), (-1,0), colors.white),
        ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
        ('FONTSIZE', (0,0), (-1,0), 9),
        ('ALIGN', (0,0), (-1,-1), 'LEFT'),
        ('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
        ('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
        ('FONTSIZE', (0,1), (-1,-1), 8.5),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor('#f0f5ff')]),
        ('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#cccccc')),
        ('TOPPADDING', (0,0), (-1,-1), 4),
        ('BOTTOMPADDING', (0,0), (-1,-1), 4),
        ('LEFTPADDING', (0,0), (-1,-1), 6),
        ('RIGHTPADDING', (0,0), (-1,-1), 6),
        ('ROWBACKGROUNDS', (0,0), (-1,0), [colors.HexColor('#1a3a5c')]),
    ]))
    return t

def hr():
    return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor('#cccccc'), spaceAfter=6)

# ============================================================
# BUILD CONTENT
# ============================================================
story = []

# Title Page
story.append(Spacer(1, 1.5*cm))
story.append(Paragraph("Lung Mechanics in Anesthesia", title_style))
story.append(Paragraph(
    "Elastance · Resistance · Compliance · Effects of Anesthesia on Pulmonary Mechanics",
    subtitle_style
))
story.append(Paragraph(
    "Compiled from Miller's Anesthesia 10e &nbsp;|&nbsp; Morgan &amp; Mikhail's Clinical Anesthesiology 7e &nbsp;|&nbsp; Barash Clinical Anesthesia 9e",
    ParagraphStyle('src', parent=subtitle_style, fontSize=9, textColor=colors.HexColor('#888888'))
))
story.append(hr())
story.append(Spacer(1, 0.5*cm))

# ---- SECTION 1: EQUATION OF MOTION ----
story.append(h1("1. The Equation of Motion — Foundation of Lung Mechanics"))
story.append(p(
    "All aspects of lung mechanics unite in the <b>equation of motion</b>, which describes the total airway pressure required to move gas into the lungs. It encompasses resistive, elastic, and inertial components:"
))
story.append(formula("P_aw = (Vt × E_RS) + (R_aw × V̇_I) + PEEP + PEEP_i"))
story.append(formula("Miller's:  P = R·V̇ + E·V + I·V̈ + P₀"))

story.append(make_table(
    ["Symbol", "Meaning"],
    [
        ["P_vent", "Airway pressure applied by the ventilator"],
        ["P_musc", "Pressure generated from patient inspiratory muscles"],
        ["Vt", "Tidal volume"],
        ["E_RS", "Respiratory system elastance (stiffness)"],
        ["R_aw", "Airway resistance"],
        ["V̇_I", "Inspiratory flow"],
        ["PEEP_i", "Intrinsic (auto) PEEP"],
        ["I·V̈", "Inertial component (negligible at normal breathing rates)"],
    ],
    col_widths=[3*cm, W - 3*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(cite("Sources: Morgan & Mikhail 7e p.917 | Barash 9e p.1105 | Miller's 10e p.5518"))

# ---- SECTION 2: LUNG MECHANICS OVERVIEW ----
story.append(h1("2. Lung Mechanics — Overview"))
story.append(p(
    "Morgan defines it: <i>\"The movement of the lungs is passive and determined by the impedance of the respiratory system,\"</i> divided into:"
))
story.append(bullet([
    "<b>Elastic resistance</b> of tissues and the gas-liquid interface — governs lung volume and pressures under static (no-flow) conditions",
    "<b>Nonelastic resistance</b> to gas flow — relates to frictional resistance to airflow and tissue deformation"
]))
story.append(cite("Morgan & Mikhail 7e p.921"))

# ---- SECTION 3: ELASTIC RESISTANCE ----
story.append(h1("3. Elastic Resistance"))

story.append(h2("3a. Sources of Elastic Recoil"))
story.append(p("The lungs' tendency to collapse arises from two main sources:"))
story.append(bullet([
    "<b>Elastin fiber content</b> — structural elastic proteins in the parenchyma",
    "<b>Surface tension forces</b> at the air-fluid interface of alveoli (the larger contributor)"
]))
story.append(h3("Laplace's Law — Surface Tension"))
story.append(formula("Pressure = 2 × Surface tension / Radius"))
story.append(p(
    "Alveolar pressure is directly proportional to surface tension and inversely proportional to radius. "
    "<b>Pulmonary surfactant</b> stabilizes alveoli by reducing surface tension in proportion to its concentration:"
))
story.append(bullet([
    "As alveoli shrink → surfactant more concentrated → surface tension falls → resists collapse",
    "As alveoli overdistend → surfactant disperses → surface tension rises → resists overdistention",
    "Net effect: small alveoli prevented from getting smaller; large alveoli prevented from getting larger"
]))
story.append(p(
    "The chest wall tends to <b>expand outward</b>, while the lungs tend to <b>collapse inward</b>. These opposing recoil forces balance at <b>Functional Residual Capacity (FRC)</b>."
))
story.append(cite("Morgan & Mikhail 7e p.921"))

story.append(h2("3b. Compliance"))
story.append(formula("Compliance (C) = ΔVolume / ΔDistending Pressure"))
story.append(p("Compliance is the reciprocal of elastance. Normal values:"))
story.append(make_table(
    ["Parameter", "Formula", "Normal Value"],
    [
        ["Lung compliance (C_L)", "ΔV_lung / ΔP_transpulmonary", "150–200 mL/cm H₂O"],
        ["Chest wall compliance (C_W)", "ΔV_chest / ΔP_transthoracic", "200 mL/cm H₂O"],
        ["Total (C_RS)", "1/C_L + 1/C_W = 1/C_RS", "~100 mL/cm H₂O"],
    ],
    col_widths=[5.5*cm, 6*cm, W - 11.5*cm]
))
story.append(formula("1/C_RS = 1/C_L + 1/C_CW   (analogous to series electrical capacitors)"))
story.append(p(
    "In healthy individuals, C_L ≈ C_CW, so C_L/C_RS ≈ 0.5. "
    "<b>Transpulmonary pressure (P_L)</b> = P_alveolar − P_pleural. "
    "At end-expiration: P_intrapleural = −5 cm H₂O, P_alveolar = 0, so P_L = +5 cm H₂O."
))
story.append(cite("Morgan & Mikhail 7e p.922 | Barash 9e p.1107"))

story.append(h2("3c. Pressure-Volume (PV) Curve"))
story.append(p(
    "The PV curve is <b>sigmoidal and nonlinear</b>. Peak compliance occurs near FRC where lung recoil and chest wall recoil balance. "
    "Moving above or below FRC worsens compliance."
))
story.append(bullet([
    "<b>Upper Inflection Point (UIP)</b>: parenchymal strain-stiffening / overdistention",
    "<b>Lower Inflection Point (LIP)</b>: maximum alveolar recruitment threshold",
    "Lung-protective ventilation targets the <b>linear \"safe zone\"</b> between LIP and UIP",
    "<b>Hysteresis</b>: lung volume at a given pressure differs between inflation and deflation (surfactant biophysics, recruitment/derecruitment, connective tissue friction)"
]))
story.append(cite("Miller's 10e p.5532 | Barash 9e p.1107"))

story.append(h2("3d. Elastance"))
story.append(formula("Elastance = 1/Compliance"))
story.append(formula("E_RS = E_L + E_CW   (elastances add in series)"))
story.append(p("Conditions that <b>increase elastance</b> (decrease compliance):"))
story.append(bullet([
    "Consolidation, pulmonary edema, pneumothorax",
    "Atelectasis, interstitial disease, pneumonectomy",
    "Lung overdistention, mainstem intubation"
]))
story.append(cite("Miller's 10e p.5519"))

story.append(h2("3e. Static vs Dynamic Compliance"))
story.append(make_table(
    ["Type", "Condition", "Formula", "Reflects"],
    [
        ["Static C", "Zero flow (end-insp. pause)", "Vt / (Pplateau − PEEP)", "Elastic properties only"],
        ["Dynamic C", "During rhythmic breathing", "Vt / (Ppeak − PEEP)", "Elastic + resistive properties"],
    ],
    col_widths=[3.5*cm, 4.5*cm, 5*cm, W - 13*cm]
))
story.append(p("<b>Dynamic compliance ≤ Static compliance</b> always."))

# ---- SECTION 4: DRIVING PRESSURE ----
story.append(h1("4. Driving Pressure"))
story.append(formula("Driving Pressure (ΔP) = Plateau Pressure − PEEP = Vt / C_RS"))
story.append(Paragraph(
    "<b>Key concept (Barash):</b> Driving pressure is a surrogate for <b>global lung strain</b> — a marker of VILI and predictor of mortality in ARDS. "
    "It accounts for pre-existing lung characteristics better than tidal volume alone.",
    keypoint_style
))
story.append(bullet([
    "Lower intraoperative driving pressures → lower rates of postoperative pulmonary complications",
    "During thoracic surgery, minimizing driving pressure outperforms standard ventilation targets",
    "Arbitrary reduction in Vt when driving pressure is already low may cause atelectasis and dyssynchrony"
]))
story.append(cite("Barash 9e p.1112"))

# ---- SECTION 5: NONELASTIC RESISTANCE ----
story.append(h1("5. Nonelastic Resistance"))

story.append(h2("5a. Airway Resistance"))
story.append(formula("Airway Resistance (R) = ΔPressure / Flow (V̇)"))
story.append(formula("Normal total airway resistance: 0.5–2 cm H₂O/L/s"))
story.append(p("Distribution of resistance in the tracheobronchial tree:"))
story.append(bullet([
    "<b>Large bronchi</b>: low resistance (large diameters)",
    "<b>Medium bronchi (before 7th generation)</b>: highest resistance — largest contributor",
    "<b>Small bronchi</b>: low resistance (large total cross-sectional area)"
]))

story.append(h3("Laminar vs Turbulent Flow"))
story.append(make_table(
    ["Flow Type", "Reynolds Number", "Resistance Formula", "Notes"],
    [
        ["Laminar", "< 1000", "R = 8ηl/πr⁴ (Hagen-Poiseuille)\nR ∝ 1/r⁴", "Normally only distal to bronchioles < 1mm"],
        ["Turbulent", "> 1500", "R ∝ density / r⁵", "Larger airways; gas density critical"],
        ["Transitional", "1000–1500", "Mixed", "Branching points, bends"],
    ],
    col_widths=[3*cm, 3*cm, 5*cm, W - 11*cm]
))
story.append(formula("Reynolds number = (Linear velocity × Diameter × Gas density) / Gas viscosity"))
story.append(p(
    "<b>Clinical implication:</b> Helium-O₂ (heliox) has a lower density-to-viscosity ratio than air or O₂, "
    "reducing turbulent flow and airway resistance in upper airway obstruction."
))
story.append(formula("Bedside measurement:  R = (Ppeak − Pplateau) / V̇_I"))
story.append(cite("Morgan & Mikhail 7e p.928–929 | Barash 9e p.1115 | Miller's 10e p.5519"))

story.append(h3("Volume-Related Airway Collapse"))
story.append(p(
    "At low lung volumes, radial traction on small airways is reduced → airway resistance becomes <b>inversely proportional to lung volume</b>. "
    "Increasing lung volume with PEEP reduces airway resistance."
))

story.append(h3("Flow-Related Airway Collapse (Dynamic Compression)"))
story.append(p(
    "During <b>forced exhalation</b>, positive pleural pressure + large pressure drops across intrathoracic airways → dynamic airway compression. "
    "The terminal portion of the flow-volume curve is <b>effort-independent</b> beyond the equal pressure point."
))

story.append(h2("5b. Tissue Resistance"))
story.append(Paragraph(
    "Often overlooked, tissue resistance may account for <b>up to 50% of total airway resistance</b>. "
    "In adults, lung tissue resistance comprises about <b>60% of subglottal total lung resistance</b> at typical breathing rates. "
    "It arises from viscoelastic (frictional) resistance of lung and chest wall tissues during deformation. "
    "Unlike airway resistance, tissue resistance varies <b>inversely with breathing frequency</b> (property of viscoelastic materials).",
    keypoint_style
))
story.append(cite("Morgan & Mikhail 7e p.933 | Miller's 10e p.5519"))

story.append(h2("5c. Common Causes of Increased Airway Resistance"))
story.append(make_table(
    ["Category", "Examples"],
    [
        ["Bronchospasm", "Asthma, anaphylaxis, airway irritation"],
        ["Secretions / mucosal edema", "Infection, aspiration, allergic reaction"],
        ["Volume-related", "Low FRC, atelectasis — radial traction lost"],
        ["Flow-related collapse", "Forced expiration, obesity, pneumothorax"],
        ["Anatomical obstruction", "Posterior tongue, laryngospasm, tumor, edema"],
        ["Equipment issues", "Kinked/small ETT, valve malfunction, circuit obstruction"],
    ],
    col_widths=[5*cm, W - 5*cm]
))

# ---- SECTION 6: WORK OF BREATHING ----
story.append(h1("6. Work of Breathing"))
story.append(formula("Work = Pressure × Volume   (expressed in J/L; 1 J = 1 L moved across 10 cmH₂O)"))
story.append(p("Three components that must be overcome during ventilation:"))
story.append(bullet([
    "<b>Elastic recoil</b> of the chest and lung (~50% of energy stored as potential energy, released during passive expiration)",
    "<b>Frictional resistance to airflow</b>",
    "<b>Tissue frictional resistance</b>"
]))
story.append(p(
    "Respiratory muscles normally consume <b>2–3% of total O₂</b> but operate at only <b>~10% efficiency</b> "
    "(90% dissipated as heat). In pathological states, efficiency decreases further."
))
story.append(h3("Adaptive Breathing Patterns"))
story.append(make_table(
    ["Condition", "Adaptive Pattern", "Why"],
    [
        ["Reduced compliance (stiff lung)", "Rapid, shallow breathing", "Minimizes elastic work per breath"],
        ["Increased airway resistance", "Slow, deep breathing", "Minimizes flow-resistive work"],
        ["Excessive expiratory resistance", "Increased FRC / accessory muscles", "Stored elastic energy drives expiration"],
    ],
    col_widths=[5.5*cm, 5*cm, W - 10.5*cm]
))
story.append(p(
    "<b>Mechanical Power</b> = Work per unit time (J/min); incorporates respiratory rate and flow. "
    "Excess mechanical power drives ventilator-induced lung injury (VILI) via energy transfer to tissues."
))
story.append(cite("Morgan & Mikhail 7e p.934–935 | Barash 9e p.1106"))

# ---- SECTION 7: EFFECTS OF ANESTHESIA ----
story.append(PageBreak())
story.append(h1("7. Effects of Anesthesia on Pulmonary Mechanics"))

story.append(h2("7a. Effects on FRC and Lung Volumes"))
story.append(Paragraph(
    "Changes in lung mechanics occur <b>almost immediately after induction</b> of general anesthesia.",
    keypoint_style
))
story.append(make_table(
    ["Event", "FRC Change"],
    [
        ["Supine position alone", "↓ 0.8–1.0 L"],
        ["Induction of GA (supine)", "Further ↓ 0.4–0.5 L"],
        ["Total combined reduction (vs. upright awake)", "~1.0–1.5 L"],
    ],
    col_widths=[9*cm, W - 9*cm]
))
story.append(h3("Mechanisms of FRC Reduction"))
story.append(bullet([
    "<b>Loss of inspiratory muscle tone</b> → diaphragm shifts cephalad (especially dorsal portion in supine)",
    "<b>Change in chest wall rigidity</b> — loss of tone reduces outward expansion",
    "<b>Compression atelectasis</b> — increased regional pleural pressure collapses alveoli",
    "<b>Increased intrathoracic blood volume</b>",
    "<b>Thoracic spine becomes more lordotic</b>; rib cage moves inward"
]))
story.append(h3("Key Points about FRC Changes"))
story.append(bullet([
    "FRC reduction is <b>NOT related to anesthetic depth</b>",
    "May <b>persist for hours to days</b> after anesthesia",
    "Steep <b>Trendelenburg (&gt;30°)</b> reduces FRC further",
    "Induction in the <b>sitting position</b> has little effect on FRC",
    "<b>Muscle paralysis alone does not significantly change FRC</b> in already-anesthetized patients"
]))
story.append(cite("Morgan & Mikhail 7e p.936 | Barash 9e p.1113"))

story.append(h2("7b. Atelectasis Under Anesthesia"))
story.append(Paragraph(
    "<b>Atelectasis under anesthesia is universal</b> — it occurs with any anesthetic (IV or inhalational), "
    "spontaneous or controlled ventilation, and in healthy or sick lungs.",
    keypoint_style
))
story.append(bullet([
    "Up to <b>one-fifth of normally aerated lung</b> can collapse (visible on CT)",
    "Persists in most patients during recovery → prolongs hypoxemia",
    "Can persist <b>weeks to months</b> after median sternotomy for cardiac surgery"
]))
story.append(h3("Two Mechanisms of Atelectasis"))
story.append(make_table(
    ["Mechanism", "Description", "Worsened By"],
    [
        ["Compressive", "Increased regional pleural pressure (gravity-dependent) collapses alveoli without positive distending pressure; diaphragm cephalad shift", "Obesity, Trendelenburg, NMB, pneumoperitoneum"],
        ["Resorption", "Gas flow out of alveoli exceeds inflow when distal airways close", "High FiO₂, low FRC, airway closure"],
    ],
    col_widths=[3.5*cm, 7*cm, W - 10.5*cm]
))
story.append(cite("Barash 9e p.1113–1114"))

story.append(h2("7c. Effects on Compliance"))
story.append(Paragraph(
    "<b>Barash Key Point #4:</b> Anesthesia results in <b>smaller and stiffer lungs</b>, primarily due to atelectasis. "
    "Trendelenburg position, obesity, and pneumoperitoneum further reduce respiratory system compliance.",
    keypoint_style
))
story.append(make_table(
    ["Condition", "Compliance Effect", "Key Mechanism"],
    [
        ["Obesity", "↓↓ C_L more than C_CW", "CW PV curve shifts right; lung compliance disproportionately reduced"],
        ["Pneumoperitoneum", "↓ C_CW, C_L relatively preserved", "Changed thoracic cavity shape"],
        ["Trendelenburg position", "↓ FRC → ↓ compliance", "Abdominal contents compress diaphragm"],
        ["PEEP application", "↑ compliance (up to UIP)", "Alveolar recruitment; restores FRC"],
        ["ARDS", "↓↓ C_L", "Inflammation, edema, atelectasis"],
        ["COPD (emphysema)", "↑ C_L, ↑ resistance", "Destruction of elastic tissue; hyperinflation"],
    ],
    col_widths=[4*cm, 5*cm, W - 9*cm]
))
story.append(p(
    "<b>Esophageal pressure monitoring</b> (esophageal balloon catheter) allows separate determination of C_L and C_CW — "
    "useful for distinguishing 'lung problem' from 'chest wall problem' in low compliance states. "
    "Used to guide PEEP titration: target end-expiratory P_L of 0–5 cmH₂O."
))
story.append(cite("Morgan & Mikhail 7e p.936–937 | Barash 9e p.1113–1114"))

story.append(h2("7d. Effects on Airway Resistance"))
story.append(p("Net effect of anesthesia on airway resistance reflects two competing forces:"))
story.append(make_table(
    ["Force", "Direction", "Effect on Resistance"],
    [
        ["FRC reduction", "↓ FRC", "Would ↑ resistance (reduced radial traction)"],
        ["Bronchodilating properties of volatile agents", "↑ airway diameter", "↓ resistance"],
        ["Net result (volatile anesthesia)", "Balance", "Usually no net increase in resistance"],
    ],
    col_widths=[6*cm, 3*cm, W - 9*cm]
))
story.append(h3("Three Mechanisms by Which Anesthesia Influences Resistance (Barash)"))
story.append(bullet([
    "<b>Changes in airway diameter</b>: propofol inhibits genioglossus → upper airway collapse; glottic narrowing in laryngospasm; bronchial smooth muscle contraction with stimulation",
    "<b>Changes in lung volume</b>: reduced FRC narrows bronchioles (altered radial stress); closing capacity rises with age",
    "<b>Changes in gas flow</b>: Bernoulli effect — high intrathoracic pressure (obesity, pneumothorax) → flow-related collapse"
]))
story.append(h3("Common Causes of Increased Resistance Under Anesthesia"))
story.append(bullet([
    "Posterior displacement of the tongue",
    "Laryngospasm",
    "Bronchoconstriction (especially without volatile agents)",
    "Secretions, blood, or tumor in the airway",
    "Equipment problems: small/kinked ETT, valve malfunction, circuit obstruction"
]))
story.append(p(
    "<b>Miller's:</b> Volatile anesthetics reduce upper airway resistance at low concentrations via bronchomotor tone changes, "
    "with a <b>ceiling effect</b> — low concentrations are most effective."
))
story.append(cite("Morgan & Mikhail 7e p.937 | Barash 9e p.1119 | Miller's 10e p.1120"))

story.append(h2("7e. Intrinsic PEEP (Auto-PEEP) Under Anesthesia"))
story.append(formula("Expiratory Time Constant (τ) = Resistance × Compliance"))
story.append(formula("Example: R = 10 cmH₂O/L/s, C = 0.05 L/cmH₂O  →  τ = 0.5 sec"))
story.append(formula("~3 time constants required for complete exhalation (~95% of Vt)"))
story.append(p(
    "Intrinsic PEEP = any additional end-expiratory pressure beyond what is applied. Occurs when exhalation is incomplete. "
    "High intrinsic PEEP → hyperinflation → ↑ airway pressures → ↓ venous return → <b>systemic hypotension</b>."
))
story.append(bullet([
    "Detected on ventilator flow-time curve when <b>expiratory flow does not return to zero</b> before the next breath",
    "Also manifests as unexpected decrease in C_RS, elevated airway pressures, or hypotension",
    "Risk factors: asthma, COPD (high resistance), ARDS (low compliance), high respiratory rates"
]))
story.append(cite("Barash 9e p.1119–1120"))

story.append(h2("7f. Effects on Work of Breathing"))
story.append(Paragraph(
    "Increases in work of breathing under anesthesia are most often secondary to <b>reduced lung and chest wall compliance</b> "
    "and, less commonly, increases in airway resistance. "
    "These problems are usually addressed with <b>controlled mechanical ventilation</b> (Morgan & Mikhail 7e p.937).",
    keypoint_style
))
story.append(p(
    "<b>Miller's Key Point:</b> Respiratory work is increased during anesthesia as a consequence of reduced respiratory compliance and increased airway resistance."
))

story.append(h2("7g. Effects on Respiratory Pattern"))
story.append(bullet([
    "<b>Light anesthesia</b>: irregular breathing, breath-holding common",
    "<b>Deeper anesthesia</b>: regular breathing returns",
    "Inhalation agents in increasing respiratory depression: halothane < isoflurane/enflurane < desflurane/sevoflurane"
]))

# ---- SECTION 8: SPECIAL SCENARIOS ----
story.append(h1("8. Special Scenarios Affecting Lung Mechanics"))
story.append(make_table(
    ["Scenario", "Compliance", "Resistance", "Key Mechanism"],
    [
        ["Obesity", "↓↓ C_L > C_CW", "↑ (airway collapse)", "CW PV curve right-shift; ↑ abdominal pressure"],
        ["Pneumoperitoneum", "↓ C_CW, C_L spared", "Variable", "Thoracic shape change; ↑ Ppl"],
        ["Trendelenburg", "↓ (FRC ↓)", "↑ (FRC ↓)", "Abdominal contents compress diaphragm"],
        ["PEEP", "↑ (up to UIP)", "↓ (FRC ↑)", "Alveolar recruitment"],
        ["ARDS", "↓↓", "Variable", "Inflammation, edema, atelectasis"],
        ["COPD", "↑ C_L (emphysema)", "↑↑", "Loss of elastic tissue; hyperinflation"],
        ["Interstitial fibrosis", "↓↓", "Normal/↑", "Fibrosis replaces elastic tissue"],
        ["Prone position", "↑ C_RS vs supine", "Minimal change", "Better diaphragm mechanics, ↓ atelectasis"],
    ],
    col_widths=[4*cm, 3*cm, 3*cm, W - 10*cm]
))

# ---- SECTION 9: KEY NUMBERS ----
story.append(h1("9. Key Clinical Numbers — Quick Reference"))
story.append(make_table(
    ["Parameter", "Normal Value"],
    [
        ["Lung compliance (C_L)", "150–200 mL/cm H₂O"],
        ["Chest wall compliance (C_W)", "200 mL/cm H₂O"],
        ["Total respiratory system compliance (C_RS)", "~100 mL/cm H₂O"],
        ["Normal airway resistance", "0.5–2 cm H₂O/L/s"],
        ["Transpulmonary pressure at end-expiration", "+5 cm H₂O"],
        ["Intrapleural pressure at end-expiration", "−5 cm H₂O"],
        ["FRC reduction: supine position", "↓ 0.8–1.0 L"],
        ["FRC reduction: induction of GA", "Additional ↓ 0.4–0.5 L"],
        ["Respiratory muscle O₂ consumption (normal)", "2–3% of total"],
        ["Respiratory muscle efficiency", "~10%"],
        ["Reynolds number — laminar flow", "< 1000"],
        ["Reynolds number — turbulent flow", "> 1500"],
        ["Tissue resistance contribution", "Up to 50% of total airway resistance"],
    ],
    col_widths=[11*cm, W - 11*cm]
))

# ---- SECTION 10: SUMMARY KEY POINTS ----
story.append(h1("10. Summary — Barash Key Points"))
kp_data = [
    ("1", "Elastic and resistive forces are the major impedances to air delivery into the lungs."),
    ("2", "FRC has a key role in determining oxygen reserves, propensity to atelectasis, and biologic effects of mechanical ventilation."),
    ("3", "Driving pressure is a surrogate for global lung strain. Higher values are associated with increased risk of postoperative pulmonary complications."),
    ("4", "Anesthesia results in smaller and stiffer lungs, primarily due to atelectasis. Trendelenburg position, obesity, and pneumoperitoneum further reduce respiratory system compliance."),
    ("5", "Ventilation-perfusion mismatch is common during anesthesia. Shunt physiology (atelectasis) is the primary etiology of hypoxemia and can be addressed with restoration of end-expiratory lung volume."),
    ("6", "Dead space volume increases during anesthesia. Instrumental dead space from breathing devices can be significant."),
    ("7", "Multidisciplinary perioperative pulmonary rehabilitation improves pulmonary outcomes in high-risk individuals."),
]
for num, text in kp_data:
    story.append(Paragraph(f"<b>{num}.</b> &nbsp; {text}", keypoint_style))
    story.append(Spacer(1, 3))
story.append(cite("Barash Clinical Anesthesia 9e, Key Points p.1103"))

# ---- FOOTER / REFERENCES ----
story.append(Spacer(1, 0.5*cm))
story.append(hr())
story.append(h2("References"))
story.append(bullet([
    "Miller RD et al. <i>Miller's Anesthesia</i>, 10th Edition. Elsevier, 2023. ISBN: 9780323935920.",
    "Morgan GE, Mikhail MS. <i>Morgan & Mikhail's Clinical Anesthesiology</i>, 7th Edition. McGraw-Hill, 2022. ISBN: 9781260473797.",
    "Barash PG et al. <i>Barash, Cullen, and Stoelting's Clinical Anesthesia</i>, 9th Edition. Lippincott, 2022. ISBN: 9781975199074.",
]))

# ============================================================
# BUILD
# ============================================================
doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /home/daytona/workspace/lung-mechanics-pdf && python3 generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/lung-mechanics-pdf/Lung_Mechanics_Anesthesia.pdf

Your PDF is ready. Here's the download link:

Lung Mechanics Anesthesia

PDF Document · PDF

The PDF includes all 10 sections with clean formatting, color-coded headers, and structured tables:
  1. Equation of Motion - foundation formula with symbol key
  2. Lung Mechanics Overview - elastic vs nonelastic impedance
  3. Elastic Resistance - Laplace's law, compliance formulas, PV curve, elastance, static vs dynamic compliance
  4. Driving Pressure - clinical significance and lung-protective ventilation
  5. Nonelastic Resistance - airway resistance, laminar/turbulent flow, volume/flow-related collapse, tissue resistance
  6. Work of Breathing - components, adaptive patterns, mechanical power
  7. Effects of Anesthesia - FRC changes, atelectasis mechanisms, compliance, airway resistance, intrinsic PEEP, work of breathing, respiratory pattern
  8. Special Scenarios - obesity, pneumoperitoneum, Trendelenburg, ARDS, COPD, prone position
  9. Key Clinical Numbers - quick reference table
  10. Summary Key Points - Barash's 7 key points + full references (Miller's, Morgan, Barash)

Make a pdf downloadable of all this

Running Command

ls -lh /home/daytona/workspace/lung-mechanics-pdf/Lung_Mechanics_Anesthesia.pdf

The PDF from the previous session is still available. Click below to download:

Lung Mechanics Anesthesia

PDF Document · PDF

This is the same comprehensive PDF covering all 10 sections - Equation of Motion, Elastic Resistance, Compliance, Elastance, Driving Pressure, Airway Resistance, Tissue Resistance, Work of Breathing, Effects of Anesthesia on pulmonary mechanics, and the Key Clinical Numbers table - all sourced from Miller's 10e, Morgan & Mikhail 7e, and Barash 9e.
This is a shared conversation. Sign in to Orris to start your own chat.