/ tutorials / laplace-dirichlet
Sign in
tutorials / laplace-dirichlet
laplace-dirichlet / src / chapters / ch08 / chapter.ts
43 lines · 1.3 KBCodeBlameHistory
088be4cAn interactive tutorial on the Dirichlet problem, accuracy against costJeremy Magland 1import { createElement } from 'react'
2import type { Chapter } from '../../ui/types.ts'
3import driver from './driver.m?raw'
4import script from './iterative.m?raw'
5import text from './text.md?raw'
6import { IterPanels, iterSummary, type IterOut } from './panels.tsx'
7import { EXACT2D_CONTROL } from '../shared.ts'
9export const ch08: Chapter = {
10 id: 'iterative',
11 nav: 'Iterating instead of solving',
12 part: 'Two dimensions',
13 title: 'Iterating instead of solving',
14 blurb: 'Jacobi to multigrid on the same system, and the question of when to stop.',
15 text,
16 labs: [
17 {
18 id: 'history',
19 title: 'Five iterations on one problem',
20 caption:
21 'Raise N and watch which curves move. Only the multigrid one stays where it is.',
22 driver,
23 script,
24 manual: true,
25 editorOpen: true,
26 controls: [
27 EXACT2D_CONTROL,
28 { kind: 'slider', key: 'N', label: 'N', values: [32, 64, 128, 256], min: 32, max: 256 },
29 {
30 kind: 'slider',
31 key: 'nit',
32 label: 'iterations',
33 values: [20, 60, 120, 240, 480],
34 min: 20,
35 max: 480,
36 },
37 ],
38 defaults: { kind: 'expsin', par: 1, N: 64, nit: 120, tol: 1e-11 },
39 render: (d: IterOut) => createElement(IterPanels, { data: d }),
40 summary: iterSummary,
41 },
42 ],
↑↓ move↵openescclose