Transient study with generated inputs
Use an imported .m function when a time history is more naturally computed than tabulated.
Define a pure function in impactPulse.m, then import it by file:
function force = impactPulse(time, peak, duration)
arguments
time (:,1) double
peak (1,1) double
duration (1,1) double
end
insidePulse = time <= duration;
phase = min(time ./ duration, 1);
force = peak .* sin(pi .* phase) .* insidePulse;
endThe first parameter receives the column vector of requested time samples. The remaining parameters
match the names in the .fea arguments block. All three values use canonical SI units at the
function boundary, and the returned column has one force value in newtons for each time sample.
import function impactPulse from "./impactPulse.m"Declare the signal and its materialization contract inside the model:
signal pulse : force over time {
generated by function.impactPulse {
arguments {
peak = input.impact_force
duration = 6 ms
}
sample from 0 s to 50 ms at 100 kHz
interpolation = linear
extrapolation = reject
tolerance = 1e-5 N
}
}
excitation impact {
force {
target = geometry.bracket.region.load_face
signal = signal.pulse
direction = global([0, -1, 0])
}
}The procedure domain is independent and remains explicit:
analysis response {
structural transient {
start_time = 0 s
end_time = 50 ms
time_step = 0.1 ms
}
}Checking verifies function signature, effects, result shape, signal quantity, sample domain,
interpolation, tolerance, excitation target, and procedure time grid. Execution freezes the .m
source digest and records materialization evidence. The function cannot change the target or solver
configuration.
The checked tabulated counterpart is
structural-transient.fea.
Use it to compare an explicit table with a generated signal at identical samples.