import { createElement } from 'react' import type { Chapter } from '../../ui/types.ts' import driver from './driver.m?raw' import script from './iterative.m?raw' import text from './text.md?raw' import { IterPanels, iterSummary, type IterOut } from './panels.tsx' import { EXACT2D_CONTROL } from '../shared.ts' export const ch08: Chapter = { id: 'iterative', nav: 'Iterating instead of solving', part: 'Two dimensions', title: 'Iterating instead of solving', blurb: 'Jacobi to multigrid on the same system, and the question of when to stop.', text, labs: [ { id: 'history', title: 'Five iterations on one problem', caption: 'Raise N and watch which curves move. Only the multigrid one stays where it is.', driver, script, manual: true, editorOpen: true, controls: [ EXACT2D_CONTROL, { kind: 'slider', key: 'N', label: 'N', values: [32, 64, 128, 256], min: 32, max: 256 }, { kind: 'slider', key: 'nit', label: 'iterations', values: [20, 60, 120, 240, 480], min: 20, max: 480, }, ], defaults: { kind: 'expsin', par: 1, N: 64, nit: 120, tol: 1e-11 }, render: (d: IterOut) => createElement(IterPanels, { data: d }), summary: iterSummary, }, ], }