Physiology padha de English me

| Gate | Location | At Rest | During Depolarization |
|---|---|---|---|
| Activation gate | Outside of channel | CLOSED | Opens fast |
| Inactivation gate | Inside of channel | OPEN | Closes slow (after a few 10,000ths of a sec) |
| Period | Timing | Mechanism | Can Another AP Fire? |
|---|---|---|---|
| Absolute Refractory Period | During depolarization & early repolarization | Na⁺ channel inactivation gates are closed - cannot reopen | No, impossible |
| Relative Refractory Period | Late repolarization / hyperpolarization | Na⁺ channels recovering + K⁺ channels still open | Only with a stronger-than-normal stimulus |

| Fiber Type | Myelinated? | Diameter | Velocity | Function |
|---|---|---|---|---|
| Aα | Yes | Large | 70-120 m/s | Motor, proprioception |
| Aβ | Yes | Medium | 30-70 m/s | Touch, pressure |
| Aδ | Yes | Small | 5-30 m/s | Fast pain, temperature |
| C | No | Very small | 0.25-2 m/s | Slow pain, post-ganglionic autonomic |
| Disease | Effect |
|---|---|
| Multiple Sclerosis | Demyelination in CNS → slowed/blocked conduction → weakness, sensory loss, vision problems |
| Guillain-Barré Syndrome | Demyelination 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 |
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)
Pdf bna de iska
ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /home/daytona/workspace/physiology-notes && python3 -c "import reportlab; print('reportlab ok')" && python3 -c "import requests; print('requests ok')"
~/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 & 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 & 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}")
cd /home/daytona/workspace/physiology-notes && python3 make_pdf.py
ls -lh /home/daytona/workspace/physiology-notes/Action_Potential_Nerve_Conduction.pdf
Action Potential Nerve Conduction
PDF Document · PDF
| Section | Content |
|---|---|
| Cover page | Titled with sources |
| 1-2 | Resting membrane potential + definition |
| 3 | Phases (Resting → Depolarization → Repolarization → Hyperpolarization) with graph image |
| 4 | Voltage-gated Na⁺ & K⁺ channels table + diagram |
| 5 | Absolute & Relative Refractory Periods table |
| 6 | All-or-Nothing Law + memory tip |
| 7 | Propagation mechanism |
| 8 | Myelin, Nodes of Ranvier, Saltatory Conduction + diagram |
| 9 | Fiber classification table (Aα, Aβ, Aδ, C) with speeds |
| 10 | Clinical connections (MS, GBS, Lidocaine, Tetrodotoxin) |
| 11 | Step-by-step summary table |