{"job_id":"anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842","request_id":"test-physics-doppler-1b2ba770-6450-4b1c-a815-8b28db3d7c87-1778704510421","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842/scene-source.json","duration_seconds":15,"byte_size":544242,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-b2f723ba-301d-4424-b0f3-79de0a40f842","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-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":"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\">Source AND observer motion both matter!</p>\n    <p class=\"formula\">f_obs = f_src × (v ± v_obs)/(v ∓ v_src)</p>\n    <label class=\"control\"><span>Source velocity: <strong id=\"v-vsrc\">30</strong> m/s</span><input id=\"c-vsrc\" type=\"range\" min=\"-40\" max=\"40\" step=\"5\" value=\"30\"/></label>\n    <label class=\"control\"><span>Observer velocity: <strong id=\"v-vobs\">0</strong> m/s</span><input id=\"c-vobs\" type=\"range\" min=\"-40\" max=\"40\" step=\"5\" value=\"0\"/></label>\n    <label class=\"control\"><span>Wave speed (v): <strong id=\"v-vwave\">340</strong> m/s</span><input id=\"c-vwave\" type=\"range\" min=\"250\" max=\"400\" step=\"10\" value=\"340\"/></label>\n    <ul>\n      <li><strong>❌ Wrong:</strong> Only observer motion shifts frequency</li>\n      <li><strong>✓ Correct:</strong> Both source AND observer velocity matter</li>\n      <li><strong>→ Approaching:</strong> Higher observed frequency (pitch)</li>\n      <li><strong>← Receding:</strong> Lower observed frequency (pitch)</li>\n      <li>Watch the frequency graph change as you move source & observer!</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">f_obs = 1000 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 = [{\"key\":\"vsrc\",\"label\":\"Source velocity\",\"min\":-40,\"max\":40,\"step\":5,\"value\":30,\"units\":\"m/s\"},{\"key\":\"vobs\",\"label\":\"Observer velocity\",\"min\":-40,\"max\":40,\"step\":5,\"value\":0,\"units\":\"m/s\"},{\"key\":\"vwave\",\"label\":\"Wave speed\",\"min\":250,\"max\":400,\"step\":10,\"value\":340,\"units\":\"m/s\"}];\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',()=>{out.textContent=inp.value;window.updateModel?.();});\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 sourceX=0, observerX=0;\n  let freqHistory=[];\n  let cycleTime=0;\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;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);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 vSrc=Number(document.getElementById('c-vsrc').value);\n    const vObs=Number(document.getElementById('c-vobs').value);\n    const vWave=Number(document.getElementById('c-vwave').value);\n    const f0=1000; // base frequency Hz\n    \n    // Update positions (normalized to canvas scale)\n    sourceX+=vSrc*dt*0.8;\n    observerX+=vObs*dt*0.8;\n    cycleTime+=dt;\n    \n    // Wrap positions\n    if(sourceX>W) sourceX=-50;\n    if(sourceX<-50) sourceX=W;\n    if(observerX>W) observerX=-50;\n    if(observerX<-50) observerX=W;\n    \n    // Calculate observed frequency using Doppler formula\n    // f_obs = f_src × (v + v_obs) / (v - v_src)\n    // when approaching: v_src is positive (moving toward observer)\n    const denominator = vWave - vSrc;\n    const numerator = vWave + vObs;\n    const fObs = denominator > 0.5 ? f0 * numerator / denominator : f0;\n    const fObsClamped = Math.max(200, Math.min(3000, fObs));\n    \n    // Store frequency history for graph\n    freqHistory.push(fObsClamped);\n    if(freqHistory.length > 200) freqHistory.shift();\n    \n    // ============ DRAW ============\n    ctx.clearRect(0,0,W,H);\n    \n    // Background grid\n    ctx.strokeStyle='rgba(100,150,180,0.08)';ctx.lineWidth=1;\n    for(let i=0;i<W;i+=40){ctx.beginPath();ctx.moveTo(i,0);ctx.lineTo(i,H);ctx.stroke();}\n    \n    // ===== WAVEFRONT VISUALIZATION =====\n    const sourceXAbs=100+sourceX%W;\n    const observerXAbs=100+observerX%W;\n    const yMid=H*0.35;\n    \n    // Draw wavefronts emanating from source\n    const waveSpacing=40;\n    const wavePhase=((cycleTime*vWave)%waveSpacing)/waveSpacing;\n    ctx.strokeStyle='rgba(99,179,255,0.3)';ctx.lineWidth=1;\n    for(let i=-5;i<10;i++){\n      const wX=sourceXAbs+(i-wavePhase)*waveSpacing;\n      ctx.beginPath();ctx.arc(wX,yMid,15,0,Math.PI*2);ctx.stroke();\n    }\n    \n    // Source (sound emitter)\n    glowDot(sourceXAbs,yMid,18,'rgba(222,127,118,ALPHA)',0.6);\n    ctx.fillStyle='#de7f76';ctx.beginPath();ctx.arc(sourceXAbs,yMid,12,0,Math.PI*2);ctx.fill();\n    ctx.fillStyle='var(--text)';ctx.font=Math.round(H*0.035)+'px sans-serif';ctx.textAlign='center';\n    ctx.fillText('Source',sourceXAbs,yMid+32);\n    \n    // Source velocity vector\n    if(Math.abs(vSrc)>2){\n      const vx=Math.sign(vSrc)*Math.abs(vSrc)*0.4;\n      arrow(sourceXAbs,yMid-20,sourceXAbs+vx,yMid-20,vSrc>0?'#87e8a8':'#de7f76');\n    }\n    \n    // Observer (detector)\n    glowDot(observerXAbs,yMid,16,'rgba(99,179,255,ALPHA)',0.5);\n    ctx.fillStyle='#63b3ff';ctx.beginPath();ctx.arc(observerXAbs,yMid,10,0,Math.PI*2);ctx.fill();\n    ctx.fillStyle='var(--text)';ctx.font=Math.round(H*0.035)+'px sans-serif';ctx.textAlign='center';\n    ctx.fillText('Observer',observerXAbs,yMid+32);\n    \n    // Observer velocity vector\n    if(Math.abs(vObs)>2){\n      const vx=Math.sign(vObs)*Math.abs(vObs)*0.4;\n      arrow(observerXAbs,yMid+20,observerXAbs+vx,yMid+20,vObs>0?'#87e8a8':'#de7f76');\n    }\n    \n    // Separation info\n    const dist=Math.abs(observerXAbs-sourceXAbs);\n    const approaching=vSrc>vObs?'Approaching ▼':'';\n    const receding=vSrc<vObs?'Receding ▲':'';\n    ctx.fillStyle='var(--muted)';ctx.font=Math.round(H*0.03)+'px sans-serif';ctx.textAlign='center';\n    ctx.fillText(approaching+' '+receding,W/2,yMid-55);\n    \n    // ===== FREQUENCY GRAPH =====\n    const graphX0=W*0.08;const graphY0=H*0.65;const graphW=W*0.35;const graphH=H*0.28;\n    ctx.strokeStyle='var(--line)';ctx.lineWidth=1;\n    ctx.strokeRect(graphX0,graphY0,graphW,graphH);\n    ctx.fillStyle='rgba(30,50,65,0.5)';ctx.fillRect(graphX0,graphY0,graphW,graphH);\n    \n    ctx.fillStyle='var(--muted)';ctx.font=Math.round(H*0.028)+'px sans-serif';ctx.textAlign='left';\n    ctx.fillText('Observed Freq (Hz)',graphX0+4,graphY0-6);\n    \n    // Draw frequency grid\n    ctx.strokeStyle='rgba(100,120,140,0.15)';ctx.lineWidth=1;\n    for(let f=500;f<=2500;f+=500){\n      const y=graphY0+graphH*(1-(f-200)/2800);\n      ctx.beginPath();ctx.moveTo(graphX0,y);ctx.lineTo(graphX0+graphW,y);ctx.stroke();\n    }\n    \n    // Draw frequency trace\n    if(freqHistory.length>1){\n      ctx.strokeStyle='#e5ba67';ctx.lineWidth=2.5;ctx.beginPath();\n      for(let i=0;i<freqHistory.length;i++){\n        const x=graphX0+(i/freqHistory.length)*graphW;\n        const y=graphY0+graphH*(1-(freqHistory[i]-200)/2800);\n        if(i===0)ctx.moveTo(x,y);else ctx.lineTo(x,y);\n      }\n      ctx.stroke();\n    }\n    \n    // Y-axis labels\n    ctx.fillStyle='var(--muted)';ctx.font=Math.round(H*0.025)+'px monospace';ctx.textAlign='right';\n    for(let f=500;f<=2500;f+=500){\n      const y=graphY0+graphH*(1-(f-200)/2800);\n      ctx.fillText(f+'',graphX0-5,y+4);\n    }\n    \n    // ===== FORMULA & STATUS =====\n    const approachingStatus=vSrc>vObs?'APPROACHING (higher pitch)':'RECEDING (lower pitch)';\n    const formulaText='f_obs = '+f0+' × '+numer","remediationGoal":"Close wrong_assumption for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T20:45:00.241Z","cache_hit":false,"cost_usd":0},"error":null}