Scipy Curve Fit

Use scipy.optimize.curve_fit for nonlinear least squares parameter estimation from experimental data.

49 stars 5 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add UCSB-NLP-Chang/Skill-Usage --skill scipy-curve-fit
Manual install
git clone --depth 1 https://github.com/UCSB-NLP-Chang/Skill-Usage.git /tmp/Skill-Usage
mkdir -p ~/.claude/skills
cp -r /tmp/Skill-Usage/tasks/hvac-control/environment/skills/scipy-curve-fit ~/.claude/skills/scipy-curve-fit

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Using scipy.optimize.curve_fit for Parameter Estimation

## Overview

`scipy.optimize.curve_fit` is a tool for fitting models to experimental data using nonlinear least squares optimization.

## Basic Usage

```python
from scipy.optimize import curve_fit
import numpy as np

# Define your model function
def model(x, param1, param2):
    return param1 * (1 - np.exp(-x / param2))

# Fit to data
popt, pcov = curve_fit(model, x_data, y_data)

# popt contains the optimal parameters [param1, param2]
# pcov contains the covariance matrix
```

## Fitting a First-Order Step Response

```python
import numpy as np
from scipy.optimize import curve_fit

# Known values from experiment
y_initial = ...  # Initial output value
u = ...          # Input magnitude during step test

# Define the step response model
def step_response(t, K, tau):
    """First-order step response with fixed initial value and input."""
    return y_initial + K * u * (1 - np.exp(-t / tau))

# Your experimental data
t_data = np.array([...])  # Time points
y_data = np.array([...])  # Output readings

# Perform the fit
popt, pcov = curve_fit(
    step_response,
    t_data,
    y_data,
    p0=[K_guess, tau_guess],      # Initial guesses
    bounds=([K_min, tau_min], [K_max, tau_max])  # Parameter bounds
)

K_estimated, tau_estimated = popt
```

## Setting Initial Guesses (p0)

Good initial guesses speed up convergence:
Read the full skill on GitHub

Details

Skill name
scipy-curve-fit
Path
tasks/hvac-control/environment/skills/scipy-curve-fit/SKILL.md
Repo updated
8 April 2026

FAQ

What does the Scipy Curve Fit skill do?

Use scipy.optimize.curve_fit for nonlinear least squares parameter estimation from experimental data.

How do I install the Scipy Curve Fit skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add UCSB-NLP-Chang/Skill-Usage --skill scipy-curve-fit. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Scipy Curve Fit popular?

It lives in UCSB-NLP-Chang/Skill-Usage, which has 49 GitHub stars and 5 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.