Skip to content
Agentmart
Submit a tool

first-order-model-fitting

Fit first-order dynamic models to experimental step response data and extract K (gain) and tau (time constant) parameters.

Skill by benchflow-ai

IndexedApache-2.0★ 1,870
Write a review

Chalk Labs

Need help deploying first-order-model-fitting?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/benchflow-ai-first-order-model-fitting

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Fit first-order dynamic models to experimental step response data and extract K (gain) and tau (time constant) parameters.

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/first-order-model-fitting

What's inside

Skill name
first-order-model-fitting
Description
Fit first-order dynamic models to experimental step response data and extract K (gain) and tau (time constant) parameters.
License
Apache-2.0
Instructions
96 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# First-Order System Model Fitting

## Overview

Many physical systems (thermal, electrical, mechanical) exhibit first-order dynamics. This skill explains the mathematical model and how to extract parameters from experimental data.

## The First-Order Model

The dynamics are described by:

```
tau * dy/dt + y = y_ambient + K * u
```

Where:
- `y` = output variable (e.g., temperature, voltage, position)
- `u` = input variable (e.g., power, current, force)
- `K` = process gain (output change per unit input at steady state)
- `tau` = time constant (seconds) - characterizes response speed
- `y_ambient` = baseline/ambient value

## Step Response Formula

When you apply a step input from 0 to u, the output follows:

```
y(t) = y_ambient + K * u * (1 - exp(-t/tau))
```

This is the key equation for fitting.

## Extracting Parameters

### Process Gain (K)

At steady state (t -> infinity), the exponential term goes to zero:

```
y_steady = y_ambient + K * u
```

Therefore:

```
K = (y_steady - y_ambient) / u
```

### Time Constant (tau)

The time constant can be found from the 63.2% rise point:

At t = tau:
```
y(tau) = y_ambient + K*u*(1 - exp(-1))
       = y_ambient + 0.632 * (y_steady - y_ambient)
```

So tau is the time to reach 63.2% of the final output change.

## Model Function for Curve Fitting

```python
def step_response(t, K, tau, y_ambient, u):
    """First-order step response model."""
    return y_ambient + K * u * (1 - np.exp(-t / tau))
```

When fitting, you typically fix `y_ambient` (from initial reading) and `u` (known input), leaving only `K` and `tau` as unknowns:

```python
def model(t, K, tau):
    return y_ambient + K * u * (1 - np.exp(-t / tau))
```

## Practical Tips

1. **Use rising portion data**: The step response formula applies during the transient phase
2. **Exclude initial flat region**: Start your fit from when the input changes
3. **Handle noisy data**: Fitting naturally averages out measurement noise
4. **Check units**: Ensure K has correct units (output units / input units)

## Quality Metrics

After fitting, calculate:
- **R-squared (R^2)**: How well the model explains variance (want > 0.9)
- **Fitting error**: RMS difference between model and data

```python
residuals = y_measured - y_model
ss_res = np.sum(residuals**2)
ss_tot = np.sum((y_measured - np.mean(y_measured))**2)
r_squared = 1 - (ss_res / ss_tot)
fitting_error = np.sqrt(np.mean(residuals**2))
```

From benchflow-ai/skillsbench, Apache-2.0.

More from benchflow-ai/skillsbench

Signals

Stars
1,870
Forks
372
Open issues
50
Last commit (this folder)
Jan 20, 2026 (9 months ago)
Last release
Jun 14, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from benchflow-ai

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get first-order-model-fitting running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying first-order-model-fitting?

CallGet help
Cite this page

first-order-model-fitting skill. Agent Mart. https://agentmart.dev/skills/benchflow-ai-first-order-model-fitting (last updated 2026-10-24)