dynamics
One mass on any spring, shaken at its base, followed over time (SciPy solve_ivp, DOP853, events at every contact and snap). Spring: a stiffness (with a cubic term), or a force-deflection curve from a CSV file (a strip run's curves.csv, with scales) or inline points, extended beyond the data by a stated rule. Mechanical damping, an ideal transducer, a piezoelectric patch on a resistive load (the lumped pair: force factor, clamped capacitance, load), end stops (push-only spring-dashpot set from a restitution). Base motion: a sine (RMS acceleration or velocity), a stepped frequency sweep up and down, a stepped amplitude sweep, a half-sine shock, or a free release. Readings: steady swing (max, min, RMS), snaps between wells, peak force on each stop, harvested power, power against load and the best load, the small-signal (linear) answer beside the real one, energy balance error. Files: history.csv, sweep.csv or load.csv, spring.csv (the spring used, data or extension), plot.png.
- Field
- Dynamics and control
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 20 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001linear resonator from rest, 0.9 f_n, zeta 0.05: steady amplitude m A/|k - m w^2 + i c w| and phase lag atan2(c w, k - m w^2) (closed form; to 1e-6 and 1e-4 deg)passed
fundamental_mm0.136312 ± 1.4e-070.136312locked0.31 % of the tolerance usedswing_mm0.136312 ± 1.4e-070.136312locked0.31 % of the tolerance usedphase_lag_deg25.3462 ± 0.000125.3462locked0.37 % of the tolerance usedsettled= truetruelockedexact matchr0002free decay, zeta 0.02: logarithmic decrement 2 pi zeta / sqrt(1 - zeta^2) and damped frequency f_n sqrt(1 - zeta^2) (to 1e-6)passed
log_decrement0.125689 ± 1.3e-070.125689locked7.9 % of the tolerance useddamped_frequency_Hz24.995 ± 2.5e-0524.995locked0.072 % of the tolerance usedr0003undamped double well, curve points only between the two wells (x^3 - x spring): energy conserved to 1e-8 while half the time is spent on the extensionpassed
energy_balance_error≤ 1e-081.11573e-09lockedinside the rangetime_outside_data_fraction≥ 0.10.39716lockedinside the rangesnaps= 00lockedexact matchr0004undamped double well U = k1(x^4/(4 x0^2) - x^2/2): kicked at 0.98 sqrt(2 dU/m) stays in its wellpassed
snaps= 00lockedexact matchstays_in_well= truetruelockedexact matchenergy_balance_error≤ 1e-083.23018e-11lockedinside the ranger0005the same well kicked at 1.02 sqrt(2 dU/m) snaps acrosspassed
snaps≥ 17lockedinside the rangestays_in_well= falsefalselockedexact matchr0006isolated impact on a stop (K 1e4 N/m, e 0.5, 0.1 m/s): rebound ratio, contact time and peak force of the push-only spring-dashpot (closed form, to 1e-6 / 1e-6 / 1e-5)passed
stops.upper.restitution_measured{"value": 0.5, "rel_tol": 1e-06}stops.upper.contact_time_s{"value": 0.002715289194631176, "rel_tol": 1e-06}stops.upper.peak_force_N{"value": 0.8103674245090442, "rel_tol": 1e-05}stops.upper.impacts= 1misseddiffersr0007half-sine shock (10 m/s^2, 2 ms) on an undamped linear spring at 25 Hz: residual swing = |(u, u'/w) at the pulse's end| from the exact forced solution (to 1e-6)passed
swing_max_mm0.0808677 ± 8.1e-080.0808677locked1.4 % of the tolerance usedswing_min_mm-0.0808677 ± 8.1e-08-0.0808677locked0.39 % of the tolerance usedr0008ideal matched transducer at resonance: P = m A^2 / (16 zeta w_n) (Williams and Yates 1996; as resonator)passed
power_uW198.944 ± 0.002198.944locked0.86 % of the tolerance usedr0009linear piezoelectric harvester at resonance, load 1/(w C_p): power |V|^2/(2R) from the frequency response of the lumped pair (to 1e-5)passed
power_load_uW155.877 ± 0.0016155.877locked1 % of the tolerance usedr0010linear piezoelectric harvester, best load found by the time-domain search: R_opt^2 = (a^2+b^2)/((b w C_p)^2 + (a w C_p + w theta^2)^2) from dP/dR = 0, and its power (to 1e-3, 1e-5)passed
best_load_ohm304551 ± 3e+02304551locked0.021 % of the tolerance usedbest_power_uW29.8816 ± 0.000329.8816locked0.43 % of the tolerance used
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
mass_kg | kg | ||
stiffness_N_per_m | N/m | A linear spring (or with cubic_N_per_m3 a Duffing spring, F = k x + k3 x^3). | |
cubic_N_per_m3 | N/m^3 | 0 | |
curve | A CSV force-deflection curve, e.g. @rNNNN/curves.csv from strip. | ||
curve_points | Inline [deflection_m, force_N] pairs, used when curve is not given. | ||
curve_x | d_over_L | The curve file's deflection column. | |
curve_force | force | The curve file's force column. | |
curve_filter | Keep only rows with these column values, e.g. {"precompression_pct": 1}. | ||
x_scale_m | m | 1 | Multiplies the curve's deflections to metres. |
force_scale_N | N | 1 | Multiplies the curve's forces to newtons. |
curve_EI_Nm2 | N m^2 | With curve_length_m: a dimensionless strip curve (d/L, F L^2/EI): x scale L, force scale EI/L^2. | |
curve_length_m | m | ||
force_sign | push | push: the force needed to hold the mass at that deflection (strip's convention); restoring: the spring's force on the mass. | |
extend | quadratic | Beyond the data: the end value and slope plus a curvature fitted to the last extend_fit_span of the data, or the end tangent. | |
extend_fit_span | 0.1 | Fraction of the data's range used to fit the extension's curvature. | |
rest_state | lower | Which stable resting point the mass starts in and deflections are measured from: lower, upper or an index. | |
rest_near_m | m | Or: the stable resting point nearest this curve deflection. | |
tune_to_Hz | Hz | Scale the curve's force so the small-signal frequency at rest is this (a stand-in for a trim screw). | |
extra_stiffness_N_per_m | N/m | 0 | A linear stiffness added about the rest point (e.g. a piezo patch's own stiffness). |
gravity_mps2 | m/s^2 | 0 | Gravity along the direction of motion. |
zeta_mech | 1 | 0 | Mechanical damping ratio, of the small-signal frequency at rest. |
damping_Ns_per_m | N s/m | Or the damping coefficient. | |
zeta_elec | 1 | 0 | An ideal (viscous) transducer's damping ratio, or "matched" (= zeta_mech, the most an ideal one takes). Its power is power_ideal_uW. |
theta_N_per_V | N/V | Piezo force factor (lumped): force per volt, also charge per metre. | |
coupling_k2 | 1 | Or the system coupling theta^2/(K C_p), K the short-circuit stiffness at rest. | |
capacitance_F | F | Piezo clamped capacitance. | |
load_ohm | ohm | best | The resistive load, or "best" (sine only: a load scan and a search for the most power). |
load_points | 13 | Loads in the scan (log-spaced over 1/(w C_p) x 10^+-1.5). | |
stop_lower_m | m | A stop below rest (negative). | |
stop_upper_m | m | A stop above rest (positive). | |
stop_stiffness_N_per_m | N/m | 20000 | Contact stiffness of each stop. |
stop_restitution | 1 | 0.5 | Coefficient of restitution of an isolated impact on a stop. |
excitation | sine | ||
frequency_Hz | Hz | Drive frequency (default: the small-signal natural frequency). | |
accel_rms_mps2 | m/s^2 | RMS base acceleration. | |
velocity_rms_mmps | mm/s | Or RMS base velocity (held across a sweep). | |
f_start_Hz | Hz | ||
f_stop_Hz | Hz | ||
sweep_steps | 41 | ||
sweep_direction | both | Each step starts from the state the last one left (jumps and coexisting branches show). | |
levels_velocity_rms_mmps | mm/s | amplitude_sweep: RMS velocities in order, at frequency_Hz. | |
levels_accel_rms_mps2 | m/s^2 | Or RMS accelerations. | |
shock_peak_mps2 | m/s^2 | Half-sine shock: peak base acceleration (signed). | |
shock_duration_s | s | ||
u0_m | m | 0 | free: starting deflection from rest. |
v0_mps | m/s | 0 | free: starting velocity. |
record_s | s | 1 | free and shock: how long to follow. |
start | rest | Start at rest, or in the small-signal steady state. | |
rtol | 1e-09 | Integrator relative tolerance (absolute: rtol x each state's scale). | |
method | DOP853 | ||
settle_tol | 1e-07 | Steady when amplitude and power change less than this between 10-cycle blocks. | |
max_settle_cycles | 3000 | ||
measure_cycles | 50 |
Readings
| Name | Unit | Meaning |
|---|---|---|
swing_mm | mm | |
swing_max_mm | mm | |
swing_min_mm | mm | |
swing_rms_mm | mm | |
power_uW | µW | |
power_load_uW | µW | |
power_ideal_uW | µW | |
best_load_ohm | ohm | |
best_power_uW | µW | |
load_table | ||
coupling_k2 | 1 | |
snaps | ||
stays_in_well | ||
final_well | ||
stops | ||
linear_estimate | ||
energy_balance_error | 1 | |
time_outside_data_fraction | 1 | |
max_outside_data_mm | mm | |
sweep | ||
snap_level | ||
log_decrement | ||
integrator | ||
history.csv | ||
sweep.csv | ||
load.csv | ||
spring.csv | ||
plot.png | ||
power_vs_linear | 1 | |
swing_vs_linear | 1 | |
zeta_mech | 1 | |
zeta_elec | 1 | |
capacitance_F | F | |
theta_N_per_V | N/V | |
voltage_rms_V | V | |
voltage_peak_V | V |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.