function plan = plate_plan_common(params, P) % PLATE_PLAN_COMMON The estimates both plans share. % % plan = plate_plan_common(params, P) fills the fields that do not depend % on the method: the plate's mass and the thread's pendulum frequency % sqrt(k / m) / (2 pi), the number of modes to expect below f_max from the % modal density of a thin plate, n(f) = (A / 2) sqrt(rho h / D) (an % asymptotic count; the small plate here has a few more), the Hertz % contact estimates and the coincidence frequency. pl = params.plate; mu = params.material.rho * pl.thickness; area = pl.width * pl.height; density = area / 2 * sqrt(mu / P.D); plan.plate_mass = P.plate_mass; plan.thread_k = P.thread_k; plan.pendulum_hz = sqrt(P.thread_k / P.plate_mass) / (2 * pi); plan.f_max = P.f_max; plan.modes_expected = round(density * P.f_max); plan.modes_cap = params.render.modes; plan.hertz_duration = P.hertz.duration; plan.hertz_impulse = P.hertz.impulse; plan.hertz_peak_force = P.hertz.peak_force; plan.contact_k = P.hertz.contact_k; plan.critical_frequency = P.critical_frequency; plan.nsamples = round(params.render.duration * params.render.fs); plan.nframes = params.render.nframes; plan.notes = {}; if P.f_max > 0 && plan.modes_expected == 0 plan.notes{end + 1} = 'no bending mode is expected below 0.47 fs: raise the sample rate or thin the plate'; end if plan.modes_expected > params.render.modes plan.notes{end + 1} = sprintf('about %d modes below 0.47 fs; only %d are kept (render.modes)', plan.modes_expected, params.render.modes); end if params.hammer.speed <= 0 plan.notes{end + 1} = 'the hammer has no speed: nothing will be struck'; end end