crashmetrics.intrusion¶
intrusion
¶
Intrusion and deformation measurement from node or point coordinates.
Works on coordinate histories from CAE (for example LS-DYNA nodout)
and on static before/after measurements from a physical test.
Functions:
intrusion: Displacement of a point, absolute or relative to a reference node or to a reference frame of three or more points that move with the vehicle (translation and rotation removed), with dynamic (peak) and static (final) values, overall and along a direction.intrusions: The same for many points with one reference.node_distance: Distance between two points over time: closing, opening and the remaining (survival) space.node_track: Build an (n, 3) coordinate array from x, y and z columns, or from an initial position and displacements.
Conventions:
- A point's coordinates are an array of shape (n, 3): one row per time step (or two rows, before and after, for a static measurement), in any length unit (results use the same unit).
- Intrusions are expressed in the axes of the reference at the first sample, normally the vehicle axes of the undeformed model.
directionis a vector or one of"x","-x","y","-y","z","-z". For example, with x pointing forward, rearward intrusion isdirection="-x".
IntrusionResult
dataclass
¶
IntrusionResult(
reference: str,
x_dynamic: float,
y_dynamic: float,
z_dynamic: float,
resultant_dynamic: float,
t_dynamic_ms: float,
x_static: float,
y_static: float,
z_static: float,
resultant_static: float,
along_dynamic: float,
along_static: float,
t_along_ms: float,
reference_fit_error: float,
displacement: Array,
time: Array | None,
)
Displacement of a point relative to a reference.
x_dynamic
instance-attribute
¶
Largest x displacement in magnitude during the event (signed).
t_dynamic_ms
instance-attribute
¶
Time of the largest resultant displacement, ms from the first sample (nan without a time array).
along_dynamic
instance-attribute
¶
Largest displacement along direction (positive: in the
direction); nan without a direction.
along_static
instance-attribute
¶
Final displacement along direction; nan without one.
t_along_ms
instance-attribute
¶
Time of along_dynamic, ms (nan without time or direction).
reference_fit_error
instance-attribute
¶
Largest RMS distance of the reference points from their best
rigid fit ("frame" only, else 0). A large value means the
reference points deform and are not a good reference.
displacement
instance-attribute
¶
Displacement history, shape (n, 3), in the reference's initial axes.
DistanceResult
dataclass
¶
DistanceResult(
initial: float,
final: float,
minimum: float,
maximum: float,
closing_dynamic: float,
closing_static: float,
opening_dynamic: float,
t_minimum_ms: float,
distance: Array,
time: Array | None,
)
Distance between two points over time.
node_track
¶
Return a point's coordinates as an (n, 3) array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ArrayLike
|
Coordinate histories, or displacement histories if |
required |
y
|
ArrayLike
|
Coordinate histories, or displacement histories if |
required |
z
|
ArrayLike
|
Coordinate histories, or displacement histories if |
required |
initial
|
ArrayLike | None
|
Initial coordinates (x0, y0, z0); the displacements are added to
them. LS-DYNA |
None
|
intrusion
¶
intrusion(
point: ArrayLike,
reference: ArrayLike
| Sequence[ArrayLike]
| None = None,
time: ArrayLike | None = None,
direction: Direction | None = None,
static_window_ms: float | None = None,
) -> IntrusionResult
Return the intrusion (displacement) of a point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
ArrayLike
|
Coordinates of the point, shape (n, 3): a time history, or two rows (before and after) for a static measurement. |
required |
reference
|
ArrayLike | Sequence[ArrayLike] | None
|
What the displacement is measured against:
|
None
|
time
|
ArrayLike | None
|
Time in s, one value per row. Needed for times and
|
None
|
direction
|
Direction | None
|
Direction for |
None
|
static_window_ms
|
float | None
|
Average the last |
None
|
Returns:
| Type | Description |
|---|---|
IntrusionResult
|
|
intrusions
¶
intrusions(
points: Mapping[str, ArrayLike],
reference: ArrayLike
| Sequence[ArrayLike]
| None = None,
time: ArrayLike | None = None,
direction: Direction
| Mapping[str, Direction]
| None = None,
static_window_ms: float | None = None,
) -> dict[str, IntrusionResult]
Return intrusion for many points against one reference.
direction may be one direction for all points or a dict
{point name: direction} (for example "-x" for the pedals and
"z" for the steering column). flatten(intrusions(...)) gives
columns such as "brake_pedal.along_dynamic".
node_distance
¶
node_distance(
a: ArrayLike,
b: ArrayLike,
time: ArrayLike | None = None,
static_window_ms: float | None = None,
) -> DistanceResult
Return the distance between two points over time.
The distance does not depend on any reference frame, so it suits survival-space checks (steering wheel to seat, door to B-pillar, roof to head form) and gaps that must not close.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
ArrayLike
|
Coordinates of the two points, shape (n, 3), or two rows for a static before/after measurement. |
required |
b
|
ArrayLike
|
Coordinates of the two points, shape (n, 3), or two rows for a static before/after measurement. |
required |
time
|
ArrayLike | None
|
Time in s, one value per row. |
None
|
static_window_ms
|
float | None
|
Average the last |
None
|