GET SLOPE VS BEST FIT¶
Divides a curve into a specified number of equal segments and computes the linear best-fit slope for each segment, outputting a new curve of slope vs. R² (coefficient of determination). Typically used to analyse how the tangent stiffness and linearity evolve along a stress–strain curve.
When to use¶
Classification: process.
Tagged: best_fit, curve_analysis, linear_fit, r2, segmentation, slope, stress_strain, tangent_modulus.
Inputs¶
| Label | ID | Type | Default | Required | Description |
|---|---|---|---|---|---|
| Curve | curve1 | vector | — | Input XY curve to analyse — typically a stress-vs-strain curve (X = strain, Y = stress in consistent units); optional, but the worker produces no output if omitted. | |
| Number Of Segments | num_segments | float | 10 | Number of equal-length segments into which the curve is divided before fitting; integer-valued float, default 10 (code falls back to 100 if unset) — increase for finer resolution, decrease for a coarser trend. |
Outputs¶
| Label | ID | Type | Description |
|---|---|---|---|
| curve_get_slope_vs_r2_output_1 | curve_get_slope_vs_r2_output_1 | vector | Output XY curve where X is the best-fit slope of each segment and Y is the corresponding R² goodness-of-fit value (0–1), enabling identification of regions with highly linear behaviour (R² ≈ 1) and their associated stiffness. |
Disciplines¶
- data.curve.transform
- data.statistics
- engineering.material.characterization
Runnable example¶
A runnable example is registered for this worker. Open the example workflow on the d3VIEW canvas: /api/workflow/example?id=curve_get_slope_vs_r2
Auto-generated from transformation schema. Worker id: curve_get_slope_vs_r2. Schema hash: 49a0b5c43c13. Hand-curated docs in workerexamples/ override this page when present.