Physiology padha de English me

Asking for Preferences
Asking for Preferences
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Loading Image
Loading Image
Ab main aapko ek clear, well-structured lecture-style explanation doonga. Sources: Guyton & Hall (the gold standard) and Neuroscience: Exploring the Brain.

Action Potential & Nerve Conduction

Sources: Guyton & Hall Textbook of Medical Physiology | Neuroscience: Exploring the Brain, 5th Ed.

1. Resting Membrane Potential (Background)

Before an action potential fires, the neuron sits at a resting membrane potential of -70 mV - inside is negative relative to outside. This is maintained by:
  • The Na⁺-K⁺ pump (3 Na⁺ out, 2 K⁺ in per cycle)
  • K⁺ leak channels (K⁺ leaks out, making inside more negative)
  • Na⁺ is high outside, K⁺ is high inside
This state is called polarization.

2. What is an Action Potential?

An action potential is a rapid, transient reversal of membrane potential - from -70 mV to approximately +35 mV - that travels along the nerve fiber membrane to carry a signal.
Think of it as an electrical "spike" that sweeps down the axon like a flame along a fuse.
Action potential graph showing resting, depolarization, overshoot, repolarization, and hyperpolarization phases

3. Phases of the Action Potential

Phase 1 - Resting Stage (-70 mV)

  • Membrane is polarized
  • Activation gates of Na⁺ channels: CLOSED
  • K⁺ channels: mostly closed

Phase 2 - Depolarization

  • A stimulus brings the membrane potential to threshold (~-55 mV, roughly 15 mV above resting)
  • At threshold, voltage-gated Na⁺ channels snap open - sodium permeability increases 500 to 5000-fold
  • Na⁺ rushes IN (because it is both electrically and chemically attracted inward)
  • Membrane potential shoots up rapidly to +35 mV (overshoot)

Phase 3 - Repolarization

  • Within a fraction of a millisecond, the inactivation gate of Na⁺ channels closes (slower gate)
  • Simultaneously, voltage-gated K⁺ channels open (delayed)
  • K⁺ rushes OUT, pulling the potential back toward -70 mV
  • The membrane repolarizes

Phase 4 - Hyperpolarization (Undershoot)

  • K⁺ channels may stay open slightly too long
  • Membrane dips briefly below -70 mV (to about -80 mV)
  • Returns to resting once K⁺ channels close

4. The Voltage-Gated Channels (Key Mechanism)

Sodium Channel - Two Gates

GateLocationAt RestDuring Depolarization
Activation gateOutside of channelCLOSEDOpens fast
Inactivation gateInside of channelOPENCloses slow (after a few 10,000ths of a sec)
The activation gate opens fast when threshold is reached. The inactivation gate closes slowly - this is why the Na⁺ channel cannot stay open indefinitely and the AP terminates. The inactivation gate will NOT reopen until the membrane returns near -70 mV.

Potassium Channel - One Gate

  • Opens delayed compared to Na⁺ channel
  • Stays open during repolarization
  • Responsible for driving the membrane back to negative and causing hyperpolarization

5. Refractory Periods

PeriodTimingMechanismCan Another AP Fire?
Absolute Refractory PeriodDuring depolarization & early repolarizationNa⁺ channel inactivation gates are closed - cannot reopenNo, impossible
Relative Refractory PeriodLate repolarization / hyperpolarizationNa⁺ channels recovering + K⁺ channels still openOnly with a stronger-than-normal stimulus
Clinical point: The refractory period ensures APs travel in one direction only - the membrane just behind is refractory, so the impulse cannot turn back on itself.

6. All-or-Nothing Law

An action potential either fires completely or not at all:
  • Subthreshold stimulus → no AP
  • Threshold stimulus → full AP (always the same amplitude and duration)
  • Superthreshold → same full AP (not bigger)
The frequency of firing (not the size) encodes stimulus intensity.

7. Propagation of the Action Potential (Conduction)

Once an AP fires at one point:
  1. Na⁺ rushes in, and positive charge spreads inside the axon to the adjacent segment
  2. That segment reaches threshold → its Na⁺ channels open → another AP fires there
  3. This continues down the axon to the axon terminal
The propagation is self-regenerating - like a burning fuse, each section reignites the next. Conduction is without decrement (the AP does not fade as it travels).

8. Myelination & Saltatory Conduction

Saltatory conduction diagram showing action potential jumping node to node along myelinated axon

The Problem with Thick Unmyelinated Axons

  • Thick axons conduct faster BUT take up enormous space
  • To achieve the same speeds via size, the human brain would be impossibly large

The Solution: Myelin

The myelin sheath (made by Schwann cells in PNS, oligodendrocytes in CNS) wraps the axon in many layers of membrane. This:
  • Acts as electrical insulation
  • Reduces membrane capacitance 50-fold
  • Forces ionic current to flow down the inside of the axon rather than leaking out
Gaps in the myelin sheath are called Nodes of Ranvier (just 1-2 μm long). Voltage-gated Na⁺ channels are concentrated at the nodes.

Saltatory Conduction (AP "jumps" node to node)

  • Action potentials only occur AT the nodes
  • Electrical current flows down the axoplasm from one node, skipping the myelinated internodes (which can be 0.2-2.0 mm long)
  • The AP jumps from node to node ("saltare" = to leap in Latin)
Two advantages of saltatory conduction:
  1. Speed - conduction velocity increases 5 to 50-fold compared to unmyelinated fibers
  2. Energy efficiency - only nodes depolarize, so ~100x fewer ions cross the membrane → much less work for the Na⁺-K⁺ pump to restore gradients

9. Conduction Velocity - Quick Reference

Fiber TypeMyelinated?DiameterVelocityFunction
YesLarge70-120 m/sMotor, proprioception
YesMedium30-70 m/sTouch, pressure
YesSmall5-30 m/sFast pain, temperature
CNoVery small0.25-2 m/sSlow pain, post-ganglionic autonomic
Rule: Larger diameter + myelination = faster conduction.

10. Clinical Connections

DiseaseEffect
Multiple SclerosisDemyelination in CNS → slowed/blocked conduction → weakness, sensory loss, vision problems
Guillain-Barré SyndromeDemyelination in PNS → ascending paralysis
Local Anesthetics (lidocaine)Block voltage-gated Na⁺ channels → prevent AP generation
Tetrodotoxin (puffer fish toxin)Binds Na⁺ channel and blocks it completely → lethal paralysis

Summary Flow Chart

Stimulus → Threshold (-55 mV) reached
         ↓
Na⁺ channels OPEN → Na⁺ rushes IN → Depolarization (+35 mV)
         ↓
Na⁺ inactivation gate CLOSES + K⁺ channels OPEN
         ↓
K⁺ rushes OUT → Repolarization → slight Hyperpolarization
         ↓
Channels close → Returns to Resting (-70 mV)
         ↓
Positive charge spreads ahead → Next patch reaches threshold
         ↓
In myelinated fiber → jumps node to node (SALTATORY CONDUCTION)

Koi bhi concept aur detail mein samajhna ho - channels ka structure, Hodgkin-Huxley model, or specific fiber types - bas batao. Next topic bhi select kar sakte ho (Synaptic Transmission, ANS, Motor System, etc.).

Pdf bna de iska

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Running Command

mkdir -p /home/daytona/workspace/physiology-notes && python3 -c "import reportlab; print('reportlab ok')" && python3 -c "import requests; print('requests ok')"

Writing File

~/physiology-notes/make_pdf.py


import requests
import io
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, Image as RLImage, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak

OUTPUT = "/home/daytona/workspace/physiology-notes/Action_Potential_Nerve_Conduction.pdf"

# ── Download images ──────────────────────────────────────────────────────────
def fetch_img(url, w, h):
    try:
        r = requests.get(url, timeout=15)
        r.raise_for_status()
        img = RLImage(io.BytesIO(r.content), width=w, height=h)
        return img
    except Exception as e:
        print(f"Image fetch failed: {e}")
        return None

IMG1_URL = "https://cdn.orris.care/cdss_images/d94d1eff4e1e7deebae6a16401025c4414dfcf32575f90b2e8587903be7295e4.png"
IMG2_URL = "https://cdn.orris.care/cdss_images/b61f34b5754003354302b76eb2d667acf732d573516191012860d18030ecf674.png"
IMG3_URL = "https://cdn.orris.care/cdss_images/150062db498e2e091d3d9253c4c0a710dcf58e071a9728fee0e79f73822da727.png"

# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

BRAND   = colors.HexColor("#1a3a5c")   # dark navy
ACCENT  = colors.HexColor("#2e7bcf")   # bright blue
LIGHT   = colors.HexColor("#e8f0fb")   # pale blue bg
YELLOW  = colors.HexColor("#fff8e1")   # highlight bg
GREEN   = colors.HexColor("#e8f5e9")   # tip bg
RED_BG  = colors.HexColor("#fce4ec")   # clinical box bg
DARKRED = colors.HexColor("#b71c1c")

title_style = ParagraphStyle(
    "Title", fontName="Helvetica-Bold", fontSize=22,
    textColor=colors.white, alignment=TA_CENTER,
    spaceAfter=4, leading=28
)
subtitle_style = ParagraphStyle(
    "Subtitle", fontName="Helvetica", fontSize=11,
    textColor=colors.HexColor("#cce0ff"), alignment=TA_CENTER,
    spaceAfter=2
)
h1 = ParagraphStyle(
    "H1", fontName="Helvetica-Bold", fontSize=14,
    textColor=BRAND, spaceBefore=14, spaceAfter=4,
    borderPad=4, leading=18
)
h2 = ParagraphStyle(
    "H2", fontName="Helvetica-Bold", fontSize=11,
    textColor=ACCENT, spaceBefore=8, spaceAfter=3, leading=15
)
body = ParagraphStyle(
    "Body", fontName="Helvetica", fontSize=10,
    textColor=colors.HexColor("#1a1a1a"), leading=15,
    spaceAfter=5, alignment=TA_JUSTIFY
)
bullet = ParagraphStyle(
    "Bullet", fontName="Helvetica", fontSize=10,
    textColor=colors.HexColor("#1a1a1a"), leading=14,
    leftIndent=16, bulletIndent=4, spaceAfter=3
)
code_style = ParagraphStyle(
    "Code", fontName="Courier", fontSize=9,
    textColor=colors.HexColor("#003366"),
    backColor=LIGHT, leading=13, leftIndent=10, spaceAfter=2,
    borderPad=6
)
caption = ParagraphStyle(
    "Caption", fontName="Helvetica-Oblique", fontSize=9,
    textColor=colors.gray, alignment=TA_CENTER, spaceAfter=8
)
source_style = ParagraphStyle(
    "Source", fontName="Helvetica-Oblique", fontSize=8,
    textColor=colors.HexColor("#5c5c5c"), alignment=TA_CENTER
)

# ── Helper functions ──────────────────────────────────────────────────────────
def section_bar(text):
    """Blue banner heading."""
    data = [[Paragraph(text, ParagraphStyle("SB", fontName="Helvetica-Bold",
                fontSize=13, textColor=colors.white, leading=16))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), BRAND),
        ("TOPPADDING",   (0,0), (-1,-1), 6),
        ("BOTTOMPADDING",(0,0), (-1,-1), 6),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
        ("ROUNDEDCORNERS", [4]),
    ]))
    return t

def info_box(text, bg=LIGHT, border=ACCENT):
    data = [[Paragraph(text, ParagraphStyle("IB", fontName="Helvetica", fontSize=10,
                textColor=BRAND, leading=14))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("BOX",        (0,0), (-1,-1), 1.5, border),
        ("TOPPADDING",    (0,0),(-1,-1), 8),
        ("BOTTOMPADDING", (0,0),(-1,-1), 8),
        ("LEFTPADDING",   (0,0),(-1,-1), 12),
    ]))
    return t

def clinical_box(text):
    data = [[Paragraph("🩺  CLINICAL RELEVANCE", ParagraphStyle("CH",
                fontName="Helvetica-Bold", fontSize=10,
                textColor=DARKRED, leading=14))],
            [Paragraph(text, ParagraphStyle("CB", fontName="Helvetica",
                fontSize=10, textColor=colors.HexColor("#1a1a1a"),
                leading=14))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(0,0), RED_BG),
        ("BACKGROUND", (0,1),(0,1), colors.HexColor("#fff8f8")),
        ("BOX",        (0,0),(-1,-1), 1.5, DARKRED),
        ("TOPPADDING",    (0,0),(-1,-1), 7),
        ("BOTTOMPADDING", (0,0),(-1,-1), 7),
        ("LEFTPADDING",   (0,0),(-1,-1), 12),
    ]))
    return t

def memory_tip(text):
    data = [[Paragraph("💡  MEMORY TIP", ParagraphStyle("MT",
                fontName="Helvetica-Bold", fontSize=10,
                textColor=colors.HexColor("#e65100"), leading=14))],
            [Paragraph(text, ParagraphStyle("MB", fontName="Helvetica",
                fontSize=10, textColor=colors.HexColor("#1a1a1a"),
                leading=14))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(0,0), colors.HexColor("#fff3e0")),
        ("BACKGROUND", (0,1),(0,1), YELLOW),
        ("BOX",        (0,0),(-1,-1), 1.5, colors.HexColor("#e65100")),
        ("TOPPADDING",    (0,0),(-1,-1), 7),
        ("BOTTOMPADDING", (0,0),(-1,-1), 7),
        ("LEFTPADDING",   (0,0),(-1,-1), 12),
    ]))
    return t

def make_table(headers, rows, col_widths=None):
    if col_widths is None:
        n = len(headers)
        col_widths = [17*cm/n]*n
    data = [headers] + rows
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",  (0,0),(-1,0), BRAND),
        ("TEXTCOLOR",   (0,0),(-1,0), colors.white),
        ("FONTNAME",    (0,0),(-1,0), "Helvetica-Bold"),
        ("FONTSIZE",    (0,0),(-1,-1), 9),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, LIGHT]),
        ("GRID",        (0,0),(-1,-1), 0.5, colors.HexColor("#c0c8d8")),
        ("TOPPADDING",  (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING", (0,0),(-1,-1), 7),
        ("ALIGN",       (0,0),(-1,-1), "LEFT"),
        ("VALIGN",      (0,0),(-1,-1), "MIDDLE"),
    ]))
    return t

# ── Cover page elements ───────────────────────────────────────────────────────
def cover_table():
    content = [
        Paragraph("PHYSIOLOGY NOTES", ParagraphStyle("CT", fontName="Helvetica",
            fontSize=12, textColor=colors.HexColor("#8fbfff"),
            alignment=TA_CENTER, spaceAfter=6)),
        Paragraph("Action Potential &<br/>Nerve Conduction", title_style),
        Spacer(1, 0.3*cm),
        Paragraph("Nervous System Physiology", subtitle_style),
        Spacer(1, 0.5*cm),
        Paragraph("Sources: Guyton &amp; Hall Textbook of Medical Physiology |<br/>"
                  "Neuroscience: Exploring the Brain, 5th Ed.", source_style),
    ]
    data = [[c] for c in content]
    t = Table([[content[0]], [content[1]], [content[2]], [content[3]], [content[4]]],
              colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), BRAND),
        ("TOPPADDING",    (0,0),(-1,-1), 10),
        ("BOTTOMPADDING", (0,0),(-1,-1), 10),
        ("LEFTPADDING",   (0,0),(-1,-1), 20),
        ("RIGHTPADDING",  (0,0),(-1,-1), 20),
        ("ROUNDEDCORNERS", [6]),
    ]))
    return t

# ── Build story ───────────────────────────────────────────────────────────────
story = []

# COVER
story.append(Spacer(1, 1*cm))
story.append(cover_table())
story.append(Spacer(1, 0.8*cm))
story.append(HRFlowable(width="100%", thickness=2, color=ACCENT))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 1: Resting Membrane Potential ────────────────────────────────────
story.append(section_bar("1.  Resting Membrane Potential (Background)"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "Before an action potential fires, the neuron sits at a resting membrane potential of "
    "<b>-70 mV</b> — inside is negative relative to outside. This state is called <b>polarization</b>.",
    body))
story.append(Paragraph("Maintained by:", h2))
for item in [
    "<b>Na⁺-K⁺ pump:</b> Pumps 3 Na⁺ out and 2 K⁺ in per cycle (electrogenic, net negative inside)",
    "<b>K⁺ leak channels:</b> K⁺ leaks out along its concentration gradient, making inside more negative",
    "<b>Ionic distribution:</b> Na⁺ is high outside; K⁺ is high inside",
]:
    story.append(Paragraph(f"• {item}", bullet))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 2: What is an Action Potential ───────────────────────────────────
story.append(section_bar("2.  What is an Action Potential?"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "An action potential is a <b>rapid, transient reversal of membrane potential</b> — from "
    "-70 mV to approximately +35 mV — that travels along the nerve fiber membrane to carry a signal.",
    body))
story.append(info_box(
    "Think of it as an electrical 'spike' that sweeps down the axon like a flame along a fuse. "
    "The impulse is self-regenerating — it does not fade as it travels (conduction without decrement).",
    bg=LIGHT, border=ACCENT
))
story.append(Spacer(1, 0.3*cm))

img1 = fetch_img(IMG1_URL, 9.5*cm, 12*cm)
if img1:
    img1.hAlign = "CENTER"
    story.append(KeepTogether([
        img1,
        Paragraph(
            "Figure 1. Typical action potential recorded from a nerve fiber. "
            "Shows resting (-70 mV), depolarization, overshoot (+35 mV), "
            "repolarization, and hyperpolarization phases. "
            "(Source: Guyton & Hall Textbook of Medical Physiology)",
            caption),
    ]))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 3: Phases ────────────────────────────────────────────────────────
story.append(section_bar("3.  Phases of the Action Potential"))
story.append(Spacer(1, 0.2*cm))

phases = [
    ("Phase 1 – Resting Stage (-70 mV)",
     "Membrane is polarized. Activation gates of Na⁺ channels are CLOSED. "
     "The cell is ready but not firing."),
    ("Phase 2 – Depolarization",
     "A stimulus brings the membrane to threshold (~-55 mV). Voltage-gated Na⁺ channels "
     "snap open — sodium permeability increases 500 to 5000-fold. Na⁺ rushes IN (electrical "
     "and chemical gradient both inward). Potential shoots to +35 mV (overshoot)."),
    ("Phase 3 – Repolarization",
     "Inactivation gate of Na⁺ channels closes (slower gate). Voltage-gated K⁺ channels "
     "open (delayed). K⁺ rushes OUT, pulling potential back toward -70 mV."),
    ("Phase 4 – Hyperpolarization (Undershoot)",
     "K⁺ channels stay open slightly too long → membrane dips briefly below -70 mV "
     "(~-80 mV). Returns to resting once K⁺ channels close."),
]
for title, desc in phases:
    story.append(Paragraph(title, h2))
    story.append(Paragraph(desc, body))

story.append(Spacer(1, 0.3*cm))

# ── SECTION 4: Voltage-Gated Channels ────────────────────────────────────────
story.append(section_bar("4.  Voltage-Gated Channels (Key Mechanism)"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("Sodium Channel — Two Gates", h2))

headers = ["Gate", "Location", "At Rest", "During Depolarization"]
rows = [
    ["Activation gate", "Outside of channel", "CLOSED", "Opens FAST"],
    ["Inactivation gate", "Inside of channel", "OPEN", "Closes SLOW (after few 10,000ths of a sec)"],
]
story.append(make_table(headers, rows, [3.5*cm, 4*cm, 3.5*cm, 6*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "The activation gate opens fast when threshold is reached. The inactivation gate closes "
    "slowly — this is why the Na⁺ channel cannot stay open indefinitely and the AP terminates. "
    "The inactivation gate will <b>NOT reopen</b> until the membrane returns near -70 mV.",
    body))

story.append(Paragraph("Potassium Channel — One Gate", h2))
for item in [
    "Opens <b>delayed</b> compared to Na⁺ channel (voltage-gated, slower)",
    "Stays open during repolarization phase",
    "Responsible for driving the membrane back to negative",
    "Responsible for hyperpolarization (undershoot)",
]:
    story.append(Paragraph(f"• {item}", bullet))

img3 = fetch_img(IMG3_URL, 13*cm, 7*cm)
if img3:
    img3.hAlign = "CENTER"
    story.append(Spacer(1, 0.2*cm))
    story.append(KeepTogether([
        img3,
        Paragraph(
            "Figure 2. Voltage-gated sodium (top) and potassium (bottom) channels — "
            "successive activation and inactivation states. "
            "(Source: Guyton & Hall Textbook of Medical Physiology)",
            caption),
    ]))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 5: Refractory Periods ────────────────────────────────────────────
story.append(section_bar("5.  Refractory Periods"))
story.append(Spacer(1, 0.2*cm))
headers2 = ["Period", "Timing", "Mechanism", "Can Another AP Fire?"]
rows2 = [
    ["Absolute Refractory\nPeriod",
     "During depolarization\n& early repolarization",
     "Na⁺ inactivation gates closed\n— cannot reopen",
     "NO — impossible"],
    ["Relative Refractory\nPeriod",
     "Late repolarization /\nhyperpolarization",
     "Na⁺ channels recovering +\nK⁺ channels still open",
     "Only with STRONGER\nthan normal stimulus"],
]
story.append(make_table(headers2, rows2, [3.8*cm, 4*cm, 5*cm, 4.2*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(info_box(
    "The refractory period ensures APs travel in ONE direction only — the membrane just "
    "behind the AP is refractory, so the impulse cannot turn back on itself.",
    bg=GREEN, border=colors.HexColor("#2e7d32")
))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 6: All-or-Nothing Law ────────────────────────────────────────────
story.append(section_bar("6.  All-or-Nothing Law"))
story.append(Spacer(1, 0.2*cm))
for item in [
    "Subthreshold stimulus → <b>No AP fires</b>",
    "Threshold stimulus → <b>Full AP fires</b> (always same amplitude and duration)",
    "Superthreshold stimulus → <b>Same full AP</b> (not bigger or larger)",
    "The <b>frequency</b> of firing (not the size) encodes stimulus intensity",
]:
    story.append(Paragraph(f"• {item}", bullet))
story.append(Spacer(1, 0.2*cm))
story.append(memory_tip(
    "Think of a gun trigger: either you pull it enough and it fires fully, "
    "or you don't and nothing happens. Pulling harder doesn't make the bullet go faster."
))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 7: Propagation ────────────────────────────────────────────────────
story.append(section_bar("7.  Propagation of the Action Potential"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "Once an AP fires at one point on the axon, it propagates along the entire length:",
    body))
steps = [
    "Na⁺ rushes in, and positive charge spreads <b>inside the axon</b> to the adjacent segment",
    "That segment reaches threshold → its Na⁺ channels open → another AP fires there",
    "This continues down the axon to the axon terminal",
    "In myelinated fibers: AP <b>jumps</b> from node to node (saltatory conduction)",
]
for i, s in enumerate(steps, 1):
    story.append(Paragraph(f"{i}. {s}", bullet))

story.append(Spacer(1, 0.2*cm))
story.append(info_box(
    "<b>Orthodromic conduction:</b> Normal direction, soma → axon terminal.<br/>"
    "<b>Antidromic conduction:</b> Backward propagation (experimentally elicited or clinically).",
    bg=LIGHT, border=ACCENT
))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 8: Saltatory Conduction ─────────────────────────────────────────
story.append(section_bar("8.  Myelination & Saltatory Conduction"))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("The Myelin Sheath", h2))
story.append(Paragraph(
    "The myelin sheath wraps the axon in many layers of membrane — "
    "<b>Schwann cells</b> in the PNS, <b>oligodendrocytes</b> in the CNS. "
    "This acts as electrical insulation and reduces membrane capacitance 50-fold, "
    "forcing current to flow down inside the axon.",
    body))
story.append(Paragraph("Nodes of Ranvier", h2))
story.append(Paragraph(
    "Gaps in the myelin sheath (1–2 μm long). Voltage-gated Na⁺ channels are "
    "<b>concentrated here</b> and essentially absent under the myelin. "
    "Internodes (myelinated segments) can be 0.2–2.0 mm long.",
    body))
story.append(Paragraph("Saltatory Conduction", h2))
story.append(Paragraph(
    "Action potentials only occur AT the nodes. Electrical current flows through the "
    "axoplasm from node to node — the AP <i>jumps</i> (saltare = to leap in Latin).",
    body))
story.append(Spacer(1, 0.2*cm))

img2 = fetch_img(IMG2_URL, 16*cm, 9.5*cm)
if img2:
    img2.hAlign = "CENTER"
    story.append(KeepTogether([
        img2,
        Paragraph(
            "Figure 3. Saltatory conduction — action potential jumping node to node along "
            "a myelinated axon. Na⁺ channels are concentrated at the nodes of Ranvier. "
            "(Source: Guyton & Hall Textbook of Medical Physiology)",
            caption),
    ]))
story.append(Spacer(1, 0.2*cm))

story.append(Paragraph("Two Advantages of Saltatory Conduction:", h2))
adv = [
    ("<b>Speed:</b>", "Conduction velocity increases 5 to 50-fold over unmyelinated fibers"),
    ("<b>Energy efficiency:</b>", "Only nodes depolarize → ~100× fewer ions cross the membrane → "
     "much less work for the Na⁺-K⁺ pump"),
]
for label, desc in adv:
    story.append(Paragraph(f"• {label} {desc}", bullet))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 9: Conduction Velocity Table ─────────────────────────────────────
story.append(section_bar("9.  Nerve Fiber Classification & Conduction Velocity"))
story.append(Spacer(1, 0.2*cm))
headers3 = ["Fiber", "Myelinated?", "Diameter", "Velocity", "Function"]
rows3 = [
    ["Aα",  "Yes", "Large (13–20 μm)", "70–120 m/s", "Motor, proprioception"],
    ["Aβ",  "Yes", "Medium (6–12 μm)", "30–70 m/s",  "Touch, pressure"],
    ["Aδ",  "Yes", "Small (1–5 μm)",   "5–30 m/s",   "Fast pain, cold temperature"],
    ["C",   "No",  "Very small (<1 μm)","0.25–2 m/s", "Slow pain, post-ganglionic ANS"],
]
story.append(make_table(headers3, rows3, [2.5*cm, 3*cm, 4*cm, 3.5*cm, 4*cm]))
story.append(Spacer(1, 0.2*cm))
story.append(memory_tip(
    "Rule: Larger diameter + myelination = FASTER conduction. "
    "Velocity of large myelinated fibers can be >100 m/s — more than the length of a football field per second!"
))
story.append(Spacer(1, 0.3*cm))

# ── SECTION 10: Clinical Connections ──────────────────────────────────────────
story.append(section_bar("10.  Clinical Connections"))
story.append(Spacer(1, 0.2*cm))
clinical_data = [
    ["Disease / Drug", "Mechanism", "Effect"],
    ["Multiple Sclerosis", "Demyelination in CNS", "Slowed/blocked conduction → weakness, sensory loss, vision problems"],
    ["Guillain-Barré Syndrome", "Demyelination in PNS", "Ascending paralysis, areflexia"],
    ["Local Anesthetics\n(Lidocaine)", "Block voltage-gated Na⁺ channels", "Prevent AP generation → local anesthesia"],
    ["Tetrodotoxin (Puffer fish)", "Binds & blocks Na⁺ channel permanently", "Complete block → lethal paralysis"],
    ["Scorpion toxin", "Keeps Na⁺ activation gate open", "Prolonged depolarization, repetitive firing"],
]
t = Table(clinical_data, colWidths=[4.5*cm, 5.5*cm, 7*cm])
t.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), DARKRED),
    ("TEXTCOLOR",    (0,0), (-1,0), colors.white),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.HexColor("#fff8f8"), RED_BG]),
    ("GRID",         (0,0), (-1,-1), 0.5, colors.HexColor("#e0b0b0")),
    ("TOPPADDING",   (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",  (0,0), (-1,-1), 7),
    ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
]))
story.append(t)
story.append(Spacer(1, 0.3*cm))

# ── SECTION 11: Summary Flow Chart ────────────────────────────────────────────
story.append(section_bar("11.  Summary — Step by Step"))
story.append(Spacer(1, 0.2*cm))

flow_steps = [
    ("Stimulus arrives", "Membrane depolarizes toward threshold (-55 mV)"),
    ("Threshold reached", "Voltage-gated Na⁺ channels open (activation gate)"),
    ("Na⁺ rushes IN", "Depolarization → +35 mV (overshoot)"),
    ("Na⁺ inactivation gate closes + K⁺ channels open", "Repolarization begins"),
    ("K⁺ rushes OUT", "Membrane returns to -70 mV → slight hyperpolarization"),
    ("Channels close", "Membrane returns to resting state"),
    ("Positive charge spreads ahead inside axon", "Adjacent membrane reaches threshold → next AP"),
    ("Myelinated fiber", "Current jumps node to node → SALTATORY CONDUCTION"),
]
flow_data = [["Step", "Event"]] + flow_steps
ft = Table(flow_data, colWidths=[8*cm, 9*cm])
ft.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,0), BRAND),
    ("TEXTCOLOR",    (0,0), (-1,0), colors.white),
    ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
    ("FONTSIZE",     (0,0), (-1,-1), 9),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[LIGHT, colors.white]),
    ("GRID",         (0,0), (-1,-1), 0.5, colors.HexColor("#c0c8d8")),
    ("TOPPADDING",   (0,0), (-1,-1), 6),
    ("BOTTOMPADDING",(0,0), (-1,-1), 6),
    ("LEFTPADDING",  (0,0), (-1,-1), 7),
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
]))
story.append(ft)
story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=ACCENT))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
    "Sources: Guyton &amp; Hall Textbook of Medical Physiology (14th Ed.) | "
    "Neuroscience: Exploring the Brain, 5th Ed. (Bear, Connors, Paradiso)",
    source_style))

# ── Build PDF ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=2*cm, leftMargin=2*cm,
    topMargin=2*cm, bottomMargin=2*cm,
    title="Action Potential & Nerve Conduction",
    author="Orris Medical Notes",
    subject="Physiology – Nervous System",
)
doc.build(story)
print(f"PDF saved: {OUTPUT}")
Running Command

cd /home/daytona/workspace/physiology-notes && python3 make_pdf.py

Running Command

ls -lh /home/daytona/workspace/physiology-notes/Action_Potential_Nerve_Conduction.pdf

PDF ready hai! 1.3 MB ka nicely formatted document ban gaya.
Download here:

Action Potential Nerve Conduction

PDF Document · PDF


PDF mein ye sab include hai:
SectionContent
Cover pageTitled with sources
1-2Resting membrane potential + definition
3Phases (Resting → Depolarization → Repolarization → Hyperpolarization) with graph image
4Voltage-gated Na⁺ & K⁺ channels table + diagram
5Absolute & Relative Refractory Periods table
6All-or-Nothing Law + memory tip
7Propagation mechanism
8Myelin, Nodes of Ranvier, Saltatory Conduction + diagram
9Fiber classification table (Aα, Aβ, Aδ, C) with speeds
10Clinical connections (MS, GBS, Lidocaine, Tetrodotoxin)
11Step-by-step summary table
Aur koi topic chahiye ya is PDF mein kuch aur add karna ho to batao!
This is a shared conversation. Sign in to Orris to start your own chat.