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, ζ 0.05: steady amplitude m A/|k - m w² + i c w| and phase lag atan2(c w, k - m w²) (closed form; to 10⁻⁶ and 10⁻⁴ deg)passedfundamental_mm0.136312 ± 1.4 × 10⁻⁷0.136312locked0.31 % of the tolerance usedswing_mm0.136312 ± 1.4 × 10⁻⁷0.136312locked0.31 % of the tolerance usedphase_lag_deg25.3462 ± 0.000125.3462locked0.37 % of the tolerance usedsettled= truetruelockedexact matchr0002free decay, ζ 0.02: logarithmic decrement 2 π ζ / √(1 - ζ²) and damped frequency
f_n√(1 - ζ²) (to 10⁻⁶)passedlog_decrement0.125689 ± 1.3 × 10⁻⁷0.125689locked7.9 % of the tolerance useddamped_frequency_Hz24.995 ± 2.5 × 10⁻⁵24.995locked0.072 % of the tolerance usedr0003undamped double well, curve points only between the two wells (x³ - x spring): energy conserved to 10⁻⁸ while half the time is spent on the extensionpassed
energy_balance_error≤ 10⁻⁸1.11573 × 10⁻⁹lockedinside the rangetime_outside_data_fraction≥ 0.10.39716lockedinside the rangesnaps= 00lockedexact matchr0004undamped double well U = k₁(x⁴/(4 x₀²) - x^2/2): kicked at 0.98 √(2 dU/m) stays in its wellpassed
snaps= 00lockedexact matchstays_in_well= truetruelockedexact matchenergy_balance_error≤ 10⁻⁸3.23018 × 10⁻¹¹lockedinside the ranger0005the same well kicked at 1.02 √(2 dU/m) snaps acrosspassed
snaps≥ 17lockedinside the rangestays_in_well= falsefalselockedexact matchr0006isolated impact on a stop (K 10⁴ 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 10⁻⁶ / 10⁻⁶ / 10⁻⁵)passed
stops.upper.restitution_measured= 0.5, within 1.000000 × 10⁻⁶ relativereading not recorded on this pagestops.upper.contact_time_s= 0.002715, within 1.000000 × 10⁻⁶ relativereading not recorded on this pagestops.upper.peak_force_N= 0.810367, within 1.000000 × 10⁻⁵ relativereading not recorded on this pagestops.upper.impacts= 1misseddiffersr0007half-sine shock (10 m/s², 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 10⁻⁶)passed
swing_max_mm0.0808677 ± 8.1 × 10⁻⁸0.0808677locked1.4 % of the tolerance usedswing_min_mm-0.0808677 ± 8.1 × 10⁻⁸-0.0808677locked0.39 % of the tolerance usedr0008ideal matched transducer at resonance: P = m A² / (16 ζ
w_n) (Williams and Yates 1996; as resonator)passedpower_uW198.944 ± 0.002198.944locked0.86 % of the tolerance usedr0009linear piezoelectric harvester at resonance, load 1/(w C_p): power |V|²/(2R) from the frequency response of the lumped pair (to 10⁻⁵)passed
power_load_uW155.877 ± 0.0016155.877locked1 % of the tolerance usedr0010linear piezoelectric harvester, best load found by the time-domain search: R_opt² = (a²+b²)/((b w C_p)² + (a w C_p + w θ²)²) from dP/dR = 0, and its power (to 10⁻³, 10⁻⁵)passed
best_load_ohm304551 ± 3 × 10²304551locked0.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 + k₃ x³). | |
cubic_N_per_m3 | N/m³ | 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² | With curve_length_m: a dimensionless strip curve (d/L, F L²/EI): x scale L, force scale EI/L². | |
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² | 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 θ²/(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² | 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² | Or RMS accelerations. | |
shock_peak_mps2 | m/s² | 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.