Newly Diagnosed?

Estimators

A1c Estimator
Autoimmune Explorer
Basal Estimator
Bolus Estimator
Fat & Protein Estimator
Interactive Defining Diabetes
Settings Simulator

Guides

Advice for T1 Parents
Caregiver Burnout
Clinician Share
Episode FAQ
GLP with Type 1 Diabetes
Habit Lab
A Guide for Physicians
ACE/PCE Reflection Guide
Diagnosis Story
Grand Rounds Takeaways
Know the Signs
MEAL BOLT Tutorial
My Belly Hurts
Post-Meal Patterns
Pre Bolusing: The Juicebox Way
Thyroid
Understanding TSA

Series & Collections

Bold Beginnings
Pro Tip
Bolus 4
Small Sips
After Dark
Algorithm Pumping
Ask Scott & Jenny
Bold Beginnings in ASL
Cold Wind (Whistleblowers)
Defining Diabetes
Diabetes Myths
Diabetes Variables
Fat and Protein
GLP Meds
Grand Rounds
How We Eat
Math Behind
Mental Wellness
Omnipod 5
Pregnancy
Type 2

Site Links

The Lists
JuiceboxDocs
Private Facebook Group
Events
Blog
Giveaways
Contact
Disclaimers

Shop

Merch
Sponsors
import { useState } from "react"; // ─── SOURCE ATTRIBUTION ─── const SRC = { CODE: { label: "Source Code", color: "#7c3aed", bg: "#f5f3ff" }, DOCS: { label: "Trio Docs", color: "#0891b2", bg: "#ecfeff" }, CLINICAL: { label: "Clinical", color: "#059669", bg: "#ecfdf5" }, STRATEGY: { label: "Strategy", color: "#d97706", bg: "#fffbeb" }, }; const Tag = ({ src }) => {src.label}; const Tagged = ({ children, sources }) =>
{sources.map((s, i) => )}

{children}

; const PROFILES = [ { label: "High Sensitivity", sub: "Honeymoon, very active, young child", value: 0.45 }, { label: "Standard", sub: "Common textbook starting point", value: 0.55 }, { label: "Moderate Resistance", sub: "Puberty, sedentary, stress", value: 0.65 }, { label: "Resistant", sub: "Significant insulin resistance", value: 0.9 }, ]; // ─── CONNECTED TROUBLESHOOTER ─── function getProblems(v) { const { tdd, hourly, icr, isf, isfU, maxIOB, threshold, maxSMBmin, maxSMBsize, factor } = v; return [ { id: "spike", icon: "📈", title: "Post-Meal Spikes", subtitle: "BG rises too high after eating", questions: [ { id: "sh", text: "How high does BG typically spike?", options: [{ label: "180–220 mg/dL", value: "mod" }, { label: "220–300 mg/dL", value: "high" }, { label: "300+", value: "ext" }] }, { id: "dyn", text: "Is Dynamic ISF enabled?", options: [{ label: "Yes", value: "yes" }, { label: "No", value: "no" }] }, { id: "pb", text: "Are you pre-bolusing?", options: [{ label: "Yes, 10–20 min", value: "yes" }, { label: "No", value: "no" }] }, ], getDiagnosis: (a) => { const r = []; if (a.pb === "no") r.push({ priority: "high", setting: "Pre-bolus Behavior", now: "Not pre-bolusing", suggest: "Pre-bolus 10–20 min before eating", blocks: [ { sources: [SRC.CLINICAL], text: "No algorithm can overcome insulin's speed limitation. Even ultra-rapid insulin takes 10–15 minutes to begin lowering BG. Carbohydrates reach the bloodstream in as little as 5 minutes. Pre-bolusing gives insulin a head start and is the single most impactful behavioral change for post-meal spikes." }, { sources: [SRC.CODE], text: `With your estimated basal of ${hourly.toFixed(2)} U/hr and maxSMBBasalMinutes at ${maxSMBmin}, the largest SMB the algorithm can deliver is ${maxSMBsize.toFixed(2)}U — and each SMB takes 55–75 minutes to reach peak activity. By the time the first SMB is half-absorbed, a carb spike already has a 15–30 minute head start.` }, ]}); if (a.dyn === "no") r.push({ priority: "high", setting: "Dynamic ISF (useNewFormula)", now: "Off", suggest: "Enable after 7 days of data", blocks: [ { sources: [SRC.CODE], text: `Without Dynamic ISF, your estimated ISF of ${isf} ${isfU} is used at every BG level — the same strength at 100 as at 300. Dynamic ISF recalculates each loop cycle using: ratio = profileISF × AF × TDD × ln(BG/insulinFactor + 1) / 1800. At higher BG, the ratio increases, ISF gets stronger, and the algorithm delivers more insulin.` }, { sources: [SRC.DOCS], text: "Trio requires 7 days of accumulated data before Dynamic ISF can be enabled. The algorithm needs TDD history to estimate properly." }, ]}); if (a.sh !== "mod") { r.push({ priority: "high", setting: "Adjustment Factor", now: "Default (0.8)", suggest: "Explore 0.9–1.1, verify with Desmos", blocks: [ { sources: [SRC.CODE], text: "Adjustment Factor directly multiplies the sensitivity ratio. Increasing from 0.8 to 1.0 makes the algorithm approximately 25% more responsive at every BG level. This is the most impactful single tuning parameter in the algorithm." }, { sources: [SRC.DOCS], text: "Always review the Desmos graphs at triodocs.org before adjusting. Enter your estimated ISF, Adjustment Factor, and TDD to visualize the curve." }, ]}); r.push({ priority: "medium", setting: "Max SMB Basal Minutes", now: `${maxSMBmin} min → max SMB of ${maxSMBsize.toFixed(2)}U`, suggest: `Explore 45–60 min → max SMB of ${(hourly * 45 / 60).toFixed(2)}–${(hourly * 60 / 60).toFixed(2)}U`, blocks: [ { sources: [SRC.CODE], text: `Currently: maxBolus = ${hourly.toFixed(2)} U/hr × ${maxSMBmin}/60 = ${maxSMBsize.toFixed(2)}U. Even if the algorithm estimates you need 3U, it cannot deliver more than ${maxSMBsize.toFixed(2)}U in a single SMB. At 60 minutes, the cap would be ${(hourly * 1).toFixed(2)}U.` }, ]}); } if (a.sh === "ext") r.push({ priority: "high", setting: "Max IOB", now: `${maxIOB.toFixed(1)}U`, suggest: `Consider ${(maxIOB * 1.5).toFixed(1)}–${(maxIOB * 2).toFixed(1)}U if algorithm consistently hits ceiling`, blocks: [ { sources: [SRC.CODE], text: `Your estimated Max IOB is ${maxIOB.toFixed(1)}U (TDD × 0.35). Once automated IOB reaches this ceiling, the algorithm stops all SMBs and high temp basals regardless of BG. If you're seeing the algorithm go quiet during spikes, this ceiling may be too low for your meal sizes.` }, ]}); return r; }}, { id: "lows", icon: "📉", title: "Overnight Lows", subtitle: "BG drops below range while sleeping", questions: [ { id: "sev", text: "How low does BG typically go?", options: [{ label: "60–70 mg/dL", value: "mild" }, { label: "Below 60", value: "serious" }] }, { id: "eve", text: "What happens before bed?", options: [{ label: "Exercise", value: "ex" }, { label: "Late meal", value: "food" }, { label: "Nothing unusual", value: "none" }] }, ], getDiagnosis: (a) => { const r = []; r.push({ priority: "high", setting: "Overnight Basal Rate", now: `Estimated at ${hourly.toFixed(2)} U/hr (flat)`, suggest: "Verify with overnight fasting test — likely needs reduction", blocks: [ { sources: [SRC.CLINICAL], text: "The most common cause of overnight lows is a basal rate that exceeds actual background insulin needs. The estimator produces a flat rate — a single number for all 24 hours. Most people need less basal overnight and more in the early morning." }, { sources: [SRC.CODE], text: `The algorithm adjusts your estimated ${hourly.toFixed(2)} U/hr by the sensitivity ratio: actual_basal = ${hourly.toFixed(2)} × sensitivityRatio. Even at the minimum ratio of 0.7 (autosens_min default), the lowest the algorithm can reduce your basal is ${(hourly * 0.7).toFixed(2)} U/hr. If that's still too much, the scheduled rate needs to be lowered.` }, ]}); if (a.sev === "serious") r.push({ priority: "high", setting: "Threshold", now: `Estimated at ${threshold} mg/dL`, suggest: `Explore raising to ${Math.min(threshold + 10, 80)} mg/dL`, blocks: [ { sources: [SRC.CODE], text: `Your estimated threshold is ${threshold} mg/dL (from the code formula: ${v.targetBG} - 0.5 × (${v.targetBG} - 40) = ${threshold}). When any BG prediction goes below this value, the algorithm suspends all insulin delivery. Raising it to ${Math.min(threshold + 10, 80)} gives the algorithm more time to prevent lows.` }, ]}); if (a.eve === "ex") r.push({ priority: "high", setting: "Exercise Temp Target", now: "Not using post-exercise protection", suggest: "Set temp target 140–160 mg/dL for 2–4 hours after exercise", blocks: [ { sources: [SRC.CLINICAL], text: "Exercise increases insulin sensitivity for 12–48 hours, with the strongest effect in the first 4–8 hours. The algorithm cannot directly detect this." }, { sources: [SRC.CODE], text: "With a temp target of 160 and High Temp Target Raises Sensitivity enabled, the algorithm uses: ratio = 60 / (60 + 160 - 100) = 0.5. This effectively halves insulin delivery — your basal would drop to approximately " + (hourly * 0.5).toFixed(2) + " U/hr equivalent." }, ]}); return r; }}, { id: "dawn", icon: "🌅", title: "Dawn Phenomenon", subtitle: "Early morning rise without eating", questions: [ { id: "smb", text: "How are SMBs configured?", options: [{ label: "Always on", value: "always" }, { label: "Meal-related only", value: "meal" }] }, ], getDiagnosis: (a) => { const r = []; r.push({ priority: "high", setting: "Dynamic ISF + Adjust Basal", now: "Check if both enabled", suggest: "Enable both", blocks: [ { sources: [SRC.CLINICAL], text: "Dawn phenomenon is driven by hormonal changes (cortisol, growth hormone) that increase insulin resistance. This is biology — not a settings error." }, { sources: [SRC.CODE], text: `Adjust Basal replaces autosens-based basal adjustment with: basal = ${hourly.toFixed(2)} × tdd24h_14d_Ratio. If your recent 24h TDD exceeds your 14-day average, basals auto-increase to match today's needs.` }, ]}); if (a.smb !== "always") r.push({ priority: "high", setting: "SMB Enable Conditions", now: "Meal-related only", suggest: "Enable 'SMB Always' or 'SMB when High BG'", blocks: [ { sources: [SRC.CODE], text: `During dawn phenomenon, COB = 0 and there are no recent carb entries. Your meal-related enables return false. Without SMBs, the algorithm is limited to temp basals capped at approximately ${(hourly * 3.5).toFixed(2)} U/hr (maxSafeBasal). SMBs are needed for faster response.` }, ]}); return r; }}, { id: "silent", icon: "🔇", title: "SMBs Not Delivering", subtitle: "BG is elevated but no micro-boluses", questions: [ { id: "smb", text: "Which SMB enables are active?", options: [{ label: "Always", value: "always" }, { label: "Meal-only", value: "meal" }] }, { id: "carbs", text: "Carbs entered in last 6 hours?", options: [{ label: "Yes", value: "y" }, { label: "No", value: "n" }] }, ], getDiagnosis: (a) => { const r = []; if (a.smb !== "always" && a.carbs === "n") r.push({ priority: "high", setting: "SMB Enable Conditions", now: "Meal-only, no active carbs", suggest: "Enable 'SMB Always' or 'SMB when High BG'", blocks: [ { sources: [SRC.CODE], text: "Most common reason. In the algorithm's enable_smb() function, each condition is independent — any ONE can enable SMBs. But if only meal-related enables are on and COB = 0, every condition returns false and the algorithm cannot deliver SMBs." }, ]}); r.push({ priority: "medium", setting: "Max IOB", now: `Estimated at ${maxIOB.toFixed(1)}U`, suggest: `Verify current IOB isn't hitting the ${maxIOB.toFixed(1)}U ceiling`, blocks: [ { sources: [SRC.CODE], text: `When automated IOB reaches ${maxIOB.toFixed(1)}U (your estimated ceiling), the algorithm halts all SMBs and high temp basals. Check the Trio app — if IOB is near ${maxIOB.toFixed(1)}, this is the constraint. Consider raising to ${(maxIOB * 1.3).toFixed(1)}–${(maxIOB * 1.5).toFixed(1)}U.` }, ]}); return r; }}, { id: "roller", icon: "🎢", title: "Rollercoaster BGs", subtitle: "Repeating swings between highs and lows", questions: [ { id: "man", text: "Do you manually correct highs?", options: [{ label: "Yes, frequently", value: "yes" }, { label: "No, algorithm handles it", value: "no" }] }, ], getDiagnosis: (a) => { const r = []; if (a.man === "yes") r.push({ priority: "high", setting: "Manual Correction Behavior", now: "Bolusing on top of algorithmic corrections", suggest: "Allow the algorithm 2–3 hours before intervening", blocks: [ { sources: [SRC.CODE, SRC.CLINICAL], text: `The algorithm independently calculates insulin needs each loop cycle while also delivering SMBs. When you manually correct, your bolus stacks on top of insulin the algorithm has already delivered or planned. With your estimated ISF of ${isf} ${isfU}, a 1U over-correction would drop BG an additional ${isf} ${isfU} beyond what the algorithm intended.` }, { sources: [SRC.STRATEGY], text: "If the algorithm isn't bringing highs down fast enough, that indicates a settings adjustment is needed — not a manual override. The Adjustment Factor, Max SMB Minutes, and SMB Delivery Ratio are the settings to explore." }, ]}); r.push({ priority: "high", setting: "Core Settings Accuracy", now: `ISF: ${isf} ${isfU}, ICR: 1:${icr}, Basal: ${hourly.toFixed(2)} U/hr`, suggest: "Verify each with targeted testing", blocks: [ { sources: [SRC.CODE], text: `Every dynamic adjustment multiplies or divides your profile values. If your estimated ISF of ${isf} ${isfU} is actually too strong, the algorithm starts from the wrong baseline every loop cycle. Dynamic ISF then amplifies the error: calculatedISF = ${isf} / sensitivityRatio.` }, { sources: [SRC.STRATEGY], text: "Test in order: basals first (fasting test), then ISF (correction with no food active), then ICR (well-counted meal with accurate pre-bolus). Each test should be done when the prior setting is verified." }, ]}); return r; }}, { id: "conservative", icon: "🐢", title: "Algorithm Too Conservative", subtitle: "BG stays elevated, minimal algorithmic response", questions: [ { id: "cl", text: "Is Closed Loop enabled?", options: [{ label: "Yes", value: "y" }, { label: "No / not sure", value: "n" }] }, { id: "exp", text: "How long on Trio?", options: [{ label: "< 1 week", value: "new" }, { label: "1+ month", value: "exp" }] }, ], getDiagnosis: (a) => { const r = []; if (a.cl === "n") r.push({ priority: "high", setting: "Closed Loop", now: "Off", suggest: "Enable after reviewing algorithmic suggestions", blocks: [ { sources: [SRC.CODE], text: "With Closed Loop off, the algorithm estimates the optimal temp basal and SMB each cycle — then discards them. No commands reach the pump. The algorithm is working; it's just not allowed to act." }, ]}); if (a.exp === "new") r.push({ priority: "high", setting: "Max IOB + SMB Configuration", now: `Max IOB estimated at ${maxIOB.toFixed(1)}U — verify it's set above 0`, suggest: "Follow the setup timeline in the Starting Estimates tab", blocks: [ { sources: [SRC.DOCS], text: `Max IOB defaults to 0 in Trio — the algorithm cannot deliver automated insulin until you raise it. Your estimated starting value is ${maxIOB.toFixed(1)}U. No SMB conditions are enabled by default.` }, ]}); else r.push({ priority: "high", setting: "Adjustment Factor", now: "Likely too low", suggest: "Increase by 0.1 increments, verify with Desmos", blocks: [ { sources: [SRC.CODE], text: `AF directly multiplies the Dynamic ISF sensitivity ratio. With your estimated TDD of ${tdd.toFixed(1)}U and ISF of ${isf} ${isfU}, increasing AF from 0.8 to 0.9 would strengthen the algorithm's response by approximately 12% at every BG level. This is the single most impactful tuning parameter.` }, ]}); return r; }}, ]; } // ─── CONFIG BUILDER ─── function buildConfig(v) { const { tdd, hourly, icr, isf, isfU, targetBG, threshold, insulin, maxIOB, maxSMBmin, maxSMBsize, dailyBasal } = v; return [ { phase: "Day 1 — Core Therapy Settings", note: "Estimated from your inputs", color: "#059669", items: [ { name: "Basal Rate", value: `${hourly.toFixed(2)} U/hr`, key: "basal_profile", how: "estimated", watch: "Does BG hold flat during fasting periods? If it drops → reduce. If it rises → increase. This flat rate is a starting point — most people need time-of-day variation.", src: [SRC.CLINICAL] }, { name: "Carb Ratio (ICR)", value: `1:${icr}`, key: "carb_ratios", how: "estimated", watch: "After a well-counted meal with correct pre-bolus, does BG return to its starting point within 3–4 hours? Test only after basals are verified.", src: [SRC.CLINICAL] }, { name: "Insulin Sensitivity (ISF)", value: `${isf} ${isfU}`, key: "insulin_sensitivities", how: "estimated", watch: "Does a correction dose bring BG to target without going low? Test when no food or active IOB is present.", src: [SRC.CLINICAL] }, { name: "Target BG", value: `${targetBG} mg/dL`, key: "bg_targets", how: "you selected", watch: "Start conservative (100–110). Consider lowering only after other settings are stable and verified.", src: [SRC.STRATEGY] }, { name: "Insulin Curve", value: insulin === "rapid-acting" ? "Rapid-Acting (peak 75 min)" : "Ultra-Rapid (peak 55 min)", key: "curve", how: "you selected", watch: "Must match your actual insulin type. An incorrect curve causes the algorithm to misjudge how much insulin is still active.", src: [SRC.CODE, SRC.CLINICAL] }, { name: "Closed Loop", value: "OFF initially", key: "closedLoop", how: "recommended", watch: "Leave off for 1–3 days. Review algorithmic suggestions — are they reasonable? Then enable.", src: [SRC.DOCS] }, ]}, { phase: "Day 2–3 — Enable Automation", note: "After observing that algorithmic suggestions appear reasonable", color: "#d97706", items: [ { name: "Closed Loop", value: "ON", key: "closedLoop", how: "enable", watch: "The algorithm now controls the pump. Monitor closely for the first 24 hours.", src: [SRC.DOCS] }, { name: "Max IOB", value: `${maxIOB.toFixed(1)} U`, key: "max_iob", how: "estimated", watch: `Estimated at TDD × 0.35 = ${maxIOB.toFixed(1)}U. If the algorithm consistently reaches this ceiling, consider raising. If lows occur, consider lowering.`, src: [SRC.CODE, SRC.STRATEGY] }, { name: "Threshold", value: `${threshold} mg/dL`, key: "threshold_setting", how: "estimated", watch: `Estimated from your target using the algorithm's formula. The algorithm suspends insulin when any prediction goes below ${threshold}. Raise if you experience lows.`, src: [SRC.CODE] }, ]}, { phase: "Week 1 — Enable SMBs", note: "After verifying basal rates with fasting tests", color: "#0891b2", items: [ { name: "Enable SMB with COB", value: "ON", key: "enableSMB_with_COB", how: "recommended", watch: "Allows micro-boluses when carbs are active. The most conservative first SMB enable.", src: [SRC.DOCS, SRC.STRATEGY] }, { name: "Enable SMB after Carbs", value: "ON", key: "enableSMB_after_carbs", how: "recommended", watch: "Extends SMB availability for 6 hours after any carb entry.", src: [SRC.DOCS] }, { name: "Enable UAM", value: "ON", key: "enableUAM", how: "recommended", watch: "Unannounced Meal detection. Always enable alongside SMBs. Detects unexplained BG rises.", src: [SRC.DOCS, SRC.CODE] }, { name: "Max SMB Basal Minutes", value: `${maxSMBmin}`, key: "maxSMBBasalMinutes", how: "default", watch: `Limits each SMB to ${maxSMBsize.toFixed(2)}U (${hourly.toFixed(2)} × ${maxSMBmin}/60). If post-meal spikes aren't corrected quickly enough, explore raising to 45–60.`, src: [SRC.CODE] }, { name: "Max UAM SMB Minutes", value: `${maxSMBmin}`, key: "maxUAMSMBBasalMinutes", how: "default", watch: "Typically set equal to Max SMB Basal Minutes.", src: [SRC.CODE] }, { name: "SMB Delivery Ratio", value: "0.5", key: "smb_delivery_ratio", how: "default", watch: "Each SMB delivers 50% of the estimated insulin need. Raise to 0.6–0.7 if corrections are too slow. Lower if overcorrecting.", src: [SRC.CODE] }, ]}, { phase: "After 7+ Days — Dynamic Features", note: "Algorithm has accumulated sufficient TDD data", color: "#7c3aed", items: [ { name: "Dynamic ISF", value: "ON (Logarithmic)", key: "useNewFormula", how: "recommended", watch: `Replaces your static ISF of ${isf} ${isfU} with a value that adjusts based on current BG and TDD. Monitor whether corrections land closer to target.`, src: [SRC.CODE, SRC.DOCS] }, { name: "Adjustment Factor", value: "0.8", key: "adjustmentFactor", how: "default starting point", watch: "The most important tuning parameter. Use Desmos graphs. Target: your estimated ISF should be the output when BG ≈ 150 mg/dL. Adjust by 0.1 increments.", src: [SRC.CODE, SRC.DOCS] }, { name: "Autosens Max", value: "1.2", key: "autosens_max", how: "default", watch: "Caps how aggressively the algorithm can increase insulin. Widen to 1.3–1.5 if the algorithm isn't responsive enough at elevated BG.", src: [SRC.CODE] }, { name: "Autosens Min", value: "0.7", key: "autosens_min", how: "default", watch: "Floor for insulin reduction. Lower to 0.5–0.6 if experiencing lows from increased sensitivity.", src: [SRC.CODE] }, ]}, { phase: "Weeks 2–4 — Outcome-Based Refinement", note: "These settings require observed response data — they cannot be estimated from weight", color: "#64748b", items: [ { name: "Enable SMB Always", value: "Consider enabling", key: "enableSMB_always", how: "outcome-based", watch: "Allows SMBs even without carbs. Necessary for dawn phenomenon and unexplained rises.", src: [SRC.STRATEGY, SRC.CODE] }, { name: "Dynamic CR", value: "Consider enabling", key: "enableDynamicCR", how: "outcome-based", watch: `Adjusts your ICR of 1:${icr} by sensitivity ratio. Enable if carb ratio appears inconsistent at different BG levels.`, src: [SRC.CODE] }, { name: "Adjust Basal", value: "Consider enabling", key: "tddAdjBasal", how: "outcome-based", watch: `Replaces autosens-based basal adjustment. Modifies your ${hourly.toFixed(2)} U/hr based on TDD trends. Helpful for dawn phenomenon.`, src: [SRC.CODE, SRC.STRATEGY] }, { name: "Weight Percentage", value: "0.65 (default)", key: "weightPercentage", how: "outcome-based", watch: "Balances recent (2h) vs historical (14d) TDD data. Raise to 0.7–0.8 if insulin needs vary significantly day to day.", src: [SRC.CODE] }, ]}, ]; } // ─── GLOSSARY ─── const GLOSSARY = [ { name: "Max IOB", key: "max_iob", cat: "Safety", short: "Hard ceiling on automated insulin.", detail: "Stops all automated dosing when reached. Does not limit manual boluses. Default: 0.", src: [SRC.CODE] }, { name: "Dynamic ISF", key: "useNewFormula", cat: "Dynamic", short: "ISF adjusts by current BG + TDD each loop.", detail: "Logarithmic by default. Requires 7 days data.", src: [SRC.CODE, SRC.DOCS] }, { name: "Adjustment Factor", key: "adjustmentFactor", cat: "Dynamic", short: "Tunes Dynamic ISF responsiveness.", detail: "Default: 0.8. Direct multiplier. Check Desmos first.", src: [SRC.CODE, SRC.DOCS] }, { name: "Sigmoid", key: "sigmoid", cat: "Dynamic", short: "Alternative Dynamic ISF curve.", detail: "Ratio = 1.0 at target. Bounded by autosens limits.", src: [SRC.CODE] }, { name: "Dynamic CR", key: "enableDynamicCR", cat: "Dynamic", short: "Carb ratio adjusts by sensitivity ratio.", detail: "effectiveCR = profileCR / ratio. Default: Off.", src: [SRC.CODE] }, { name: "Adjust Basal", key: "tddAdjBasal", cat: "Dynamic", short: "Basals adjust by TDD trends.", detail: "basal = scheduled × tddRatio. Default: Off.", src: [SRC.CODE] }, { name: "Autosens Max", key: "autosens_max", cat: "Limits", short: "Maximum sensitivity ratio.", detail: "Default: 1.2. Caps all dynamic adjustments.", src: [SRC.CODE] }, { name: "Autosens Min", key: "autosens_min", cat: "Limits", short: "Minimum sensitivity ratio.", detail: "Default: 0.7. Floor for insulin reduction.", src: [SRC.CODE] }, { name: "SMB Delivery Ratio", key: "smb_delivery_ratio", cat: "SMB", short: "Fraction delivered per SMB.", detail: "Default: 0.5. microBolus = insulinReq × ratio.", src: [SRC.CODE] }, { name: "Max SMB Minutes", key: "maxSMBBasalMinutes", cat: "SMB", short: "Caps individual SMB size.", detail: "maxBolus = basal × min / 60. Default: 30.", src: [SRC.CODE] }, { name: "Threshold", key: "threshold_setting", cat: "Safety", short: "Low glucose suspend floor.", detail: "Predictions below → zero temp + no SMBs. Default: 65.", src: [SRC.CODE] }, { name: "Enable UAM", key: "enableUAM", cat: "Algorithm", short: "Unannounced meal detection.", detail: "Enables UAM prediction curve. Enable with SMBs.", src: [SRC.CODE, SRC.DOCS] }, { name: "Insulin Curve", key: "curve", cat: "Algorithm", short: "Rapid (75m peak) or Ultra-rapid (55m).", detail: "Must match your insulin type.", src: [SRC.CODE, SRC.CLINICAL] }, { name: "Weight %", key: "weightPercentage", cat: "Dynamic", short: "Recent vs historical TDD balance.", detail: "Default: 0.65. Higher = more reactive.", src: [SRC.CODE] }, { name: "Half Basal Target", key: "half_basal_exercise_target", cat: "Targets", short: "BG where basal = 50% during exercise.", detail: "Default: 160. Needs High TT Raises Sensitivity.", src: [SRC.CODE] }, ]; function App() { const [view, setView] = useState("start"); const [prob, setProb] = useState(null); const [ans, setAns] = useState({}); const [qIdx, setQIdx] = useState(0); const [done, setDone] = useState(false); const [filter, setFilter] = useState(""); const [expanded, setExpanded] = useState(null); const [legend, setLegend] = useState(false); const [weight, setWeight] = useState(150); const [factor, setFactor] = useState(0.55); const [selProfile, setSelProfile] = useState(1); const [targetBG, setTargetBG] = useState(100); const [insulin, setInsulin] = useState("rapid-acting"); const [units, setUnits] = useState("mgdl"); const [icrRule, setIcrRule] = useState(500); const [isfRule, setIsfRule] = useState(1800); const [showConfig, setShowConfig] = useState(false); const kg = weight / 2.2; const tdd = kg * factor; const dailyBasal = tdd * 0.5; const hourly = dailyBasal / 24; const icr = tdd > 0 ? Math.round((icrRule / tdd) * 10) / 10 : 0; const isfRaw = tdd > 0 ? isfRule / tdd : 0; const isf = units === "mmol" ? Math.round((isfRaw / 18) * 10) / 10 : Math.round(isfRaw); const isfU = units === "mgdl" ? "mg/dL" : "mmol/L"; const threshold = Math.max(Math.round(targetBG - 0.5 * (targetBG - 40)), 65); const maxIOB = Math.round(tdd * 0.35 * 10) / 10; const maxSMBmin = 30; const maxSMBsize = hourly * maxSMBmin / 60; const vals = { tdd, hourly, icr, isf, isfU, maxIOB, threshold, maxSMBmin, maxSMBsize, factor, targetBG, dailyBasal, insulin }; const problems = getProblems(vals); const config = buildConfig(vals); const reset = () => { setProb(null); setAns({}); setQIdx(0); setDone(false); setView("home"); }; const answer = (qId, v) => { const na = { ...ans, [qId]: v }; setAns(na); if (prob && qIdx < prob.questions.length - 1) setQIdx(qIdx + 1); else setDone(true); }; const pc = (p) => p === "high" ? { border: "#ef4444", badge: "#dc2626" } : p === "medium" ? { border: "#f59e0b", badge: "#d97706" } : { border: "#22c55e", badge: "#16a34a" }; const pl = (p) => p === "high" ? "Check First" : p === "medium" ? "Worth Exploring" : "Fine Tuning"; const fg = GLOSSARY.filter(s => (s.name + s.cat + s.short).toLowerCase().includes(filter.toLowerCase())); const cats = [...new Set(GLOSSARY.map(s => s.cat))]; const M = "'JetBrains Mono',monospace"; const S = { eye: { fontFamily: M, fontSize: "0.63rem", fontWeight: 700, letterSpacing: 2, textTransform: "uppercase" }, card: { background: "#fff", border: "2px solid #e8e3da", borderRadius: 12, padding: "18px 20px", marginBottom: 12 }, dark: { background: "#1e293b", borderRadius: 12, padding: "16px 18px" }, big: { fontFamily: M, fontWeight: 800, lineHeight: 1 }, }; return (
{/* Hero */}
Juicebox Podcast × Trio · Educational Estimator

Trio Starting Point Estimator

Explore theoretical starting settings. Troubleshoot patterns with your estimated values. Understand the algorithm.

{/* Nav */}
{[["start","Starting Estimates"],["home","Pattern Troubleshooter"],["glossary","Settings Reference"]].map(([v,l]) => ( ))}
{legend &&
{[[SRC.CODE,"From the actual Trio source code"],[SRC.DOCS,"From triodocs.org"],[SRC.CLINICAL,"Diabetes/medical knowledge"],[SRC.STRATEGY,"Community experience"]].map(([s,d]) =>
{d}
)}
}
{/* ═══ STARTING ESTIMATES ═══ */} {view === "start" &&
Educational estimator. Theoretical starting points from standard textbook formulas. These estimates are not a prescription. All settings must be verified with your endocrinologist before any real-world application.
{/* Inputs */}
Explore Theoretical Inputs
Hypothetical Weight
{weight}lbs({kg.toFixed(1)} kg)
setWeight(+e.target.value)} style={{ width: "100%", accentColor: "#f59e0b", marginTop: 4 }} />
Physiology Factor
{PROFILES.map((p,i) => (
{ setSelProfile(i); setFactor(p.value); }} style={{ display: "flex", alignItems: "center", gap: 8, padding: "5px 10px", border: `1px solid ${selProfile===i?"#f59e0b":"#e8e3da"}`, borderRadius: 6, cursor: "pointer", background: selProfile===i?"#fffbeb":"#fff", fontSize: "0.76rem", marginBottom: 4 }}>
{selProfile===i &&
}
{p.label} {p.value}
))}
Fine-tune { setFactor(+e.target.value); setSelProfile(-1); }} style={{ flex: 1, accentColor: "#f59e0b" }} /> {factor.toFixed(2)}
Target BG
Insulin Type
ISF Units
{["mgdl","mmol"].map(u => )}
{/* Estimated Core Results */}
Estimated Starting Values
{[["TDD",`${tdd.toFixed(1)}`,"U/day"],["Basal",`${hourly.toFixed(2)}`,"U/hr"],["ICR",`1:${icr}`,""],["ISF",`${isf}`,isfU]].map(([l,v,u]) => (
{l}
{v}{u}
))}
{[["Max IOB",`${maxIOB.toFixed(1)} U`,"TDD × 0.35"],["Threshold",`${threshold} mg/dL`,`target - 0.5×(target-40)`]].map(([l,v,f]) => (
{l}
{v}
{f}
))}
{/* Full Config */} {showConfig &&
{config.map((phase,pi) => (
{phase.phase}
{phase.note}
{phase.items.map((item,ii) => (
{item.name}
{item.value} {item.how}
{item.src.map((s,i) => )}
What to watch: {item.watch}
{item.key}
))}
))}
}
} {/* ═══ GLOSSARY ═══ */} {view === "glossary" &&
setFilter(e.target.value)} style={{ width: "100%", padding: "11px 15px", borderRadius: 12, border: "2px solid #e8e3da", fontFamily: "'DM Sans'", fontSize: "0.95rem", marginBottom: 16, boxSizing: "border-box", outline: "none" }} /> {cats.map(c => { const items = fg.filter(s => s.cat===c); if (!items.length) return null; return
{c}
{items.map(s =>
setExpanded(expanded===s.key?null:s.key)} style={{ background: "#fff", border: `2px solid ${expanded===s.key?"#f59e0b":"#e8e3da"}`, borderRadius: 12, padding: "13px 16px", marginBottom: 7, cursor: "pointer" }}>
{s.name}
{s.short}
{s.key}
{expanded===s.key &&
{s.src.map((x,i) => )}
{s.detail}
}
)}
; })}
} {/* ═══ TROUBLESHOOTER ═══ */} {view === "home" && !prob &&
The troubleshooter uses your estimated values from the Starting Estimates tab. Adjust your weight and factor there to see how recommendations change.
{problems.map(p =>
{ setProb(p); setAns({}); setQIdx(0); setDone(false); }} style={{ ...S.card, cursor: "pointer", display: "flex", alignItems: "center", gap: 14, transition: "border-color 0.15s" }} onMouseEnter={e => e.currentTarget.style.borderColor="#f59e0b"} onMouseLeave={e => e.currentTarget.style.borderColor="#e8e3da"}> {p.icon}
{p.title}
{p.subtitle}
)}
} {view === "home" && prob && !done &&

{prob.icon}{prob.title}

{prob.questions.map((_,i) =>
)}
Q{qIdx+1}/{prob.questions.length}

{prob.questions[qIdx].text}

{prob.questions[qIdx].options.map(o => )}
} {view === "home" && prob && done &&

{prob.icon}Pattern Analysis

Based on your estimated values (Basal {hourly.toFixed(2)} U/hr, ISF {isf} {isfU}, ICR 1:{icr}, Max IOB {maxIOB.toFixed(1)}U)

{prob.getDiagnosis(ans).map((item,i) => { const c = pc(item.priority); return
{pl(item.priority)}

{item.setting}

Current: {item.now} Explore: {item.suggest}
{item.blocks.map((b,j) => {b.text})}
; })}
}
{/* ═══ EXPLAINER ═══ */}
How This Estimator Works

Understanding the Trio Starting Point Estimator

This educational estimator demonstrates the standard weight-based mathematics used in clinical diabetes education to establish theoretical starting points for insulin pump therapy settings. It then extends those estimates into a complete initial configuration for the Trio open-source automated insulin delivery system, organized as a phased setup timeline.

The Mathematical Cascade

Every estimate in this tool flows from a single starting input — hypothetical body weight — through a chain of standard clinical formulas. Each step depends on the one before it:

Weight (lbs) ÷ 2.2 = Weight (kg)
Weight (kg) × Physiology Factor = Theoretical TDD
TDD × 0.50 ÷ 24 = Estimated Hourly Basal Rate
500 ÷ TDD = Estimated Carb Ratio (ICR)
1800 ÷ TDD = Estimated Sensitivity Factor (ISF)
TDD × 0.35 = Estimated Max IOB
Target BG − 0.5 × (Target − 40) = Estimated Threshold

Two Categories of Settings

The estimator distinguishes between settings that can be reasonably estimated from weight-based formulas and those that require real-world outcome data. This distinction is fundamental and is clearly marked throughout the tool:

Estimated settings (Basal Rate, ICR, ISF, Max IOB, Threshold) are derived from the mathematical cascade. They provide a legitimate starting line based on the same population-level formulas endocrinologists use, but they are not personalized and must be verified through testing.

Outcome-based settings (Adjustment Factor tuning, Dynamic CR, Adjust Basal, Weight Percentage, Sigmoid) cannot be derived from weight alone because they describe how your specific physiology responds to insulin at different blood glucose levels, across different days, and under different conditions. These require 1–4 weeks of observed data.

The Connected Troubleshooter

The Pattern Troubleshooter is connected to the Starting Estimates. When you adjust your weight, factor, or other inputs, the troubleshooter's recommendations update to reference your specific estimated values — showing actual calculated numbers rather than generic ranges. It can tell you that your estimated max SMB of 0.39U is likely too small for a 60-gram meal, not just that "Max SMB Minutes might need to be raised." This connection makes the troubleshooter's guidance concrete and actionable.

Source Attribution

Every claim in this estimator is tagged with its source. Source Code labels indicate information derived from Trio's actual algorithm at github.com/nightscout/Trio — the real formulas, decision trees, and constants the software uses. Trio Docs labels indicate information from the official Trio documentation at triodocs.org. Clinical labels indicate established diabetes management and pharmacological knowledge. Strategy labels indicate patterns observed in real-world community usage. These tags exist so you can evaluate each piece of information on its own merits and verify it independently.

Why These Are Estimates — Not Prescriptions

The Rules of 500 and 1800 are derived from population averages. They are standard in clinical practice as starting points, but human biology is highly variable. Insulin resistance changes with time of day, exercise, stress, illness, hormonal cycles, and dozens of other factors this estimator cannot account for. The 50/50 basal-to-bolus split is a simplification — many people require a different ratio. The flat hourly basal rate this estimator produces does not reflect the time-of-day variation most people need.

These estimates are a starting line, not a finish line. They must be verified through methodical testing — basal testing during fasting periods, ICR testing with well-counted meals, and ISF testing with correction doses — before they can be trusted for real-world use.

How Estimated Values Connect to Trio's Algorithm

The three core settings this estimator produces — Basal Rate, ICR, and ISF — are the exact values Trio asks for during onboarding. They become your profile settings, and the algorithm's dynamic features build directly on top of them. Dynamic ISF divides your profile ISF by a sensitivity ratio. Dynamic CR divides your profile CR by the same ratio. Adjust Basal multiplies your scheduled basal by a TDD trend ratio. If the profile values are inaccurate, every dynamic adjustment amplifies the inaccuracy. Getting these starting values close is therefore essential to good algorithmic performance.

{/* ═══ DISCLAIMER FOOTER ═══ */}
⚠ Important Disclaimer

This estimator is provided "as-is" with no warranty of any kind. It is a theoretical mathematical model for educational illustration only. It is not a medical device, not a diagnostic tool, and not a clinical decision support system. Outputs are unvalidated estimates that must never be used as the basis for any medical decision, including but not limited to the determination, alteration, or administration of insulin doses or any other medical treatment. No output from this estimator constitutes medical advice. Always consult a qualified healthcare professional before making any changes to diabetes management or insulin therapy.

→ Full Disclaimer at juiceboxpodcast.com
); } export default App;
Skip to Content
JUICEBOXPODCAST.com
Events
Home
EPISODES
A1C and Blood Glucose Calculator
Juicebox Docs - Best Endocrinologists
Private Facebook Group
American Sign Language
Diagnosis Story
Autoimmune Explorer
Struggles To Solutions
Clinician Share
Trials
T1D FDA Tracker
Pre Bolusing: The Juicebox Way
Fat and Protein Insulin Calculator
Improving Type 1 Diabetes Care: A Guide for Physicians
Juicebox for Docs: Grand Rounds Takeaways
Caregiver Burnout
GLP with Type 1 Diabetes
Thyroid
Understanding TSA
My Belly Hurts
Post-Meal Patterns
Habit Lab
MEAL BOLT: A Tutorial for Insulin Dosing
Advice for T1 Parents
Bold Beginnings
Defining Thyroid
Defining Diabetes
Diabetes Pro Tip
Small Sips
Bolus 4
Fat and Protein
Algorithm Pumping
Mental Wellness
Ask Scott & Jenny
Diabetes Variables
After Dark
The Math Behind
Omnipod 5
GLP Meds
Pregnancy
How We Eat
Grand Rounds
Cold Wind
Podcast Quickstart
Diabetes Myths
Type 2 Diabetes
Share Series
The Lists
BLOG
Search
Know The Signs
Merch
Sponsors
0
0
JUICEBOXPODCAST.com
Events
Home
EPISODES
A1C and Blood Glucose Calculator
Juicebox Docs - Best Endocrinologists
Private Facebook Group
American Sign Language
Diagnosis Story
Autoimmune Explorer
Struggles To Solutions
Clinician Share
Trials
T1D FDA Tracker
Pre Bolusing: The Juicebox Way
Fat and Protein Insulin Calculator
Improving Type 1 Diabetes Care: A Guide for Physicians
Juicebox for Docs: Grand Rounds Takeaways
Caregiver Burnout
GLP with Type 1 Diabetes
Thyroid
Understanding TSA
My Belly Hurts
Post-Meal Patterns
Habit Lab
MEAL BOLT: A Tutorial for Insulin Dosing
Advice for T1 Parents
Bold Beginnings
Defining Thyroid
Defining Diabetes
Diabetes Pro Tip
Small Sips
Bolus 4
Fat and Protein
Algorithm Pumping
Mental Wellness
Ask Scott & Jenny
Diabetes Variables
After Dark
The Math Behind
Omnipod 5
GLP Meds
Pregnancy
How We Eat
Grand Rounds
Cold Wind
Podcast Quickstart
Diabetes Myths
Type 2 Diabetes
Share Series
The Lists
BLOG
Search
Know The Signs
Merch
Sponsors
0
0
Events
Home
EPISODES
Folder: SUPPORT
Back
A1C and Blood Glucose Calculator
Juicebox Docs - Best Endocrinologists
Private Facebook Group
American Sign Language
Diagnosis Story
Autoimmune Explorer
Struggles To Solutions
Clinician Share
Trials
T1D FDA Tracker
Folder: GUIDES
Back
Pre Bolusing: The Juicebox Way
Fat and Protein Insulin Calculator
Improving Type 1 Diabetes Care: A Guide for Physicians
Juicebox for Docs: Grand Rounds Takeaways
Caregiver Burnout
GLP with Type 1 Diabetes
Thyroid
Understanding TSA
My Belly Hurts
Post-Meal Patterns
Habit Lab
MEAL BOLT: A Tutorial for Insulin Dosing
Advice for T1 Parents
Folder: SERIES
Back
Bold Beginnings
Defining Thyroid
Defining Diabetes
Diabetes Pro Tip
Small Sips
Bolus 4
Fat and Protein
Algorithm Pumping
Mental Wellness
Ask Scott & Jenny
Diabetes Variables
After Dark
The Math Behind
Omnipod 5
GLP Meds
Pregnancy
How We Eat
Grand Rounds
Cold Wind
Podcast Quickstart
Diabetes Myths
Type 2 Diabetes
Share Series
The Lists
BLOG
Search
Know The Signs
Merch
Sponsors