/ proof-of-concept / plate-mechanics-sim
Sign in
proof-of-concept / plate-mechanics-sim
plate-mechanics-sim / packages / core / src / m / plate_implicit_plan.m
31 lines · 1.3 KBCodeBlameHistory
2546961Plate mechanics lab: Kirchhoff-Love plates solved by numbl in the browserJeremy Magland 1function plan = plate_implicit_plan(params)
2% PLATE_IMPLICIT_PLAN Grid, time step and size of the implicit finite-difference scheme.
3%
4% plan = plate_implicit_plan(params) returns nx, ny, dx, dy, dt, nsteps,
5% ncells, nunknowns and cell_steps for plate_implicit. There is no stability
6% bound for theta >= 1/4; the step is set for accuracy as
7% dt = 1 / (fs * steps_per_sample)
8% and the trade-off is period elongation: for theta = 1/4 a mode of angular
9% frequency omega runs slow by a factor of about 1 + (omega dt)^2 / 12. At one
10% step per audio sample a 10 kHz mode is detuned by about 17 percent; at two
11% steps per sample by about 4 percent.
13P = plate_setup(params);
14plan.nx = P.implicit.nx;
15plan.ny = P.implicit.ny;
16if plan.nx < 5 || plan.ny < 5
17 error('plate_implicit_plan: the grid needs at least 5 nodes in each direction');
18end
19plan.dx = P.plate.Lx / (plan.nx - 1);
20plan.dy = P.plate.Ly / (plan.ny - 1);
21plan.dt = 1 / (P.output.fs * P.implicit.steps_per_sample);
22plan.nsteps = ceil(P.implicit.duration / plan.dt);
23plan.ncells = plan.nx * plan.ny;
78d40e9Free edges for both finite-difference methodsJeremy Magland 24if strcmp(P.bc, 'free')
25 plan.nunknowns = plan.nx * plan.ny; % every node moves; see plate_matrices
26else
27 plan.nunknowns = (plan.nx - 2) * (plan.ny - 2);
28end
2546961Plate mechanics lab: Kirchhoff-Love plates solved by numbl in the browserJeremy Magland 29plan.cell_steps = plan.ncells * plan.nsteps;
30plan.theta = P.implicit.theta;
31end
↑↓ move↵openescclose