Troubleshooting Guide¶
This guide provides solutions to 15+ common problems encountered when fitting rheological models.
Fitting Problems¶
Problem: Optimization Does Not Converge¶
Symptoms: “Optimization did not converge” error, max iterations reached
Solutions:
Increase max iterations:
model.fit(x, y, max_iter=5000)Relax tolerances:
model.fit(x, y, ftol=1e-6, xtol=1e-6)Use smart initialization (fractional models, oscillation mode)
Try simpler model (Maxwell before FractionalMaxwellLiquid)
Check data quality (remove outliers, smooth noise)
Problem: Unphysical Parameters¶
Symptoms: Negative moduli, tau < 10⁻⁹ s, alpha > 1
Solutions:
Tighten parameter bounds:
model.parameters.set_bounds('alpha', (0.1, 0.95))Enable compatibility checking:
model.fit(x, y, check_compatibility=True)Verify correct test_mode: ‘oscillation’ not ‘relaxation’ for SAOS
Try different model family
Problem: Poor Fit Quality (Error > 10%)¶
Symptoms: Systematic deviations, curvature mismatch
Solutions:
Try more complex model (Classical → Fractional)
Check if model is appropriate using compatibility checking
Verify data preprocessing (units, scaling)
Consider multi-mode model
Data Problems¶
Problem: File Not Loading¶
Solutions:
Use auto_read():
data = auto_read('file.txt')Check file encoding (UTF-8 vs. Latin-1)
Try specific reader:
read_trios(),read_csv()Verify file path (absolute vs. relative)
Problem: Test Mode Not Detected¶
Solutions:
Manually set:
data.metadata['test_mode'] = 'relaxation'Check data characteristics (monotonic, domain)
Verify column names match expected patterns
Model Selection Problems¶
Problem: Don’t Know Which Model to Use¶
Solutions:
Use decision flowchart: Model Selection Guide
Enable compatibility checking for suggestions
Start with classical (Maxwell, Zener), upgrade if needed
Check material classification: Material Classification
Problem: Model Compatibility Warning¶
Example: “FZSS expects power-law decay but detected exponential”
Solutions:
Follow suggested alternatives in warning message
Use compatibility checking before fitting
Verify test mode is correct
Bayesian Inference Problems¶
Problem: Low ESS (Effective Sample Size < 400)¶
Solutions:
Increase num_samples:
fit_bayesian(num_samples=5000)Use NLSQ warm-start (done automatically)
Check for multimodal posterior
Increase num_warmup
Problem: High R-hat (> 1.1)¶
Solutions:
Increase num_warmup:
fit_bayesian(num_warmup=2000)Use warm-start from NLSQ fit
Run multiple chains:
num_chains=4
Quick Reference Flowchart¶
[Problem Category]
│
├─→ Convergence failure
│ └─→ Increase max_iter, relax tol, smart init
│
├─→ Unphysical parameters
│ └─→ Tighten bounds, compatibility check
│
├─→ Poor fit (error > 10%)
│ └─→ Try complex model, check compatibility
│
├─→ File loading issues
│ └─→ Use auto_read(), check encoding
│
└─→ Model selection
└─→ Use flowchart, compatibility checking
Getting More Help¶
Check Fitting Strategies and Troubleshooting for advanced techniques
Review example notebooks in
examples/Consult model-specific pages in Models Handbook
Open GitHub issue with minimal reproducible example