{"job_id":"anim-job-395e2498-7275-4462-956f-443f6162bd0c","request_id":"test-physics-induction-ba30c5e5-e5bb-4ff3-90a7-a40b2e480a51-1778708287067","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-395e2498-7275-4462-956f-443f6162bd0c/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-395e2498-7275-4462-956f-443f6162bd0c/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-395e2498-7275-4462-956f-443f6162bd0c/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-395e2498-7275-4462-956f-443f6162bd0c/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-395e2498-7275-4462-956f-443f6162bd0c/scene-source.json","duration_seconds":15,"byte_size":458573,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-395e2498-7275-4462-956f-443f6162bd0c","control_count":2,"interactivity":"none","simulation_id":"physics.10.magnetic_effects.electromagnetic_induction","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-395e2498-7275-4462-956f-443f6162bd0c","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-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":"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 is Key</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>Flux Change is Key</h1>\n    <p class=\"sub\">Static magnet ≠ induced current. Only changing flux induces emf.</p>\n    <p class=\"formula\">ε = −dΦ/dt</p>\n    <label class=\"control\"><span>Magnet Motion: <strong id=\"v-mode\">Moving</strong></span><select id=\"c-mode\" style=\"width:100%;padding:6px;border-radius:6px;border:1px solid var(--line);background:#11191e;color:var(--accent);\">\n      <option value=\"0\">Static (Mistake)</option>\n      <option value=\"1\" selected>Moving (Correct)</option>\n    </select></label>\n    <label class=\"control\"><span>Speed: <strong id=\"v-speed\">1.0</strong>× base</span><input id=\"c-speed\" type=\"range\" min=\"0.2\" max=\"2\" step=\"0.1\" value=\"1.0\"/></label>\n    <ul>\n      <li>❌ <strong>Mistake:</strong> Static magnet always induces current</li>\n      <li>✓ <strong>Truth:</strong> Induced emf ∝ rate of flux change</li>\n      <li>🔑 <strong>Key:</strong> When magnet is still, dΦ/dt = 0, so ε = 0</li>\n      <li>⚡ <strong>Apply:</strong> Move magnet → flux changes → current detected</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\":\"mode\",\"label\":\"Mode\",\"min\":0,\"max\":1,\"step\":1,\"value\":1,\"units\":\"\"},{\"key\":\"speed\",\"label\":\"Speed\",\"min\":0.2,\"max\":2,\"step\":0.1,\"value\":1.0,\"units\":\"×\"}];\nfor(const c of controls){\n  const inp=document.getElementById('c-'+c.key);\n  const out=document.getElementById('v-'+c.key);\n  inp?.addEventListener('change',()=>{\n    if(inp.tagName==='SELECT'){\n      out.textContent=inp.options[inp.selectedIndex].text;\n    }else{\n      out.textContent=parseFloat(inp.value).toFixed(1);\n    }\n    window.updateModel?.();\n  });\n  inp?.addEventListener('input',()=>{\n    if(inp.tagName==='OPTION')return;\n    out.textContent=parseFloat(inp.value).toFixed(1);\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  // State variables\n  let magnet_x = 0;\n  let magnet_direction = 1;\n  let phase = 0;\n  let emf_history = [];\n  let flux_history = [];\n  let time_history = [];\n  let lastTs = 0;\n  let cycle_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    const rgba=color.split(',');\n    const rpart=rgba[0]+','+rgba[1]+','+rgba[2];\n    g.addColorStop(0,'rgba('+rpart+','+a+')');\n    g.addColorStop(1,'rgba('+rpart+',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,width){\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=12;\n    ctx.strokeStyle=color;\n    ctx.lineWidth=width||2;\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.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,maxWidth){\n    if(points.length<2)return;\n    ctx.strokeStyle=color;\n    ctx.lineWidth=maxWidth||2;\n    ctx.globalAlpha=0.4;\n    ctx.beginPath();\n    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();\n    ctx.globalAlpha=1;\n  }\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);\n    lastTs=ts;\n    const W=cv.width,H=cv.height;\n    \n    // Read sliders\n    const mode=Number(document.getElementById('c-mode').value);\n    const speed=Number(document.getElementById('c-speed').value);\n    \n    cycle_time+=dt;\n    \n    // Physics: magnet motion\n    if(mode===1){\n      // Moving magnet (correct case)\n      magnet_x+=magnet_direction*80*speed*dt;\n      if(magnet_x>W*0.7){magnet_direction=-1;}\n      if(magnet_x<W*0.15){magnet_direction=1;}\n    }else{\n      // Static magnet (mistake case)\n      magnet_x=W*0.42;\n      magnet_direction=0;\n    }\n    \n    // Coil parameters (fixed position)\n    const coil_x=W*0.75;\n    const coil_y=H*0.55;\n    const coil_r=35;\n    \n    // Calculate flux (proportional to distance^-2)\n    const dist=Math.abs(magnet_x-coil_x);\n    const flux=(200/(dist+40))*100;\n    \n    // Calculate induced EMF (derivative of flux, plus some damping for visualization)\n    let emf=0;\n    if(flux_history.length>0){\n      const prev_flux=flux_history[flux_history.length-1];\n      emf=(prev_flux-flux)/(dt+0.001)*0.08;\n    }\n    \n    // Keep history for graph\n    emf_history.push(emf);\n    flux_history.push(flux);\n    time_history.push(cycle_time);\n    \n    if(emf_history.length>180)emf_history.shift();\n    if(flux_history.length>180)flux_history.shift();\n    if(time_history.length>180){\n      time_history.shift();\n      const offset=time_history[0];\n      time_history=time_history.map(t=>t-offset);\n    }\n    \n    // Clear canvas\n    ctx.clearRect(0,0,W,H);\n    \n    // === LAYER 1: Background grid ===\n    ctx.strokeStyle='rgba(100,120,130,0.15)';\n    ctx.lineWidth=1;\n    for(let i=0;i<W;i+=80){\n      ctx.beginPath();ctx.moveTo(i,0);ctx.lineTo(i,H);ctx.stroke();\n    }\n    for(let i=0;i<H;i+=60){\n      ctx.beginPath();ctx.moveTo(0,i);ctx.lineTo(W,i);ctx.stroke();\n    }\n    \n    // === LAYER 2: Main action - magnet, coil, field lines ===\n    \n    // Draw magnetic field lines\n    ctx.strokeStyle='rgba(99,179,255,0.25)';\n    ctx.lineWidth=1.5;\n    for(let dy=-1;dy<=1;dy++){\n      ctx.beginPath();\n      for(let dx=0;dx<=W;dx+=6){\n        const y_offset=H*0.4+dy*50;\n        const dist_to_magnet=Math.abs(dx-magnet_x);\n        const field_deflection=Math.sin(dist_to_magnet*0.008)*8;\n        const y=y_offset+field_deflection;\n        if(dx===0)ctx.moveTo(dx,y);\n        else ctx.lineTo(dx,y);\n      }\n      ctx.stroke();\n    }\n    \n    // Draw magnet\n    const mag_w=30,mag_h=50;\n    ctx.fillStyle='#d4443f';\n    ctx.fillRect(magnet_x-mag_w/2,H*0.42-mag_h/2,mag_w/2,mag_h);\n    ctx.fillStyle='#4a8fbe';\n    ctx.fillRect(magnet_x,H*0.42-mag_h/2,mag_w/2,mag_h);\n    ctx.strokeStyle='rgba(255,255,255,0.4)';\n    ctx.lineWidth=1.5;\n    ctx.strokeRect(magnet_x-mag_w/2,H*0.42-mag_h/2,mag_w,mag_h);\n    \n    // Label magnet poles\n    ctx.fillStyle='var(--text)';\n    ctx.font=Math.round(H*0.035)+'px sans-serif';\n    ctx.textAlign='center';\n    ctx.fillText('S',magnet_x-mag_w/2+mag_w/4,H*0.42+6);\n    ctx.fillText('N',magnet_x+mag_w/4,H*0.42+6);\n    \n    // Magnet motion indicator\n    if(mode===1){\n      ctx.strokeStyle='var(--green)';\n      ctx.lineWidth=2;\n      arrow(magnet_x+20,H*0.42+30,magnet_x+magnet_direction*45,H*0.42+30,'var(--green)',2.5);\n      ctx.fillStyle='var(--green)';\n      ctx.font=Math.round(H*0.032)+'px sans-serif';\n      ctx.textAlign='center';\n      ctx.fillText('dΦ/dt ≠ 0',magnet_x,H*0.32);\n    }else{\n      ctx.fillStyle='var(--red)';\n      ctx.font=Math.round(H*0.032)+'px sans-serif';\n      ctx.textAlign='center';\n      ctx.fillText('dΦ/dt = 0',magnet_x,H*0.32);\n    }\n    \n    // Draw coil (helical)\n    ctx.strokeStyle='rgba(135,232,168,0.8)';\n    ctx.lineWidth=2.5;\n    ctx.beginPath();\n    for(let a=0;a<Math.PI*4;a+=0.15){\n      const coil_xx=coil_x+Math.cos(a)*coil_r;\n      const coil_yy=coil_y+Math.sin(a)*coil_r*0.6;\n      if(a===0)ctx.moveTo(coil_xx,coil_yy);\n      else ctx.lineTo(coil_xx,coil_yy);\n    }\n    ctx.stroke();\n    \n    // Coil label\n    ctx.fillStyle='var(--green)';\n    ctx.font='bold '+Math.round(H*0.038)+'px sans-serif';\n    ctx.textAlign='center';\n    ctx.fillText('Coil',coil_x,","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"},"simulation_title":"Electromagnetic Induction"}},"metadata":{"rendered_at":"2026-05-13T21:46:04.471Z","cache_hit":false,"cost_usd":0},"error":null}