{"job_id":"anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a","request_id":"test-physics-thermo-1b2ba770-6450-4b1c-a815-8b28db3d7c87-1778704510421","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a/scene-source.json","duration_seconds":15,"byte_size":562464,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-e715d8ba-0c13-42f7-84d1-ec9440b99c4a","request":{"gap":{"topic":"pv-diagram-work","severity":"moderate","error_type":"formula_misuse","memory_state":"fragile","display_topic":"PV Diagram — Work Done by Gas","common_wrong_answer":"Work done by gas is always the product of pressure and volume change, regardless of process path.","confidence_at_error":"high","correct_understanding":"Work done = area under the PV curve. Different processes (isothermal, adiabatic, isobaric) give different areas and hence different work."},"target":{"style":"auto","render":{"fps":30,"format":"mp4","resolution":"1920x1080","include_thumbnail":true,"include_transcript":true},"audience":{"tone":"neutral_instructional","grade":"11","language":"en"},"interactivity":"none","duration_seconds":15},"context":{"chapter":{"name":"Thermodynamics","ncert_class":11,"ncert_chapter_number":12},"sub_topics":[{"topic":"Thermodynamic Processes","key_concepts":["PV diagram","isothermal","adiabatic","work done by gas"]}]},"metadata":{"priority":"normal"},"exam_type":"neet","asset_type":"simulation","request_id":"test-physics-thermo-1b2ba770-6450-4b1c-a815-8b28db3d7c87-1778704510421","subject_area":"physics"},"renderer":"html_three_js_local","storyboard":{"beats":[{"label":"Topic","visual":"Show the topic title and the key physical context.","narration":"PV Diagram — Work Done by Gas"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"Work done by gas is always the product of pressure and volume change, regardless of process path."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"Work done = area under the PV curve. Different processes (isothermal, adiabatic, isobaric) give different areas and hence different work."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"PV diagram. isothermal. adiabatic"}],"title":"PV Diagram — Work Done by Gas","sceneCode":"<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n  <title>PV Diagram – Work Done by Gas</title>\n  <style>\n    :root{--bg:#0f1418;--panel:#182228;--line:#2e3e46;--accent:#e5ba67;--text:#f4f1ea;--muted:#c8d4da;--blue:#63b3ff;--green:#87e8a8;--red:#de7f76;}\n    *{box-sizing:border-box;}\n    body{margin:0;font-family:\"Plus Jakarta Sans\",\"Manrope\",ui-sans-serif,system-ui,sans-serif;background:radial-gradient(120% 90% at 20% -5%,#24343d 0%,var(--bg) 55%);color:var(--text);}\n    main{min-height:100vh;display:grid;grid-template-columns:minmax(300px,380px) 1fr;}\n    aside{border-right:1px solid var(--line);background:linear-gradient(180deg,rgba(31,46,53,.86),rgba(24,34,40,.92));padding:24px;overflow:auto;backdrop-filter:blur(6px);}\n    section{padding:24px;display:grid;place-items:center;}\n    h1{margin:0 0 10px;font-size:1.65rem;line-height:1.15;}\n    .sub{margin:0 0 16px;color:var(--muted);}\n    .formula{margin:0 0 14px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#11191e;color:var(--accent);font-family:ui-monospace,monospace;font-size:0.9rem;box-shadow:inset 0 0 28px rgba(229,186,103,.08);}\n    .control{display:grid;gap:6px;margin:12px 0;}\n    .control input{width:100%;accent-color:var(--accent);}\n    ul{margin:14px 0 0 18px;padding:0;color:var(--muted);display:grid;gap:6px;}\n    .stage{width:min(1020px,95%);aspect-ratio:16/9;border:1px solid #445862;border-radius:14px;position:relative;overflow:hidden;background:radial-gradient(circle at 50% 38%,#2f4a57,#0f1418 72%);box-shadow:0 18px 60px rgba(0,0,0,.45), inset 0 0 90px rgba(255,255,255,.03);}\n    .stage::before{content:\"\";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.06),transparent 34%);pointer-events:none;}\n    .legend{position:absolute;right:12px;top:12px;padding:8px 10px;border-radius:10px;border:1px solid #465a64;background:rgba(9,14,18,.58);font-size:0.8rem;color:var(--muted);backdrop-filter:blur(4px);z-index:10;}\n    @media(max-width:900px){main{grid-template-columns:1fr;}aside{border-right:0;border-bottom:1px solid var(--line);}}\n  </style>\n</head>\n<body>\n<main>\n  <aside>\n    <h1>PV Diagram Work</h1>\n    <p class=\"sub\">Why work ≠ just P×ΔV</p>\n    <p class=\"formula\">W = ∫ P dV = Area under curve</p>\n    <label class=\"control\"><span>Process: <strong id=\"v-process\">Isobaric</strong></span><input id=\"c-process\" type=\"range\" min=\"0\" max=\"2\" step=\"1\" value=\"0\"/></label>\n    <label class=\"control\"><span>Speed: <strong id=\"v-speed\">1.0</strong>×</span><input id=\"c-speed\" type=\"range\" min=\"0.3\" max=\"2\" step=\"0.1\" value=\"1.0\"/></label>\n    <ul>\n      <li><strong>Isobaric (P const):</strong> W = P·ΔV, area = rectangle</li>\n      <li><strong>Isothermal:</strong> W = nRT·ln(V₂/V₁), area under hyperbola</li>\n      <li><strong>Adiabatic:</strong> W = (P₁V₁ - P₂V₂)/(γ-1), area smaller</li>\n      <li><strong>❌ Myth:</strong> All processes give same work for same ΔV</li>\n      <li><strong>✓ Truth:</strong> Different paths = different areas = different work!</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">Ready</div>\n      <canvas id=\"sim-cv\" style=\"position:absolute;inset:0;width:100%;height:100%;\"></canvas>\n    </div>\n  </section>\n</main>\n<script>\nconst controls = [\n  {\"key\":\"process\",\"label\":\"Process\",\"min\":0,\"max\":2,\"step\":1,\"value\":0,\"units\":\"\"},\n  {\"key\":\"speed\",\"label\":\"Speed\",\"min\":0.3,\"max\":2,\"step\":0.1,\"value\":1.0,\"units\":\"x\"}\n];\nfor(const c of controls){\n  const inp=document.getElementById('c-'+c.key);\n  const out=document.getElementById('v-'+c.key);\n  inp?.addEventListener('input',()=>{\n    if(c.key==='process'){\n      const names=['Isobaric','Isothermal','Adiabatic'];\n      out.textContent=names[parseInt(inp.value)];\n    }else{\n      out.textContent=inp.value;\n    }\n    window.updateModel?.();\n  });\n}\n(function(){\n  const cv=document.getElementById('sim-cv');\n  const ctx=cv.getContext('2d');\n  function resize(){const r=cv.getBoundingClientRect();if(r.width>0){cv.width=r.width;cv.height=r.height;}}\n  resize();new ResizeObserver(resize).observe(cv);\n  \n  let lastTs=0;\n  let state={\n    phase:0,\n    V:1.0,\n    P:3.0,\n    trailIsobaric:[],\n    trailIsothermal:[],\n    trailAdiabatic:[],\n    workIsobaric:0,\n    workIsothermal:0,\n    workAdiabatic:0\n  };\n  \n  function glowDot(x,y,r,color,a){\n    const g=ctx.createRadialGradient(x,y,0,x,y,r*2.6);\n    const c1=color.replace('ALPHA',String(a));\n    const c2=color.replace('ALPHA','0');\n    g.addColorStop(0,c1);\n    g.addColorStop(1,c2);\n    ctx.fillStyle=g;ctx.beginPath();ctx.arc(x,y,r*2.6,0,Math.PI*2);ctx.fill();\n  }\n  \n  function trail(points,color){\n    if(points.length<2)return;\n    ctx.strokeStyle=color;ctx.lineWidth=2.5;ctx.globalAlpha=0.5;\n    ctx.beginPath();ctx.moveTo(points[0].x,points[0].y);\n    for(let i=1;i<points.length;i++)ctx.lineTo(points[i].x,points[i].y);\n    ctx.stroke();ctx.globalAlpha=1;\n  }\n  \n  function arrow(x1,y1,x2,y2,color,w){\n    const dx=x2-x1,dy=y2-y1,l=Math.sqrt(dx*dx+dy*dy);\n    if(l<2)return;\n    const nx=dx/l,ny=dy/l,s=12;\n    ctx.strokeStyle=color;ctx.lineWidth=w||2;\n    ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;ctx.beginPath();ctx.moveTo(x2,y2);\n    ctx.lineTo(x2-s*nx+s*0.35*ny,y2-s*ny-s*0.35*nx);\n    ctx.lineTo(x2-s*nx-s*0.35*ny,y2-s*ny+s*0.35*nx);ctx.fill();\n  }\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);lastTs=ts;\n    const W=cv.width,H=cv.height;\n    \n    const processIdx=parseInt(document.getElementById('c-process').value);\n    const speed=parseFloat(document.getElementById('c-speed').value);\n    \n    // Phase progression (0 to 1 over ~15 sec at speed=1)\n    state.phase+=dt*speed*0.067; // 15s cycle\n    if(state.phase>1)state.phase=1;\n    \n    const t=state.phase;\n    \n    // Compute states for each process\n    // Isobaric: P constant, V increases\n    const V_iso=1.0+2.0*t;\n    const P_iso=3.0;\n    \n    // Isothermal: PV=const, so P decreases as V increases\n    const V_iso_t=1.0+2.0*t;\n    const P_iso_t=3.0/V_iso_t;\n    \n    // Adiabatic: PV^gamma = const, gamma=1.4 for diatomic gas\n    const gamma=1.4;\n    const V_adi=1.0+2.0*t;\n    const P1V1gamma=Math.pow(3.0*1.0,gamma);\n    const P_adi=P1V1gamma/Math.pow(V_adi,gamma);\n    \n    // PV diagram axes\n    const marginL=80, marginB=80, marginR=40, marginT=50;\n    const plotW=W-marginL-marginR;\n    const plotH=H-marginB-marginT;\n    \n    const vMin=0.5, vMax=3.5;\n    const pMin=0, pMax=4;\n    \n    // Transform functions\n    const v2x=(v)=>marginL+((v-vMin)/(vMax-vMin))*plotW;\n    const p2y=(p)=>H-marginB-((p-pMin)/(pMax-pMin))*plotH;\n    \n    // Clear\n    ctx.clearRect(0,0,W,H);\n    \n    // Background\n    ctx.fillStyle='rgba(15,20,24,0.3)';ctx.fillRect(0,0,W,H);\n    \n    // Grid\n    ctx.strokeStyle='rgba(70,90,100,0.2)';ctx.lineWidth=1;\n    for(let i=1;i<7;i++){\n      const vline=vMin+i*(vMax-vMin)/7;\n      const x=v2x(vline);\n      ctx.beginPath();ctx.moveTo(x,marginT);ctx.lineTo(x,H-marginB);ctx.stroke();\n    }\n    for(let i=1;i<8;i++){\n      const pline=pMin+i*(pMax-pMin)/8;\n      const y=p2y(pline);\n      ctx.beginPath();ctx.moveTo(marginL,y);ctx.lineTo(W-marginR,y);ctx.stroke();\n    }\n    \n    // Axes\n    ctx.strokeStyle='var(--text)';ctx.lineWidth=2.5;\n    ctx.beginPath();ctx.moveTo(marginL,H-marginB);ctx.lineTo(W-marginR,H-marginB);ctx.stroke(); // V axis\n    ctx.beginPath();ctx.moveTo(marginL,marginT);ctx.lineTo(marginL,H-marginB);ctx.stroke(); // P axis\n    \n    // Axis labels\n    ctx.fillStyle='var(--text)';ctx.font=Math.round(H*0.035)+'px sans-serif';\n    ctx.textAlign='center';ctx.textBaseline='top';\n    ctx.fillText('V (L)',W-marginR-20,H-marginB+12);\n    ctx.textAlign='right';ctx.textBaseline='middle';\n    ctx.fillText('P (atm)',marginL-15,marginT-5);\n    \n    // Tick labels\n    ctx.font=Math.round(H*0.03)+'px sans-serif';ctx.fillStyle='var(--muted)';\n    ctx.textAlign='center';ctx.textBaseline='top';\n    for(let i=0;i<=3;i++){\n      const vval=1+i*0.75;\n      ctx.fillText(vval.toFixed(2),v2x(vval),H-marginB+8);\n    }\n    ctx.textAlign='right';ctx.textBaseline='middle';\n    for(let i=0;i<=4;i++){\n      const pval=i;\n      ctx.fillText(pval.toFixed(1),marginL-8,p2y(pval));\n    }\n    \n    // Draw all three process curves\n    // Isobaric curve\n    ctx.strokeStyle='#63b3ff';ctx.lineWidth=2.5;ctx.beginPath();\n    let first=true;\n    for(let ti=0;ti<=1;ti+=0.05){\n      const Vi=1.0+2.0*ti;\n      const Pi=3.0;\n      const xi=v2x(Vi);const yi=p2y(Pi);\n      if(first){ctx.moveTo(xi,yi);first=false;}else{ctx.lineTo(xi,yi);}\n    }\n    ctx.stroke();\n    \n    // Isothermal curve\n    ctx.strokeStyle='#87e8a8';ctx.lineWidth=2.5;ctx.beginPath();\n    first=true;\n    for(let ti=0;ti<=1;ti+=0.05){\n      const Vi=1.0+2.0*ti;\n      const Pi=3.0/Vi;\n      const xi=v2x(Vi);const yi=p2y(Pi);\n      if(first){ctx.moveTo(xi,yi);first=false;}else{ctx.lineTo(xi,yi);}\n    }\n    ctx.stroke();\n    \n    // Adiabatic curve\n    ctx.strokeStyle='#de7f76';ctx.lineWidth=2.5;ctx.beginPath();\n    first=true;\n    for(let ti=0;ti<=1;ti+=0.05){\n      const Vi=1.0+2.0*ti;\n      const Pi=P1V1gamma/Math.pow(Vi,gamma);\n      const xi=v2x(Vi);const yi=p2y(Pi);\n      if(first){ctx.moveTo(xi,yi);first=false;}else{ctx.lineTo(xi,yi);}\n    }\n    ctx.stroke();\n    \n    // Fill areas under curves\n    // Isobaric\n    ctx.fillStyle='rgba(99,179,255,0.15)';ctx.beginPath();\n    ctx.moveTo(v2x(1.0),p2y(0));\n    for(let ti=0;ti<=t;ti+=0.05){\n      const Vi=1.0+2.0*ti;\n      ctx.lineTo(v2x(Vi),p2y(3.0));\n    }\n    ctx.lineTo(v2x(V_iso),p2y(0","remediationGoal":"Close formula_misuse for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T20:39:49.726Z","cache_hit":false,"cost_usd":0},"error":null}