/ proof-of-concept / plate-dynamics-lab
Sign in
proof-of-concept / plate-dynamics-lab
plate-dynamics-lab / packages / core / src / m / plate_fd.m
45 lines · 2.4 KBBlameHistoryRaw
1function result = plate_fd(params)
2% PLATE_FD Explicit finite differences for a Kirchhoff-Love plate in its mount, under gravity.
3%
4% result = plate_fd(params) advances the damped plate equation
5%
6% mu w_tt + 2 mu sigma0 w_t - 2 mu sigma1 lap(w_t) + D lap(lap(w))
7% - div(N grad w) = F(t) s(x,y) + mu g_n + support forces
8%
9% on a uniform nx x ny grid with a second-order explicit scheme, the spatial
10% operators being the sparse energy-method matrices of plate_bending (the
11% 13-point biharmonic stencil inside, the free-edge conditions as natural
12% conditions on the edges) and plate_prestress (the in-plane stress of the
13% plate's own weight). The mount (plate_mount) supplies the support forces:
14% a thread is a transverse spring at its hole, a pad or a felt a one-sided
15% spring and dashpot, a vise holds a band of nodes still, fingers are a
16% two-sided spring over a patch. The plate starts from its static
17% equilibrium (plate_static) and the departure from it is carried as
18% rigid-body coordinates plus a flexural field (plate_rigid_basis), so that
19% the pendulum swing of a hanging plate and its flexural vibration come out
20% of one time loop.
22% The step is dt = cfl * dt_max with dt_max from plate_model; the scheme is
23% unstable for cfl > 1 and the run stops as soon as the field diverges,
24% reporting the step at which it did (info.diverged_step).
26% The work is in three stages, each its own file, so that a host can run the
27% time loop elsewhere (the lab has a WebGPU port of plate_fd_loop) while the
28% setup and the output stay this code:
29% S = plate_fd_setup(params) grid, step, statics, load, probe, listener, operators
30% Rec = plate_fd_loop(S) the time stepping; records probe, rigid coordinates,
31% support forces, frames, audio bins
32% result = plate_fd_output(S, Rec) stresses, audio, spectra, the result struct
34% Approximations. Second-order truncation error in dx, dy, dt; free edges
35% and curved edges first order at the boundary; small-angle theory for the
36% threads and the pendulum motion; the probe is snapped to the nearest grid
37% node; stress fields are evaluated only at the saved frames; the audio is
38% an estimate of the waveform, not a calibrated level.
40% See plate_result_schema for the fields of result.
42S = plate_fd_setup(params);
43Rec = plate_fd_loop(S);
44result = plate_fd_output(S, Rec);
45end
↑↓ move↵openescclose