{"job_id":"anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34","request_id":"test-physics-induction-1b2ba770-6450-4b1c-a815-8b28db3d7c87-1778704510421","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34/scene-source.json","duration_seconds":15,"byte_size":501557,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34","control_count":2,"interactivity":"none","simulation_id":"physics.10.magnetic_effects.electromagnetic_induction","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-f66b2ea4-937f-4a73-85f2-f0889a8a5a34","request":{"gap":{"topic":"em-induction-flux","severity":"dangerous","error_type":"concept_misunderstanding","memory_state":"fragile","display_topic":"Electromagnetic Induction","common_wrong_answer":"A static magnet always induces current in a nearby coil.","confidence_at_error":"high","correct_understanding":"Induced emf appears only when magnetic flux through coil changes."},"target":{"style":"auto","render":{"fps":30,"format":"mp4","resolution":"1920x1080","include_thumbnail":true,"include_transcript":true},"audience":{"tone":"neutral_instructional","grade":"10","language":"en"},"interactivity":"none","duration_seconds":15},"context":{"chapter":{"name":"Magnetic Effects","ncert_class":10,"ncert_chapter_number":13},"sub_topics":[{"topic":"Electromagnetic Induction","key_concepts":["induction","flux change"]}]},"metadata":{"priority":"normal"},"exam_type":"neet","asset_type":"simulation","request_id":"test-physics-induction-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":"Electromagnetic Induction"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"A static magnet always induces current in a nearby coil."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"Induced emf appears only when magnetic flux through coil changes."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"induction. flux change"}],"title":"Electromagnetic Induction","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>Electromagnetic Induction: Flux Change Required</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>Electromagnetic Induction</h1>\n    <p class=\"sub\">Faraday's Law: current only when flux changes</p>\n    <p class=\"formula\">ε = −dΦ/dt</p>\n    <label class=\"control\"><span>Magnet Motion: <strong id=\"v-mag\">20</strong> %</span><input id=\"c-mag\" type=\"range\" min=\"0\" max=\"100\" step=\"1\" value=\"20\"/></label>\n    <label class=\"control\"><span>Coil Rotation: <strong id=\"v-rot\">0</strong> °/s</span><input id=\"c-rot\" type=\"range\" min=\"0\" max=\"360\" step=\"10\" value=\"0\"/></label>\n    <ul>\n    <li>Static magnet → no flux change</li>\n    <li>Moving magnet → flux changes</li>\n    <li>Rotating coil → flux changes</li>\n    <li>Current appears only with change</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 = [{\"key\":\"mag\",\"label\":\"Magnet Motion\",\"min\":0,\"max\":100,\"step\":1,\"value\":20,\"units\":\"%\"},{\"key\":\"rot\",\"label\":\"Coil Rotation\",\"min\":0,\"max\":360,\"step\":10,\"value\":0,\"units\":\"°/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  let lastTs=0;\n  \n  // State variables\n  let magnetX=0;\n  let magnetDistance=0;\n  let coilRotation=0;\n  let flux=0;\n  let emf=0;\n  let current=0;\n  let fluxHistory=[];\n  let emfHistory=[];\n  let time=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;\n    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 drawMagnet(x,y,w,h,north){\n    // Magnet poles\n    ctx.fillStyle=north?'#de7f76':'#63b3ff';\n    ctx.fillRect(x,y,w/2,h);\n    ctx.fillStyle=north?'#63b3ff':'#de7f76';\n    ctx.fillRect(x+w/2,y,w/2,h);\n    \n    // Field lines\n    ctx.strokeStyle='rgba(227,169,87,0.2)';\n    ctx.lineWidth=1;\n    for(let i=0;i<6;i++){\n      const yy=y+h*0.1+i*h*0.15;\n      ctx.beginPath();\n      ctx.moveTo(x-40,yy);\n      ctx.quadraticCurveTo(x-20,yy-10,x,yy);\n      ctx.stroke();\n      ctx.beginPath();\n      ctx.moveTo(x+w,yy);\n      ctx.quadraticCurveTo(x+w+20,yy-10,x+w+40,yy);\n      ctx.stroke();\n    }\n  }\n  \n  function drawCoil(cx,cy,r,turns,rot,animate){\n    ctx.save();\n    ctx.translate(cx,cy);\n    ctx.rotate(rot);\n    \n    // Draw coil loops\n    ctx.strokeStyle='#87e8a8';\n    ctx.lineWidth=2;\n    for(let t=0;t<turns;t++){\n      const rr=r*(1-t/(turns-1));\n      ctx.beginPath();\n      ctx.arc(0,0,rr,0,Math.PI*2);\n      ctx.stroke();\n    }\n    \n    // Normal vector\n    ctx.strokeStyle='#e5ba67';\n    ctx.lineWidth=3;\n    ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(0,-r*1.3);ctx.stroke();\n    ctx.fillStyle='#e5ba67';\n    ctx.beginPath();\n    ctx.moveTo(0,-r*1.3);\n    ctx.lineTo(-5,-r*1.1);\n    ctx.lineTo(5,-r*1.1);\n    ctx.fill();\n    \n    ctx.restore();\n  }\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);\n    lastTs=ts;\n    time+=dt;\n    \n    const W=cv.width,H=cv.height;\n    \n    // Read sliders\n    const magMotion=Number(document.getElementById('c-mag').value)/100;\n    const coilRotSpeed=Number(document.getElementById('c-rot').value);\n    \n    // Update magnet distance (oscillates with motion slider)\n    magnetDistance=100+magMotion*80*Math.sin(time*2.5);\n    \n    // Update coil rotation\n    coilRotation+=coilRotSpeed*(Math.PI/180)*dt;\n    \n    // Calculate flux (depends on magnet distance and coil angle)\n    // Flux = B·A = B0 * exp(-dist/scale) * cos(coilRotation)\n    const B0=1.0;\n    const scale=120;\n    const distFactor=Math.exp(-magnetDistance/scale);\n    const angleFactor=Math.cos(coilRotation);\n    const newFlux=B0*distFactor*angleFactor;\n    \n    // EMF is negative derivative of flux\n    const prevFlux=fluxHistory.length>0?fluxHistory[fluxHistory.length-1]:newFlux;\n    emf=-(newFlux-prevFlux)/Math.max(dt,0.001);\n    \n    // Current proportional to EMF\n    current=emf*0.3;\n    \n    // Store history\n    fluxHistory.push(newFlux);\n    emfHistory.push(emf);\n    if(fluxHistory.length>200)fluxHistory.shift();\n    if(emfHistory.length>200)emfHistory.shift();\n    flux=newFlux;\n    \n    // Draw background\n    ctx.clearRect(0,0,W,H);\n    \n    // Draw grid\n    ctx.strokeStyle='rgba(46,62,70,0.3)';\n    ctx.lineWidth=1;\n    for(let i=0;i<=10;i++){\n      ctx.beginPath();ctx.moveTo(W*i/10,0);ctx.lineTo(W*i/10,H);ctx.stroke();\n      ctx.beginPath();ctx.moveTo(0,H*i/10);ctx.lineTo(W,H*i/10);ctx.stroke();\n    }\n    \n    // Left panel: Scene\n    const sceneH=H*0.6;\n    const coilX=W*0.15;\n    const coilY=sceneH*0.5;\n    const magnetX=coilX+magnetDistance;\n    \n    // Draw magnet\n    drawMagnet(magnetX-25,coilY-30,50,60,true);\n    \n    // Glow effect for moving magnet\n    if(magMotion>0.1){\n      glowDot(magnetX,coilY,15,'rgba(222,127,118,ALPHA)',0.4);\n    }\n    \n    // Draw coil\n    drawCoil(coilX,coilY,40,4,coilRotation,coilRotSpeed>1);\n    \n    // Flux indicator text\n    ctx.fillStyle='var(--muted)';\n    ctx.font=Math.round(H*0.04)+'px sans-serif';\n    ctx.fillText('Flux: '+flux.toFixed(2),W*0.02,sceneH*0.05);\n    \n    // Right panel: Graphs\n    const graphX=W*0.55;\n    const graphW=W*0.4;\n    const graphH=H*0.28;\n    \n    // Flux graph\n    ctx.fillStyle='rgba(30,40,50,0.6)';\n    ctx.fillRect(graphX,H*0.05,graphW,graphH);\n    ctx.strokeStyle='#445862';ctx.lineWidth=1;\n    ctx.strokeRect(graphX,H*0.05,graphW,graphH);\n    \n    ctx.fillStyle='#c8d4da';\n    ctx.font=Math.round(H*0.03)+'px sans-serif';\n    ctx.fillText('Magnetic Flux',graphX+10,H*0.02);\n    \n    // Plot flux history\n    ctx.strokeStyle='#87e8a8';\n    ctx.lineWidth=2;\n    ctx.beginPath();\n    for(let i=0;i<fluxHistory.length;i++){\n      const px=graphX+10+i*(graphW-20)/Math.max(fluxHistory.length-1,1);\n      const py=H*0.05+graphH*0.5-fluxHistory[i]*graphH*0.4;\n      if(i===0)ctx.moveTo(px,py);else ctx.lineTo(px,py);\n    }\n    ctx.stroke();\n    \n    // EMF/Current graph\n    ctx.fillStyle='rgba(30,40,50,0.6)';\n    ctx.fillRect(graphX,H*0.38,graphW,graphH);\n    ctx.strokeStyle='#445862';ctx.lineWidth=1;\n    ctx.strokeRect(graphX,H*0.38,graphW,graphH);\n    \n    ctx.fillStyle='#c8d4da';\n    ctx.fillText('Induced EMF & Current',graphX+10,H*0.35);\n    \n    // Plot EMF history\n    ctx.strokeStyle='#de7f76';\n    ctx.lineWidth=2;\n    ctx.beginPath();\n    for(let i=0;i<emfHistory.length;i++){\n      const px=graphX+10+i*(graphW-20)/Math.max(emfHistory.length-1,1);\n      const py=H*0.38+graphH*0.5-emfHistory[i]*graphH*0.3;\n      if(i===0)ctx.moveTo(px,py);else ctx.lineTo(px,py);\n    }\n    ctx.stroke();\n    \n    // Current indicator (bottom)\n    const currentMag=Math.abs(current);\n    ctx.fillStyle='rgba(30,40,50,0.6)';\n    ctx.fillRect(W*0.02,H*0.7,","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"},"simulation_title":"Electromagnetic Induction"}},"metadata":{"rendered_at":"2026-05-13T20:40:33.750Z","cache_hit":false,"cost_usd":0},"error":null}