MockDataLab
EngineeringIEEE-style referenceseed 8

Synthetic underdamped step response

G(s) = 1/(s² + 0.3s + 1) answers a unit step with overshoot and ringing, sampled every 0.02 seconds for 25 seconds. Measurement noise has standard deviation 0.03 and seed 8. Natural frequency is 1 rad/s and the damping ratio is 0.15.

Second-order plant

G(s) = 1 / (s^2 + 0.3 s + 1), ζ = 0.15, ω = 1

Static snapshotCSV (seed 8) ↓
Interactive control bench loads as it enters view…

What this page generates

Write the denominator as s² + 2 ζ ω s + ω². Then ω = 1 and 2 ζ ω = 0.3, so ζ = 0.15. That is lightly damped. A unit step on a plant with DC gain 1 should settle at 1, and it should overshoot. The peak of an ideal underdamped step is often taught as a formula in ζ; this file lets you read the peak off output_clean instead of trusting the memory of the formula. The copper dashed line on the chart is that clean trajectory. The green line is the same trajectory plus measurement noise.

Integration is RK4 with the input held constant on each 0.02 second interval. The state-space matrices are the controllable canonical form of the monic denominator. For this plant the last row of A is [−1, −0.3] and C picks off the position state. You do not need those matrices to use the CSV. They are printed in the Python script so a reimplementation can skip repeating the conversion and still match.

Twenty-five seconds is many periods of a 1 rad/s oscillator (period about 6.3 seconds), long enough for the 0.15 damping to finish the visible ring. A shorter record would look like it never settles. The noise 0.03 is a small fraction of the overshoot, so the rings stay countable. Seed 8 affects only that noise.

This is not a measured servo. There is no friction identified from hardware and no anti-aliasing filter beyond the sample time you set. The header says the series is synthetic. Keep it.

Generating rule

Second-order plant

G(s) = 1 / (s^2 + 0.3 s + 1), ζ = 0.15, ω = 1

Check values

Worked numbers

Seed 8 produced 1251 rows from t = 0 to t = 25.00. The clean output peaks at 1.621 and ends at 0.980. The input changes value 0 times. Those figures describe this seed only; they are not a laboratory trial.

Parameters and defaults

Parameters, defaults, and what they change
ParameterDefaultRangeEffect
denominator1, 0.3, 1highest power firstSets ω and ζ. Leading 1 keeps the polynomial monic.
numerator1degree ≤ denominatorDC gain is numerator(0)/denominator(0) = 1.
inputunit stepstep, PRBS, sineConstant 1, so the transient is the homogeneous ring plus the steady value.
dt0.02 s> 0Fine compared with the 6 second period.
duration25 slonger than dtSeveral decaying cycles.
noise std0.03≥ 0Sensor noise on the recorded output.
seed8unsigned 32-bitRepeats the sensor noise.

Python for this seed

Full script with mulberry32() & box_muller() available via Copy Python above

reproduce_seed_8.pyseed 8
# SYNTHETIC DATA - generated by MockDataLab (mockdatalab.com)
# This file is synthetic and must not be presented as real measurements, clinical data, or results from a physical instrument.
# generator: control-transfer-function
# seed: 8
# G(s) = (1) / (s^2 + 0.3*s + 1)
# numerator (highest power first): 1
# denominator (highest power first): 1, 0.3, 1
# input: step amplitude=1
# integrator: RK4 with zero-order hold

# mulberry32() and box_muller() are included when you copy the full script.


SEED = 8
DT = 0.02
STEPS = 1250
NOISE = 0.03
A = np.array([[0.0, 1.0], [-1.0, -0.3]], dtype=np.float64)
B = np.array([0.0, 1.0], dtype=np.float64)
C = np.array([1.0, 0.0], dtype=np.float64)
D = 0.0

def input_at(i, t):
    return 1.0

def deriv(x, u):
    return A @ x + B * u

def rk4(x, u, dt):
    k1 = deriv(x, u)
    k2 = deriv(x + 0.5 * dt * k1, u)
    k3 = deriv(x + 0.5 * dt * k2, u)
    k4 = deriv(x + dt * k3, u)
    return x + (dt / 6.0) * (k1 + 2.0 * k2 + 2.0 * k3 + k4)

rng = mulberry32(SEED)
state = np.zeros(A.shape[0], dtype=np.float64)
time = np.empty(STEPS + 1, dtype=np.float64)
inp = np.empty(STEPS + 1, dtype=np.float64)
clean = np.empty(STEPS + 1, dtype=np.float64)
output = np.empty(STEPS + 1, dtype=np.float64)
for i in range(STEPS + 1):
    t = i * DT
    u = float(input_at(i, t))
    y = float(C @ state + D * u)
    time[i] = t
    inp[i] = u
    clean[i] = y
    output[i] = y + (NOISE * box_muller(rng) if NOISE > 0 else 0.0)
    if i < STEPS and state.size:
        state = rk4(state, u, DT)

columns = ["time", "input", "output_clean", "output"]
data = np.column_stack([time, inp, clean, output])

Exercises

  • EXERCISE 01Read the overshoot from output_clean and compare it with the ζ formula.
  • EXERCISE 02Fit a second-order model and see if it recovers 0.3 and 1.
  • EXERCISE 03Show how a small sensor noise looks on top of a large ring.

Questions

Why does the output start at 0?

Both states start at rest and there is no direct feedthrough. The step is applied as the input at t = 0; the state has not moved yet.

Is 0.3 the damping ratio?

No. 0.3 is 2 ζ ω with ω = 1, so ζ = 0.15.

Which line is the truth?

output_clean. The green measured trace is truth plus noise. Both are synthetic.

Related

SYNTHETIC DATA - generated by MockDataLab (mockdatalab.com). Do not present the download as a real measurement.