Sensors¶
Select a physical response quantity at a location, then apply an ordered and reproducible measurement model without altering the structural state.
Sensor types¶
| Sensor | Source history | Quantity value |
|---|---|---|
DisplacementSensor |
result.displacement |
"displacement" |
VelocitySensor |
result.velocity |
"velocity" |
Accelerometer |
result.acceleration |
"acceleration" |
from dynaresp import sensors
layout = [
sensors.DisplacementSensor(position=0),
sensors.VelocitySensor(position=1),
sensors.Accelerometer(position=2),
]
For MDOF systems, position is an integer DOF index. For beams, it is a
physical coordinate along the span.
Measurement pipeline¶
flowchart LR
R[State history] --> O[Observation vector]
O --> C[Clean signal]
C --> E1[Sensitivity]
E1 --> E2[Bias]
E2 --> E3[Noise]
E3 --> E4[Clipping / quantization / dropout]
E4 --> M[Measured signal]
Effects run in the order provided:
accelerometer = sensors.Accelerometer(
position=2,
effects=[
sensors.Sensitivity(1.02),
sensors.Bias(0.05),
sensors.GaussianNoise(snr_db=30.0),
sensors.Clipping(-20.0, 20.0),
],
)
The noise= argument is a convenience that appends one effect after the
explicit effects sequence:
accelerometer = sensors.Accelerometer(
position=2,
noise=sensors.GaussianNoise(standard_deviation=0.01),
)
Available effects¶
| Effect | Parameters | Operation |
|---|---|---|
GaussianNoise |
snr_db or standard_deviation |
Adds independent normal noise |
Bias |
value |
Adds a constant offset |
Sensitivity |
factor |
Multiplies the signal |
Clipping |
minimum, maximum |
Limits the measurement range |
Quantization |
bits, full_scale |
Uniformly quantizes a symmetric range |
Dropout |
probability, value |
Replaces randomly selected samples |
GaussianNoise requires exactly one of snr_db and standard_deviation.
SNR-based noise computes the RMS of that sensor's clean signal. A zero clean
signal therefore receives zero SNR-based noise.
Clean versus measured output¶
import numpy as np
import dynaresp as dr
spec = dr.SimulationSpec(
system=system,
load=load,
sensors=(accelerometer,),
time=np.arange(500) / 100.0,
positions=np.arange(system.ndof),
)
result = dr.run_simulation(spec, seed=42)
clean = result.clean_signal[0]
measured = result.signal[0]
The structural state histories and clean_signal are never modified by sensor
effects. This makes the result suitable for denoising, calibration, and robust
learning experiments with exact ground truth.
Randomness¶
Every sensor receives an independent random generator derived from the simulation generator. Each effect receives a child generator in turn. A fixed simulation seed reproduces the complete measurement chain.