Agent skill
simulation-metrics
Use this skill when calculating control system performance metrics such as rise time, overshoot percentage, steady-state error, or settling time for evaluating simulation results.
Install this agent skill to your Project
npx add-skill https://github.com/benchflow-ai/skillsbench/tree/main/tasks-no-skills/adaptive-cruise-control/environment/skills/simulation-metrics
SKILL.md
Control System Performance Metrics
Rise Time
Time for system to go from 10% to 90% of target value.
def rise_time(times, values, target):
"""Calculate rise time (10% to 90% of target)."""
t10 = t90 = None
for t, v in zip(times, values):
if t10 is None and v >= 0.1 * target:
t10 = t
if t90 is None and v >= 0.9 * target:
t90 = t
break
if t10 is not None and t90 is not None:
return t90 - t10
return None
Overshoot
How much response exceeds target, as percentage.
def overshoot_percent(values, target):
"""Calculate overshoot percentage."""
max_val = max(values)
if max_val <= target:
return 0.0
return ((max_val - target) / target) * 100
Steady-State Error
Difference between target and final settled value.
def steady_state_error(values, target, final_fraction=0.1):
"""Calculate steady-state error using final portion of data."""
n = len(values)
start = int(n * (1 - final_fraction))
final_avg = sum(values[start:]) / len(values[start:])
return abs(target - final_avg)
Settling Time
Time to stay within tolerance band of target.
def settling_time(times, values, target, tolerance=0.02):
"""Time to settle within tolerance of target."""
band = target * tolerance
lower, upper = target - band, target + band
settled_at = None
for t, v in zip(times, values):
if v < lower or v > upper:
settled_at = None
elif settled_at is None:
settled_at = t
return settled_at
Usage
times = [row['time'] for row in results]
values = [row['value'] for row in results]
target = 30.0
print(f"Rise time: {rise_time(times, values, target)}")
print(f"Overshoot: {overshoot_percent(values, target)}%")
print(f"SS Error: {steady_state_error(values, target)}")
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
csv-processing
Use this skill when reading sensor data from CSV files, writing simulation results to CSV, processing time-series data with pandas, or handling missing values in datasets.
pid-controller
Use this skill when implementing PID control loops for adaptive cruise control, vehicle speed regulation, throttle/brake management, or any feedback control system requiring proportional-integral-derivative control.
yaml-config
Use this skill when reading or writing YAML configuration files, loading vehicle parameters, or handling config file parsing with proper error handling.
vehicle-dynamics
Use this skill when simulating vehicle motion, calculating safe following distances, time-to-collision, speed/position updates, or implementing vehicle state machines for cruise control modes.
web-interface-guidelines
Vercel's comprehensive UI guidelines for building accessible, performant web interfaces. Use this skill when reviewing or building UI components for compliance with best practices around accessibility, performance, animations, and visual stability.
browser-testing
VERIFY your changes work. Measure CLS, detect theme flicker, test visual stability, check performance. Use BEFORE and AFTER making changes to confirm fixes. Includes ready-to-run scripts: measure-cls.ts, detect-flicker.ts
Didn't find tool you were looking for?