{"job_id":"anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172","request_id":"bulk-2026-05-20T10-21-44-856Z-8-physics.09.sound.longitudinal-wave","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172/scene-source.json","duration_seconds":15,"byte_size":475535,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-a8b9b702-0aa3-4ddb-b4a5-fe85d02f0172","request":{"gap":{"topic":"sound-longitudinal_wave","severity":"moderate","error_type":"concept_misunderstanding","memory_state":"fragile","display_topic":"Longitudinal Wave Compression","common_wrong_answer":"The concept works the same way in all conditions.","confidence_at_error":"high","correct_understanding":"The concept depends on constraints, assumptions, and variable relationships."},"target":{"style":"auto","render":{"fps":30,"format":"mp4","resolution":"1920x1080","include_thumbnail":true,"include_transcript":true},"audience":{"tone":"neutral_instructional","grade":"9","language":"en"},"interactivity":"none","duration_seconds":15},"context":{"chapter":{"name":"Sound","ncert_class":9},"sub_topics":[{"topic":"sound-longitudinal_wave","key_concepts":["Longitudinal Wave Compression","Sound"]}]},"metadata":{"priority":"normal","trace_id":"bulk-run-2026-05-20T10-21-44-856Z"},"exam_type":"neet","asset_type":"simulation","request_id":"bulk-2026-05-20T10-21-44-856Z-8-physics.09.sound.longitudinal-wave","subject_area":"physics"},"renderer":"html_three_js_local","storyboard":{"beats":[{"label":"Topic","visual":"Show the topic title and the key physical context.","narration":"Longitudinal Wave Compression"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"The concept works the same way in all conditions."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"The concept depends on constraints, assumptions, and variable relationships."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"Longitudinal Wave Compression. Sound"}],"title":"Longitudinal Wave Compression","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>Longitudinal Wave Compression: Constraint Dependence</title>\n  <style>\n    :root{--bg:#0e121a;--panel:#1c232e;--line:#303449;--accent:#fc884f;--text:#faf9f8;--muted:#9f9ea1;--blue:#627da5;--green:#8decb0;--red:#df8279;}\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%,#1c232e 0%,#0e121a 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(28,35,46,.86),rgba(14,18,26,.94));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>Wave Compression</h1>\n    <p class=\"sub\">Why constraints matter</p>\n    <p class=\"formula\">v = √(E/ρ) [med]<br/>Δp = ρ v Δu [Euler]</p>\n    <label class=\"control\"><span>Medium: <strong id=\"v-medium\">Liquid</strong></span><input id=\"c-medium\" type=\"range\" min=\"0\" max=\"2\" step=\"1\" value=\"0\"/></label>\n    <label class=\"control\"><span>Boundary: <strong id=\"v-boundary\">Open</strong></span><input id=\"c-boundary\" type=\"range\" min=\"0\" max=\"2\" step=\"1\" value=\"0\"/></label>\n    <label class=\"control\"><span>Amplitude: <strong id=\"v-amp\">1.0</strong> mm</span><input id=\"c-amp\" type=\"range\" min=\"0.5\" max=\"2.5\" step=\"0.1\" value=\"1.0\"/></label>\n    <label class=\"control\"><span>Frequency: <strong id=\"v-freq\">2.0</strong> Hz</span><input id=\"c-freq\" type=\"range\" min=\"0.5\" max=\"4\" step=\"0.5\" value=\"2.0\"/></label>\n    <ul>\n      <li><strong>❌ Misconception:</strong> Wave behaves identically in all media and boundaries.</li>\n      <li><strong>✓ Truth:</strong> Speed, compression, and reflection depend on <em>elastic modulus</em> and <em>density</em>.</li>\n      <li><strong>📊 Show:</strong> Same frequency → different compression ratio per medium.</li>\n      <li><strong>🔧 Constraint:</strong> Closed end traps wave; open end allows escape.</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\":\"medium\",\"label\":\"Medium\",\"min\":0,\"max\":2,\"step\":1,\"value\":0,\"units\":\"\"},\n  {\"key\":\"boundary\",\"label\":\"Boundary\",\"min\":0,\"max\":2,\"step\":1,\"value\":0,\"units\":\"\"},\n  {\"key\":\"amp\",\"label\":\"Amplitude\",\"min\":0.5,\"max\":2.5,\"step\":0.1,\"value\":1.0,\"units\":\"mm\"},\n  {\"key\":\"freq\",\"label\":\"Frequency\",\"min\":0.5,\"max\":4,\"step\":0.5,\"value\":2.0,\"units\":\"Hz\"}\n];\n\nconst mediumNames = [\"Liquid\",\"Gas\",\"Steel\"];\nconst boundaryNames = [\"Open\",\"Closed\",\"Impedance\"];\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==='medium') out.textContent=mediumNames[Number(inp.value)];\n    else if(c.key==='boundary') out.textContent=boundaryNames[Number(inp.value)];\n    else out.textContent=inp.value;\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  \n  let lastTs=0;\n  \n  // Particle history for trails\n  let particleHistory=[];\n  \n  // Wave state: array of particle positions and velocities\n  let particles=[];\n  const numParticles=40;\n  \n  function initParticles(){\n    particles=[];\n    for(let i=0;i<numParticles;i++){\n      particles.push({x:i*20,y:0,vx:0,vy:0});\n    }\n    particleHistory=particles.map(p=>({x:p.x,y:p.y}));\n  }\n  \n  // Medium properties: speed of sound (m/s), impedance proxy\n  const mediaProps={\n    0:{name:'Liquid',c:1500,rho:1000,color:'#627da5',elasticity:2.2},\n    1:{name:'Gas',c:343,rho:1.2,color:'#8decb0',elasticity:1.0},\n    2:{name:'Steel',c:5960,rho:7850,color:'#df8279',elasticity:4.8}\n  };\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*0.7)));\n    g.addColorStop(1,color.replace('ALPHA','0'));\n    ctx.fillStyle=g;\n    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,width=2){\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=8;\n    ctx.strokeStyle=color;\n    ctx.lineWidth=width;\n    ctx.beginPath();\n    ctx.moveTo(x1,y1);\n    ctx.lineTo(x2,y2);\n    ctx.stroke();\n    ctx.fillStyle=color;\n    ctx.beginPath();\n    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);\n    ctx.fill();\n  }\n  \n  initParticles();\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);\n    lastTs=ts;\n    \n    const W=cv.width,H=cv.height;\n    \n    // READ SLIDERS\n    const mediumIdx=Math.round(Number(document.getElementById('c-medium').value));\n    const boundaryIdx=Math.round(Number(document.getElementById('c-boundary').value));\n    const amp=Number(document.getElementById('c-amp').value)*0.5; // scale to canvas units\n    const freq=Number(document.getElementById('c-freq').value);\n    \n    const med=mediaProps[mediumIdx];\n    const waveSpeed=med.c/500; // scale to canvas units\n    \n    // Global time for wave driving\n    const waveTime=ts/1000;\n    \n    // SOURCE: drive first particle with sinusoidal motion\n    const driveDisp=amp*Math.sin(2*Math.PI*freq*waveTime);\n    particles[0].y=driveDisp;\n    particles[0].vy=amp*2*Math.PI*freq*Math.cos(2*Math.PI*freq*waveTime);\n    \n    // PROPAGATION: simple coupled oscillator model\n    const stiffness=med.elasticity*0.08;\n    const damping=0.02;\n    \n    for(let i=1;i<numParticles;i++){\n      const p=particles[i];\n      const pPrev=particles[i-1];\n      \n      // Spring force from previous particle\n      const dx=pPrev.y-p.y;\n      const restLen=0;\n      const springForce=stiffness*dx;\n      \n      // Damping based on medium\n      const dampForce=-damping*p.vy;\n      \n      // Total acceleration\n      const acc=springForce+dampForce;\n      p.vy+=acc*dt;\n      p.y+=p.vy*dt;\n      \n      // Boundary conditions\n      if(boundaryIdx===1 && i===numParticles-1){\n        // CLOSED: reflect\n        p.y=-p.y*0.95;\n        p.vy=-p.vy*0.95;\n      } else if(boundaryIdx===0 && i===numParticles-1){\n        // OPEN: free\n        p.y*=0.98;\n        p.vy*=0.98;\n      } else if(boundaryIdx===2 && i===numParticles-1){\n        // IMPEDANCE MISMATCH: partial reflection\n        p.y*=0.5;\n        p.vy*=0.5;\n      }\n    }\n    \n    // Store history for trail\n    particleHistory.unshift({x:particles[0].x,y:particles[0].y});\n    if(particleHistory.length>60)particleHistory.pop();\n    \n    // DRAW\n    ctx.clearRect(0,0,W,H);\n    \n    // Background grid\n    ctx.strokeStyle='rgba(48,52,73,0.3)';\n    ctx.lineWidth=1;\n    for(let x=0;x<W;x+=40){\n      ctx.beginPath();ctx.moveTo(x,0);ctx.lineTo(x,H);ctx.stroke();\n    }\n    \n    // LAYER 1: Compression visualization (bars showing density)\n    const baseY=H*0.5;\n    const barH=H*0.15;\n    const barSpacing=W/(numParticles+1);\n    \n    for(let i=0;i<numParticles;i++){\n      const p=particles[i];\n      const pNext=i<numParticles-1?particles[i+1]:null;\n      \n      // Spacing to next particle = compression\n      const spacing=pNext?(pNext.x-p.x):barSpacing;\n      const compression=Math.max(0.3,barSpacing/spacing);\n      \n      // Color intensity based on compression\n      const hue=compression>1.2?15:compression>1.05?30:0; // red to orange to neutral\n      ctx.fillStyle=med.color;\n      ctx.globalAlpha=0.5+compression*0.3;\n      ctx.fillRect(p.x+baseY-50,baseY-barH/2,Math.max(3,barSpacing*0.8),barH);\n      ctx.globalAlpha=1;\n    }\n    \n    // LAYER 2: Particles as circles with velocity vectors\n    for(let i=0;i<numParticles;i++){\n      const p=particles[i];\n      \n      // Particle circle\n      ctx.fillStyle=med.color;\n      ctx.globalAlpha=0.8;\n      ctx.beginPath();\n      ctx.arc(p.x+baseY-50,baseY+p.y,5,0,Math.PI*2);\n      ctx.fill();\n      ctx.globalAlpha=1;\n      \n      // Velocity vector (small arrow)\n      if(Math.abs(p.vy)>0.3){\n        const arrowLen=Math.min(20,Math.abs(p.vy)*8);\n        const arrowColor=p.vy>0?'#8decb0':'#df8279';\n        arrow(p.x+baseY-50,baseY+p.y,p.x+baseY-50,baseY+p.y+p.vy*arrowLen,arrowColor,1.5);\n      }\n    }\n    \n    // LAYER 3: Trail and wave path\n    ctx.strokeStyle=med.color;\n    ctx.globalAlpha=0.3;\n    ctx.lineWidth=1;\n    ctx.beginPath();\n    for(let i=0;i<particleHistory.length;i++){\n      const h=particleHistory[i];\n      if(i===0)ctx.moveTo(h.x+baseY-50,baseY+h.y);\n      else ctx.lineTo(h.x+baseY-50,baseY+h.y);\n    }\n    ctx.stroke();\n    ctx.globalAlpha=1;\n    \n    // LAYER 4: Annotations and labels\n    // Title for scenario\n    const medium","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-20T10:58:46.856Z","cache_hit":false,"cost_usd":0},"error":null}