Curve-fit experimental data
fit_correlationFit linear or power-law models to paired experimental data, returning coefficients, R², and formula string for engineering correlations.
Instructions
Fit a least-squares model to paired (x, y) experimental data and return the coefficients, R^2, and a formula string. Use 'power' for dimensionless correlations like Nu = CRe^n (fit in log-log space; x and y must be positive) or 'linear' for y = mx + c.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Independent-variable values. | |
| y | Yes | Dependent-variable values (same length as x). | |
| model | Yes | Which model to fit. |