/ proof-of-concept / plate-mechanics-sim
Sign in
proof-of-concept / plate-mechanics-sim
plate-mechanics-sim / README.md
60 lines · 4.3 KBPreviewCodeBlameHistoryRaw
1# Plate Mechanics Lab
3An interactive lab for the mechanics of thin metal plates. You specify geometry, material, edge conditions and an excitation; the app solves the damped Kirchhoff-Love equation and shows displacement, surface stress (von Mises and principal) over time, a probe time series and spectrum, and the radiated sound at a listener point, which you can play.
5The numerics run in [numbl](https://github.com/flatironinstitute/numbl), a MATLAB-syntax environment executing in the browser. The MATLAB source shown on screen is the source that ran: edit any file and rerun. No physics is computed in JavaScript; the host only draws arrays and plays samples.
7## Layout
9```
10packages/core problem spec, .m generation, numbl runner, result typing, field and colormap primitives (no UI)
11packages/core/src/m the MATLAB library: plate_modal.m, plate_fd.m, plate_stress.m, ...
12packages/components React components: code view, parameter panel, field view, plots, equations, run status, audio
13apps/lab the app: one arrangement of the components
14apps/tutorials MDX documents with embedded interactive views (one tutorial: the CFL limit)
15```
17The app and the tutorials are peers over the same core and components.
19## Methods
21Three methods solve the same problem specification, and the app can run any two and compare them directly:
23- **Modal superposition** (`plate_modal.m`): closed-form modes of the simply supported rectangle, each integrated exactly in time for piecewise-linear forcing. No time-step limit; the approximation is the modal truncation.
24- **Explicit finite differences** (`plate_fd.m`): second-order scheme with the 13-point biharmonic stencil; simply supported, clamped or free edges (free edges use the energy-method operators of `plate_matrices.m`). Stable only below the CFL bound from `plate_fd_plan.m`; the slider goes past it on purpose.
25- **Implicit finite differences** (`plate_implicit.m`): the same stencils assembled as sparse matrices (`plate_matrices.m`), stiffness averaged over three time levels (theta scheme, theta = 1/4 is the trapezoidal rule). One sparse Cholesky factorization, two triangular solves per step, no stability limit; the step is chosen for accuracy. Needs numbl 0.4.21 or later for its sparse direct solvers.
27A method is a data record (`packages/core/src/methods/*.ts`) plus a `.m` file. Adding one means adding both; nothing else in core changes.
29## The live app
31The lab is deployed at <https://plate-mechanics-sim.vault1-sites.magland.org/>. `.mochi/workflows/deploy.yml`
32builds `apps/lab` on every push to `main` and publishes it; the tutorials are not part of that artifact. The
33site sits at the root of an origin of its own, so the build's base path comes from `configure-pages` rather
34than being written into the Vite config.
36## Running
38```bash
39npm install
40npm run dev # the lab, http://localhost:5173
41npm run dev:tutorials # the tutorials
42npm test # vitest: runs the .m files in numbl under Node and checks modal vs FD, CFL, frequencies, editing
43npm run typecheck
44npm run build
45```
47The `.m` files also run unchanged from the numbl CLI, Octave or MATLAB:
49```bash
50npx numbl run --path packages/core/src/m my_script.m
51```
53## Honest limits
55- Kirchhoff-Love thin-plate theory: no shear deformation or rotary inertia, so thick plates and very high modes are wrong.
56- Edge conditions are idealizations. Free edges are handled by a discrete bending energy whose natural boundary conditions are first-order accurate at the edge, and the rigid-body motion of a free plate is removed rather than modelled, as the supports of a real free-free rig would do.
57- Damping is a two-parameter model, chosen, not measured.
58- Stress is a second derivative of the displacement and converges more slowly than displacement in both methods; near the strike it depends on the load footprint.
59- Radiated sound is Rayleigh's integral in an infinite baffle: an estimate of the waveform, not a calibrated level.
60- Explicit finite differences cost about 0.3 µs per cell-step in the browser, and the stable step scales with dx². The default 41 x 27 grid gives 20 ms in a few seconds; refining to 61 x 41 costs about five times more. The implicit scheme removes the step limit (about 1 ms per step on 61 x 41) at the price of detuning the highest modes; long simulated times still belong to the modal method.
↑↓ move↵openescclose