Skip to content

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.
  • direction is a vector or one of "x", "-x", "y", "-y", "z", "-z". For example, with x pointing forward, rearward intrusion is direction="-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.

reference instance-attribute

reference: str

"global", "node" or "frame".

x_dynamic instance-attribute

x_dynamic: float

Largest x displacement in magnitude during the event (signed).

y_dynamic instance-attribute

y_dynamic: float

Largest y displacement in magnitude (signed).

z_dynamic instance-attribute

z_dynamic: float

Largest z displacement in magnitude (signed).

resultant_dynamic instance-attribute

resultant_dynamic: float

Largest resultant displacement.

t_dynamic_ms instance-attribute

t_dynamic_ms: float

Time of the largest resultant displacement, ms from the first sample (nan without a time array).

x_static instance-attribute

x_static: float

Final x displacement (residual, after springback).

y_static instance-attribute

y_static: float

Final y displacement.

z_static instance-attribute

z_static: float

Final z displacement.

resultant_static instance-attribute

resultant_static: float

Final resultant displacement.

along_dynamic instance-attribute

along_dynamic: float

Largest displacement along direction (positive: in the direction); nan without a direction.

along_static instance-attribute

along_static: float

Final displacement along direction; nan without one.

t_along_ms instance-attribute

t_along_ms: float

Time of along_dynamic, ms (nan without time or direction).

reference_fit_error instance-attribute

reference_fit_error: float

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: Array

Displacement history, shape (n, 3), in the reference's initial axes.

time instance-attribute

time: Array | None

Time, s (None if not given).

resultant property

resultant: Array

Resultant displacement history.

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.

initial instance-attribute

initial: float

Distance at the first sample.

final instance-attribute

final: float

Final (static, residual) distance: the remaining space.

minimum instance-attribute

minimum: float

Smallest distance during the event.

maximum instance-attribute

maximum: float

Largest distance during the event.

closing_dynamic instance-attribute

closing_dynamic: float

Largest reduction of the distance, initial - minimum.

closing_static instance-attribute

closing_static: float

Final reduction, initial - final (negative if it opened).

opening_dynamic instance-attribute

opening_dynamic: float

Largest increase, maximum - initial.

t_minimum_ms instance-attribute

t_minimum_ms: float

Time of the smallest distance, ms (nan without time).

distance instance-attribute

distance: Array

Distance history.

time instance-attribute

time: Array | None

Time, s (None if not given).

node_track

node_track(
    x: ArrayLike,
    y: ArrayLike,
    z: ArrayLike,
    initial: ArrayLike | None = None,
) -> Array

Return a point's coordinates as an (n, 3) array.

Parameters:

Name Type Description Default
x ArrayLike

Coordinate histories, or displacement histories if initial is given.

required
y ArrayLike

Coordinate histories, or displacement histories if initial is given.

required
z ArrayLike

Coordinate histories, or displacement histories if initial is given.

required
initial ArrayLike | None

Initial coordinates (x0, y0, z0); the displacements are added to them. LS-DYNA nodout gives both coordinates and displacements, so either form works.

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: the global (ground) system, so vehicle motion is included. Useful for barriers and impactors, not for intrusions.
  • One node, shape (n, 3): its translation is removed. Rotation of the vehicle (pitch, yaw) is not, so use a node close to the point or a frame.
  • Three or more nodes, shape (k, n, 3) or a list of (n, 3) arrays: a frame that moves and rotates with them (for example the rear seat cross member, B-pillar bases and sills); translation and rotation are removed by a least-squares rigid fit. Two nodes are not enough (the rotation about the line through them is unknown).
None
time ArrayLike | None

Time in s, one value per row. Needed for times and static_window_ms.

None
direction Direction | None

Direction for along_* (a vector or "x", "-x" ...), in the reference's initial axes.

None
static_window_ms float | None

Average the last static_window_ms for the static values (to smooth springback oscillation). Default: the last sample.

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 static_window_ms for the final distance.

None