{"job_id":"anim-job-6056d852-0355-44c5-9b99-94c28043fe5f","request_id":"test-physics-doppler-ba30c5e5-e5bb-4ff3-90a7-a40b2e480a51-1778708287067","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-6056d852-0355-44c5-9b99-94c28043fe5f/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-6056d852-0355-44c5-9b99-94c28043fe5f/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-6056d852-0355-44c5-9b99-94c28043fe5f/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-6056d852-0355-44c5-9b99-94c28043fe5f/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-6056d852-0355-44c5-9b99-94c28043fe5f/scene-source.json","duration_seconds":15,"byte_size":501404,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-6056d852-0355-44c5-9b99-94c28043fe5f","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-6056d852-0355-44c5-9b99-94c28043fe5f","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-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":"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\",\"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);}\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\">Source AND observer motion both matter!</p>\n    <p class=\"formula\">f' = f₀ × (v ± v_obs)/(v ∓ v_src)</p>\n    <label class=\"control\"><span>Source Speed: <strong id=\"v-src\">2</strong> m/s</span><input id=\"c-src\" type=\"range\" min=\"0\" max=\"8\" step=\"0.5\" value=\"2\"/></label>\n    <label class=\"control\"><span>Observer Speed: <strong id=\"v-obs\">1</strong> m/s</span><input id=\"c-obs\" type=\"range\" min=\"0\" max=\"8\" step=\"0.5\" value=\"1\"/></label>\n    <label class=\"control\"><span>Source Direction: <strong id=\"v-dir\">→</strong></span><input id=\"c-dir\" type=\"range\" min=\"0\" max=\"1\" step=\"1\" value=\"0\"/></label>\n    <ul>\n      <li><strong>❌ Wrong:</strong> Only observer motion shifts frequency</li>\n      <li><strong>✓ Correct:</strong> Source motion compresses/stretches waves</li>\n      <li><strong>Key:</strong> Moving source changes wavelength directly</li>\n      <li><strong>Result:</strong> Frequency shifts from both motions</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">f' = 0 Hz</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\":\"src\",\"label\":\"Source Speed\",\"min\":0,\"max\":8,\"step\":0.5,\"value\":2,\"units\":\"m/s\"},\n  {\"key\":\"obs\",\"label\":\"Observer Speed\",\"min\":0,\"max\":8,\"step\":0.5,\"value\":1,\"units\":\"m/s\"},\n  {\"key\":\"dir\",\"label\":\"Source Direction\",\"min\":0,\"max\":1,\"step\":1,\"value\":0,\"units\":\"\"}\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==='dir'){\n      out.textContent=inp.value==='0'?'→':'←';\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 time=0;\n  \n  // State: positions and trails\n  let srcX=0, srcY=0;\n  let obsX=0, obsY=0;\n  let srcTrail=[];\n  let obsTrail=[];\n  \n  const c_speed=340; // speed of sound in m/s\n  const freq0=400; // base frequency in Hz\n  const scale=30; // pixels per m/s\n  const maxTrailLen=40;\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(Math.max(0,a)));\n    const c0=color.replace('ALPHA','0');\n    g.addColorStop(0,c1);\n    g.addColorStop(1,c0);\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;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.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 trail(points,color){\n    if(points.length<2)return;\n    ctx.strokeStyle=color;ctx.lineWidth=2;ctx.globalAlpha=0.3;\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 tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);lastTs=ts;\n    time+=dt;\n    \n    const W=cv.width,H=cv.height;\n    \n    // Read sliders\n    const srcSpeed=Number(document.getElementById('c-src').value);\n    const obsSpeed=Number(document.getElementById('c-obs').value);\n    const srcDir=Number(document.getElementById('c-dir').value);\n    \n    // Calculate actual velocities (m/s)\n    const vSrc=srcDir===0?srcSpeed:-srcSpeed;\n    const vObs=obsSpeed; // observer always moving right\n    \n    // Position: source moves horizontally, observer trails behind/ahead\n    const srcPx=W*0.35 + vSrc*scale*time;\n    const obsPx=W*0.65 + vObs*scale*time;\n    \n    srcX=srcPx;\n    srcY=H*0.5;\n    obsX=obsPx;\n    obsY=H*0.5+60;\n    \n    // Update trails\n    srcTrail.push({x:srcX,y:srcY});\n    if(srcTrail.length>maxTrailLen)srcTrail.shift();\n    obsTrail.push({x:obsX,y:obsY});\n    if(obsTrail.length>maxTrailLen)obsTrail.shift();\n    \n    // Doppler formula: f' = f0 * (c + v_obs) / (c - v_src)\n    // Using + for observer approaching, - for receding\n    // And - for source approaching, + for receding\n    const freqObserved=freq0*(c_speed+vObs)/(c_speed-vSrc);\n    \n    // Distance between source and observer\n    const dist=Math.abs(obsX-srcX);\n    \n    // Clear\n    ctx.fillStyle='#0f1418';\n    ctx.fillRect(0,0,W,H);\n    \n    // ===== Background layers =====\n    // Ground line\n    ctx.strokeStyle='#2e3e46';ctx.lineWidth=1;ctx.setLineDash([4,4]);\n    ctx.beginPath();ctx.moveTo(0,H*0.5);ctx.lineTo(W,H*0.5);ctx.stroke();\n    ctx.setLineDash([]);\n    \n    // Wave visualization (concentric circles from source)\n    const wavePhase=(time*freq0*2*Math.PI)%( 2*Math.PI);\n    const waveSpacing=c_speed*scale/freq0*0.3; // wavelength visualization\n    ctx.strokeStyle='rgba(99,179,255,0.15)';ctx.lineWidth=1;\n    for(let w=0;w<200;w+=waveSpacing){\n      const r=Math.abs((w-wavePhase*2)%waveSpacing-waveSpacing*0.5)*2;\n      if(r<150){\n        ctx.beginPath();ctx.arc(srcX,srcY,r,0,Math.PI*2);ctx.stroke();\n      }\n    }\n    \n    // ===== Main action =====\n    // Trails\n    trail(srcTrail,'rgba(222,127,118,0.4)');\n    trail(obsTrail,'rgba(99,179,255,0.4)');\n    \n    // Velocity vectors\n    if(srcSpeed>0.1){\n      const vxSrc=vSrc>0?srcSpeed:-srcSpeed;\n      arrow(srcX,srcY,srcX+vxSrc*scale*3,srcY,'#de7f76');\n    }\n    if(obsSpeed>0.1){\n      arrow(obsX,obsY,obsX+obsSpeed*scale*3,obsY,'#63b3ff');\n    }\n    \n    // Source (red circle)\n    ctx.fillStyle='#de7f76';ctx.beginPath();ctx.arc(srcX,srcY,12,0,Math.PI*2);ctx.fill();\n    glowDot(srcX,srcY,12,'rgba(222,127,118,ALPHA)',0.6);\n    \n    // Observer (blue circle)\n    ctx.fillStyle='#63b3ff';ctx.beginPath();ctx.arc(obsX,obsY,12,0,Math.PI*2);ctx.fill();\n    glowDot(obsX,obsY,12,'rgba(99,179,255,ALPHA)',0.6);\n    \n    // Distance annotation\n    if(dist>20){\n      const midX=(srcX+obsX)*0.5;\n      const midY=H*0.5-40;\n      ctx.strokeStyle='#c8d4da';ctx.lineWidth=1;\n      ctx.beginPath();ctx.moveTo(srcX,midY);ctx.lineTo(obsX,midY);ctx.stroke();\n      ctx.fillStyle='#c8d4da';ctx.font=Math.round(H*0.035)+'px monospace';\n      ctx.textAlign='center';\n      ctx.fillText('Δx = '+Math.round(dist/scale)+' m',midX,midY-12);\n    }\n    \n    // ===== Foreground annotations =====\n    // Title panel\n    ctx.fillStyle='rgba(24,34,40,0.8)';ctx.fillRect(12,12,260,100);\n    ctx.strokeStyle='#465a64';ctx.lineWidth=1;ctx.strokeRect(12,12,260,100);\n    \n    ctx.fillStyle='#e5ba67';ctx.font='bold '+Math.round(H*0.045)+'px sans-serif';\n    ctx.textAlign='left';ctx.fillText('Doppler Shift',22,40);\n    \n    ctx.fillStyle='#87e8a8';ctx.font=Math.round(H*0.032)+'px monospace';\n    ctx.fillText('f\\' = '+Math.round(freqObserved)+' Hz',22,62);\n    ctx.fillStyle='#c8d4da';ctx.font=Math.round(H*0.028)+'px sans-serif';\n    ctx.fillText('v_src: '+Math.round(vSrc*10)/10+' m/s',22,82);\n    ctx.fillText('v_obs: '+Math.round(vObs*10)/10+' m/s',22,100);\n    \n    // Side info\n    ctx.fillStyle='rgba(24,34,40,0.75)';ctx.fillRect(W-200,H-100,188,88);\n    ctx.strokeStyle='#465a64';ctx.lineWidth=1;ctx.strokeRect(W-200,H-100,188,88);\n    \n    ctx.fillStyle='#e5ba67';ctx.font='bold '+Math.round(H*0.032)+'px sans-serif';\n    ctx.textAlign='left';ctx.fillText('Why Both Matter:',W-190,H-75);\n    ctx.fillStyle='#c8d4da';ctx.font=Math.round(H*0.026)+'px","remediationGoal":"Close wrong_assumption for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T21:43:02.442Z","cache_hit":false,"cost_usd":0},"error":null}