{"job_id":"anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad","request_id":"test-physics-doppler-fef4a9a4-ee3c-4109-9b59-ca80c158fc36-1778702709883","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad/scene-source.json","duration_seconds":15,"byte_size":270474,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-9983cfe8-bc06-46f3-b90d-d52fa4eca1ad","request":{"gap":{"topic":"doppler-approaching-receding","severity":"moderate","error_type":"wrong_assumption","memory_state":"fragile","display_topic":"Doppler Effect — Approaching vs Receding Source","common_wrong_answer":"The Doppler shift only applies when the observer is moving, not when the source moves.","confidence_at_error":"high","correct_understanding":"Both source and observer motion change apparent frequency. Approaching → higher pitch; receding → lower pitch. f_observed = f_source × (v ± v_observer)/(v ∓ v_source)."},"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":"Waves","ncert_class":11,"ncert_chapter_number":15},"sub_topics":[{"topic":"Doppler Effect","key_concepts":["Doppler","apparent frequency","source velocity","observer velocity"]}]},"metadata":{"priority":"normal"},"exam_type":"neet","asset_type":"simulation","request_id":"test-physics-doppler-fef4a9a4-ee3c-4109-9b59-ca80c158fc36-1778702709883","subject_area":"physics"},"renderer":"html_three_js_local","storyboard":{"beats":[{"label":"Topic","visual":"Show the topic title and the key physical context.","narration":"Doppler Effect — Approaching vs Receding Source"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"The Doppler shift only applies when the observer is moving, not when the source moves."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"Both source and observer motion change apparent frequency. Approaching → higher pitch; receding → lower pitch. f_observed = f_source × (v ± v_observer)/(v ∓ v_source)."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"Doppler. apparent frequency. source velocity"}],"title":"Doppler Effect — Approaching vs Receding Source","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>Doppler Effect: Source & Observer Motion</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);}\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>Doppler Effect</h1>\n    <p class=\"sub\">Both source AND observer motion matter!</p>\n    <p class=\"formula\">f_obs = f_source × (v ± v_obs)/(v ∓ v_src)</p>\n    <label class=\"control\"><span>Source Speed: <strong id=\"v-srcspeed\">0.3</strong> v</span><input id=\"c-srcspeed\" type=\"range\" min=\"0\" max=\"0.8\" step=\"0.05\" value=\"0.3\"/></label>\n    <label class=\"control\"><span>Source Dir: <strong id=\"v-srcdir\">→ Approach</strong></span><input id=\"c-srcdir\" type=\"range\" min=\"0\" max=\"1\" step=\"1\" value=\"0\"/></label>\n    <label class=\"control\"><span>Observer Speed: <strong id=\"v-obsdia\">0.2</strong> v</span><input id=\"c-obsdia\" type=\"range\" min=\"0\" max=\"0.6\" step=\"0.05\" value=\"0.2\"/></label>\n    <label class=\"control\"><span>Observer Dir: <strong id=\"v-obsdir\">→ Approach</strong></span><input id=\"c-obsdir\" type=\"range\" min=\"0\" max=\"1\" step=\"1\" value=\"0\"/></label>\n    <ul>\n      <li><strong>The Mistake:</strong> \"Only observer motion changes pitch\"</li>\n      <li><strong>The Truth:</strong> <em>Both</em> source and observer motion alter frequency</li>\n      <li><strong>Physics:</strong> Approaching → compressed waves → higher pitch</li>\n      <li><strong>Watch:</strong> Wave spacing & frequency readout change with each motion</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\":\"srcspeed\",\"label\":\"Source Speed\",\"min\":0,\"max\":0.8,\"step\":0.05,\"value\":0.3,\"units\":\"v\"},\n  {\"key\":\"srcdir\",\"label\":\"Source Direction\",\"min\":0,\"max\":1,\"step\":1,\"value\":0,\"units\":\"0=approach\"},\n  {\"key\":\"obsdia\",\"label\":\"Observer Speed\",\"min\":0,\"max\":0.6,\"step\":0.05,\"value\":0.2,\"units\":\"v\"},\n  {\"key\":\"obsdir\",\"label\":\"Observer Direction\",\"min\":0,\"max\":1,\"step\":1,\"value\":0,\"units\":\"0=approach\"}\n];\nfor(const c of controls){\n  const inp=document.getElementById('c-'+c.key);\n  const out=document.getElementById('v-'+c.key);\n  if(inp){\n    inp.addEventListener('input',()=>{\n      if(c.key==='srcdir'){\n        out.textContent=inp.value==='0'?'→ Approach':'← Recede';\n      } else if(c.key==='obsdir'){\n        out.textContent=inp.value==='0'?'→ Approach':'← Recede';\n      } else {\n        out.textContent=inp.value;\n      }\n      window.updateModel?.();\n    });\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\n  let srcX=150,srcVel=0;\n  let obsX=550,obsVel=0;\n  let time=0;\n  let wavePhase=0;\n  let freqHistory=[];\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){\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=10;\n    ctx.strokeStyle=color;ctx.lineWidth=2;\n    ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;ctx.beginPath();\n    ctx.moveTo(x2,y2);\n    ctx.lineTo(x2-s*nx+s*0.4*ny,y2-s*ny-s*0.4*nx);\n    ctx.lineTo(x2-s*nx-s*0.4*ny,y2-s*ny+s*0.4*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 sliders\n    const srcSpeed=Number(document.getElementById('c-srcspeed').value);\n    const srcDir=Number(document.getElementById('c-srcdir').value)===0?1:-1;\n    const obsSpeed=Number(document.getElementById('c-obsdia').value);\n    const obsDir=Number(document.getElementById('c-obsdir').value)===0?1:-1;\n    \n    // Speed of sound (normalized)\n    const v_sound=1.0;\n    \n    // Update positions with boundaries\n    srcVel=srcSpeed*srcDir;\n    obsVel=obsSpeed*obsDir;\n    srcX+=srcVel*100*dt;\n    obsX+=obsVel*100*dt;\n    srcX=Math.max(80,Math.min(W-80,srcX));\n    obsX=Math.max(80,Math.min(W-80,obsX));\n    \n    time+=dt;\n    wavePhase+=dt*6;\n    \n    // Compute observed frequency\n    // f_obs = f_source * (v_sound - v_observer) / (v_sound - v_source)\n    const f_source=1.0;\n    const v_obs_rel=obsVel;\n    const v_src_rel=srcVel;\n    const denom=v_sound-v_src_rel;\n    const f_obs=f_source*(v_sound-v_obs_rel)/(denom>0.05?denom:0.05);\n    \n    freqHistory.push(f_obs);\n    if(freqHistory.length>120)freqHistory.shift();\n    \n    // Clear\n    ctx.fillStyle='#0f1418';ctx.fillRect(0,0,W,H);\n    \n    // ==== LAYER 1: Background & Grid ====\n    ctx.strokeStyle='#2e3e46';ctx.lineWidth=1;ctx.globalAlpha=0.2;\n    for(let i=0;i<W;i+=40){ctx.beginPath();ctx.moveTo(i,0);ctx.lineTo(i,H);ctx.stroke();}\n    for(let i=0;i<H;i+=40){ctx.beginPath();ctx.moveTo(0,i);ctx.lineTo(W,i);ctx.stroke();}\n    ctx.globalAlpha=1;\n    \n    // ==== LAYER 2: Wave Visualization ====\n    // Draw expanding wavefronts from source\n    const waveColor='rgba(99,179,255,';\n    for(let w=0;w<5;w++){\n      const waveRadius=(wavePhase-w*30)%120+20;\n      ctx.strokeStyle=waveColor+(0.4-w*0.08)+')';\n      ctx.lineWidth=2;\n      ctx.beginPath();ctx.arc(srcX,H*0.5,waveRadius,0,Math.PI*2);ctx.stroke();\n    }\n    \n    // Source\n    ctx.fillStyle='#de7f76';\n    ctx.beginPath();ctx.arc(srcX,H*0.5,12,0,Math.PI*2);ctx.fill();\n    glowDot(srcX,H*0.5,12,'rgba(222,127,118,ALPHA)',0.5);\n    \n    // Observer\n    ctx.fillStyle='#87e8a8';\n    ctx.beginPath();ctx.arc(obsX,H*0.5,12,0,Math.PI*2);ctx.fill();\n    glowDot(obsX,H*0.5,12,'rgba(135,232,168,ALPHA)',0.5);\n    \n    // ==== LAYER 3: Velocity Arrows ====\n    arrow(srcX,H*0.5-25,srcX+srcVel*80,H*0.5-25,'#de7f76');\n    arrow(obsX,H*0.5+25,obsX+obsVel*80,H*0.5+25,'#87e8a8');\n    \n    // ==== LAYER 4: Labels & Vectors ====\n    ctx.fillStyle='#e5ba67';\n    ctx.font=Math.round(H*0.035)+'px sans-serif';\n    ctx.textAlign='center';\n    ctx.fillText('SOURCE',srcX,H*0.35);\n    ctx.fillText('OBSERVER',obsX,H*0.65);\n    \n    ctx.fillStyle='#c8d4da';\n    ctx.font=Math.round(H*0.028)+'px sans-serif';\n    ctx.fillText('v_src = '+srcSpeed.toFixed(2)+'v',srcX,H*0.38);\n    ctx.fillText('v_obs = '+obsSpeed.toFixed(2)+'v',obsX,H*0.68);\n    \n    // Separation info\n    const sep=Math.abs(obsX-srcX);\n    const approaching=srcDir>0 && obsDir>0?(srcSpeed>obsSpeed?'YES':'NO'):srcDir>0?'YES':obsDir<0?'YES':'NO';\n    ctx.fillStyle='#63b3ff';\n    ctx.font=Math.round(H*0.032)+'px sans-serif';\n    ctx.textAlign='center';\n    ctx.fillText('Separation: '+Math.round(sep)+'px',W*0.5,H*0.15);\n    \n    // ==== LAYER 5: Frequency Graph ====\n    const graphX=W*0.12;\n    const graphY=H*0.75;\n    const graphW=200;\n    const graphH=80;\n    \n    ctx.strokeStyle='#445862';ctx.lineWidth=1;ctx.globalAlpha=0.5;\n    ctx.strokeRect(graphX,graphY,graphW,graphH);ctx.globalAlpha=1;\n    \n    ctx.fillStyle='#11191e';\n    ctx.fillRect(graphX,graphY,graphW,graphH);\n    \n    ctx.strokeStyle='#e5ba67';ctx.lineWidth=2;ctx.beginPath();\n    for(let i=0;i<freqHistory.length;i++){\n      const fh=freqHistory[i];\n      const px=graphX+(i/Math.max(1,freqHistory.length-1))*graphW;\n      const py=graphY+graphH-Math.min(60,fh*30);\n      if(i===0)ctx.moveTo(px,py);\n      else ctx.lineTo(px,py);\n    }\n    ctx.stroke();\n    \n    ctx.fillStyle='#e5ba67';\n    ctx.font=Math.round(H*0.025)+'px sans-serif';\n    ctx.textAlign='left';\n    ctx.fillText('f_obs',graphX+4,graphY-4);\n    \n    // ==== LAYER 6: Main Frequency Readout ====\n    ctx.fillStyle='#87e8a8';\n    ctx.font=Math.round(H*0.045)+'","remediationGoal":"Close wrong_assumption for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T20:10:41.047Z","cache_hit":false,"cost_usd":0},"error":null}