{"job_id":"anim-job-90c19627-ec64-4e5d-8783-31fed5750415","request_id":"test-physics-thermo-ba30c5e5-e5bb-4ff3-90a7-a40b2e480a51-1778708287067","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-90c19627-ec64-4e5d-8783-31fed5750415/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-90c19627-ec64-4e5d-8783-31fed5750415/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-90c19627-ec64-4e5d-8783-31fed5750415/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-90c19627-ec64-4e5d-8783-31fed5750415/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-90c19627-ec64-4e5d-8783-31fed5750415/scene-source.json","duration_seconds":15,"byte_size":492174,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-90c19627-ec64-4e5d-8783-31fed5750415","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-90c19627-ec64-4e5d-8783-31fed5750415","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-ba30c5e5-e5bb-4ff3-90a7-a40b2e480a51-1778708287067","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\",\"Inter\",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);font-weight:600;}\n    .icon-warn{display:inline-block;width:16px;height:16px;margin-right:6px;vertical-align:middle;}\n    .icon-check{display:inline-block;width:16px;height:16px;margin-right:6px;vertical-align:middle;}\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\">Understand why path matters in work calculation</p>\n    <p class=\"formula\">W = ∫P dV = Area under curve</p>\n    <label class=\"control\"><span>Process: <strong id=\"v-process\">Isothermal</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>x</span><input id=\"c-speed\" type=\"range\" min=\"0.3\" max=\"2\" step=\"0.1\" value=\"1\"/></label>\n    <ul>\n      <li><strong style=\"color:var(--red);\">✗ Mistake:</strong> W = P·ΔV always</li>\n      <li><strong style=\"color:var(--green);\">✓ Truth:</strong> Work = area under PV path</li>\n      <li>Each process shape → different work</li>\n      <li>Isothermal ≠ Isobaric ≠ Adiabatic</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">Isothermal (slow)</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,\"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=['Isothermal','Isobaric','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  let lastTs=0;\n\n  // State: cycle phase\n  let cyclePhase=0; // 0 to 1\n\n  function glowDot(x,y,r,color,a){\n    const g=ctx.createRadialGradient(x,y,0,x,y,r*2.6);\n    g.addColorStop(0,color.replace('ALPHA',String(a)));\n    g.addColorStop(1,color.replace('ALPHA','0'));\n    ctx.fillStyle=g;ctx.beginPath();ctx.arc(x,y,r*2.6,0,Math.PI*2);ctx.fill();\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;\n    ctx.lineWidth=w||2;\n    ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;\n    ctx.beginPath();ctx.moveTo(x2,y2);\n    ctx.lineTo(x2-s*nx+s*0.5*ny,y2-s*ny-s*0.5*nx);\n    ctx.lineTo(x2-s*nx-s*0.5*ny,y2-s*ny+s*0.5*nx);\n    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    // Read controls\n    const processType=parseInt(document.getElementById('c-process').value);\n    const speed=parseFloat(document.getElementById('c-speed').value);\n\n    // Update cycle phase\n    cyclePhase+=(speed*0.15)*dt;\n    if(cyclePhase>1)cyclePhase-=1;\n\n    // Clear\n    ctx.clearRect(0,0,W,H);\n    ctx.fillStyle='rgba(15,20,24,0.4)';\n    ctx.fillRect(0,0,W,H);\n\n    // Layout: PV diagram on left, comparison panel on right\n    const diag_x=80, diag_y=50, diag_w=340, diag_h=320;\n    const comp_x=520, comp_y=60, comp_w=380, comp_h=300;\n\n    // === PV DIAGRAM ===\n    ctx.strokeStyle='#465a64';ctx.lineWidth=2;\n    ctx.beginPath();ctx.moveTo(diag_x,diag_y+diag_h);ctx.lineTo(diag_x+diag_w,diag_y+diag_h);ctx.stroke(); // x-axis\n    ctx.beginPath();ctx.moveTo(diag_x,diag_y);ctx.lineTo(diag_x,diag_y+diag_h);ctx.stroke(); // y-axis\n\n    // Labels\n    ctx.fillStyle='#c8d4da';\n    ctx.font=Math.round(H*0.035)+'px sans-serif';\n    ctx.textAlign='right';ctx.fillText('P',diag_x-12,diag_y-8);\n    ctx.textAlign='left';ctx.fillText('V',diag_x+diag_w+8,diag_y+diag_h+12);\n\n    // Tick marks\n    ctx.strokeStyle='#2e3e46';ctx.lineWidth=1;\n    for(let i=1;i<4;i++){\n      ctx.beginPath();ctx.moveTo(diag_x-4,diag_y+i*(diag_h/3));ctx.lineTo(diag_x,diag_y+i*(diag_h/3));ctx.stroke();\n      ctx.beginPath();ctx.moveTo(diag_x+i*(diag_w/3),diag_y+diag_h);ctx.lineTo(diag_x+i*(diag_w/3),diag_y+diag_h+4);ctx.stroke();\n    }\n\n    // State points\n    const p1=1.0, v1=1.0;  // initial (normalized)\n    const p2=0.35, v2=2.8; // final\n\n    // Map to canvas\n    function pvToCanvas(p,v){\n      const cx=diag_x+24+(v/3)*diag_w*0.85;\n      const cy=diag_y+diag_h-60-(p)*diag_h*0.8;\n      return {x:cx,y:cy};\n    }\n\n    const state1=pvToCanvas(p1,v1);\n    const state2=pvToCanvas(p2,v2);\n\n    // Draw process path\n    ctx.lineWidth=3;\n    let workArea=0;\n\n    if(processType===0){\n      // Isothermal: PV = const → P = C/V hyperbola\n      ctx.strokeStyle='#63b3ff';\n      ctx.beginPath();\n      let first=true;\n      for(let v=v1;v<=v2;v+=0.05){\n        const p=p1*v1/v;\n        const pt=pvToCanvas(p,v);\n        if(first){ctx.moveTo(pt.x,pt.y);first=false;}\n        else ctx.lineTo(pt.x,pt.y);\n      }\n      ctx.stroke();\n\n      // Work = integral P dV = nRT ln(V2/V1)\n      workArea=p1*v1*Math.log(v2/v1);\n\n      // Shade area\n      ctx.fillStyle='rgba(99,179,255,0.15)';\n      ctx.beginPath();ctx.moveTo(state1.x,state1.y);\n      for(let v=v1;v<=v2;v+=0.05){\n        const p=p1*v1/v;\n        const pt=pvToCanvas(p,v);\n        ctx.lineTo(pt.x,pt.y);\n      }\n      ctx.lineTo(state2.x,state2.y+200);\n      ctx.lineTo(state1.x,state1.y+200);\n      ctx.closePath();\n      ctx.fill();\n    }else if(processType===1){\n      // Isobaric: P = const, straight line right\n      ctx.strokeStyle='#87e8a8';\n      ctx.beginPath();ctx.moveTo(state1.x,state1.y);ctx.lineTo(state2.x,state2.y);ctx.stroke();\n\n      // Work = P·ΔV\n      workArea=(p1+p2)/2*(v2-v1);\n\n      // Shade area\n      ctx.fillStyle='rgba(135,232,168,0.15)';\n      ctx.beginPath();ctx.moveTo(state1.x,state1.y);ctx.lineTo(state2.x,state2.y);\n      ctx.lineTo(state2.x,state2.y+200);ctx.lineTo(state1.x,state1.y+200);ctx.closePath();ctx.fill();\n    }else{\n      // Adiabatic: PV^γ = const (γ=1.4), steeper\n      ctx.strokeStyle='#de7f76';\n      const gamma=1.4;\n      ctx.beginPath();\n      let first=true;\n      for(let v=v1;v<=v2;v+=0.05){\n        const p=p1*Math.pow(v1/v,gamma);\n        const pt=pvToCanvas(p,v);\n        if(first){ctx.moveTo(pt.x,pt.y);first=false;}\n        else ctx.lineTo(pt.x,pt.y);\n      }\n      ctx.stroke();\n\n      // Work ≈ integral P dV (between isothermal and isobaric)\n      workArea=p1*v1/(gamma-1)*(1-Math.pow(v1/v2,gamma-1));\n\n      // Shade area\n      ctx.fillStyle='rgba(222,127,118,0.15)';\n      ctx.beginPath();ctx.moveTo(state1.x,state1.y);\n      for(let v=v1;v<=v2;v+=0.05){\n        const p=p1*Math.pow(v1/v,gamma);\n        const pt=pvToCanvas(p,v);\n        ctx.lineTo(pt.x,pt.y);\n      }\n      ctx.lineTo(state2.x,state2.y+200);\n      ctx.lineTo(state1.x,state1.y+200);\n      ctx.closePath();\n      ctx.fill();\n    }\n\n    // Animate state point along curve\n    const t=cyclePhase;\n    let curP,curV;\n    if(processType===0){\n      curV=v1+t*(v2-v1);\n      curP=p1*v1/curV;\n    }else if(processType===1){\n      curV=v1+t*(v2-v1);\n      curP=p1;\n    }else{\n      curV=v1+t*(v2-v1);\n      curP=p1*Math.pow(v1/curV,1.4);\n    }\n    const curState=pvToCanvas(curP,curV);\n\n    // Draw moving dot","remediationGoal":"Close formula_misuse for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T21:41:54.968Z","cache_hit":false,"cost_usd":0},"error":null}