Model Fitting¶
The Fit page provides interactive NLSQ (Nonlinear Least Squares) model fitting with real-time visualization.
Available Models¶
Models are organized by category:
Classical Models¶
Maxwell: Single exponential relaxation
Kelvin-Voigt: Elastic solid with viscous damping
Zener (Standard Linear Solid): Maxwell + elastic element
Fractional Models¶
Fractional Maxwell: Viscoelastic with fractional derivatives
Fractional Kelvin-Voigt: Fractional creep response
Fractional Zener: Fractional standard solid
Flow Models¶
Cross: Shear-thinning flow
Carreau: Smoothed shear-thinning
Power Law: Simple shear-thinning
Herschel-Bulkley: Yield stress + power law
Multi-Mode Models¶
Generalized Maxwell (GMM): Multiple relaxation modes
SGR Models¶
SGR Conventional: Soft glassy rheology
SGR Generic: GENERIC framework SGR
Model Selection¶
Using the Fit model panel¶
Navigate to the Fit page
In the Fit model panel (left side):
Choose the Mode (oscillation/relaxation/creep/rotation)
Choose the Model from the dropdown (or type an alias, e.g.
GMM)Click Fit Model
Model Information¶
After selecting a model:
Description: Physical interpretation
Parameters: List of model parameters
Compatible modes: Supported test modes (oscillation, relaxation, etc.)
Initial parameters¶
The GUI uses initial parameters from the current application state when available; otherwise it falls back to model defaults.
At the moment, the Fit page does not expose an editable parameters table. To fully control initial values/bounds/fixed parameters, use the Python API.
Running the Fit¶
Starting a Fit¶
Ensure data is loaded and model selected
Configure options (or use defaults)
Click “Fit Model” button
Progress¶
During fitting the application status bar updates with progress.
Stopping a Fit¶
Click “Cancel” to stop early (results may be partial).
Fit Results¶
Quality Metrics¶
After fitting completes:
R²: Coefficient of determination (closer to 1 = better)
χ²: Chi-squared statistic
MPE: Mean percentage error
RMSE: Root mean square error
Fitted parameters¶
Fitted parameter values are listed in the Fit model panel after completion.
Plot Visualization¶
The plot canvas shows:
Data and Fit¶
Data points: Experimental measurements
Fit curve: Model prediction
Residuals: Optional residual subplot
Plot Controls¶
Zoom: Mouse wheel or toolbar
Pan: Click and drag
Reset: Double-click or toolbar button
Log scale: Toggle buttons for X/Y axes
Multi-Dataset Fitting¶
Compare fits across datasets:
Load multiple datasets
Fit each independently
Use Multi-View to compare side-by-side
Residual Analysis¶
The Fit page includes a residuals panel below the main plot.
Available Plots¶
Residuals vs Fitted: Check for systematic bias
Q-Q Plot: Test normality of residuals
Histogram: Residual distribution
Scale-Location: Check heteroscedasticity
Autocorrelation: Check independence
Good Fit Indicators¶
Residuals randomly scattered around zero
Q-Q plot follows diagonal line
No patterns in autocorrelation
Advanced Options¶
Optimization Settings¶
Access via Settings > Fitting Options:
Algorithm: NLSQ algorithm variant
Max Iterations: Iteration limit
Tolerance: Convergence criteria (ftol, xtol)
Multi-start: Number of random initializations
Warm Start¶
Use previous fit results as starting point:
Fit with model A
Switch to similar model B
Enable Warm Start checkbox
Fit model B (starts from model A values)
Batch Fitting¶
Fit multiple datasets with same model:
Load all datasets
Configure model once
Click Fit All Datasets
Tips for Good Fits¶
Start simple: Try simpler models first
Check data range: Ensure data spans model features
Initial values: Use Auto Initialize or manual estimates
Bounds: Set physically meaningful constraints
Check residuals: Look for systematic patterns
Compare models: Use R² and AIC for model selection