Synthetic fiber composite — modeling directional material response¶
1. Define the patch study¶
This example demonstrates how Rend can identify an anisotropic material law from biaxial and directional shear data. The dataset is generated from a known fiber-reinforced hyperelastic model and does not contain biological tissue measurements.
As an illustrative application, consider a reinforced pump diaphragm with in-plane stretches up to 1.12 and engineering shear up to \(|\gamma|=0.45\).
Compare models using an overall \(R^2\) of at least 0.90 and a per-tag \(R^2\) of at least 0.85. Also inspect the absolute stress error of each shear curve, since a high overall score can hide errors in individual loading directions.
2. Prepare biaxial and directional shear data¶
The synthetic CSV contains 199 nominal-stress observations in kPa. Five biaxial paths each have 17 points with stretches up to 1.12. Their tags give the ratio of stretch increments along axes 1 and 2. The six directional shear tags each have 19 points from engineering shear −0.45 to 0.45. The generator uses an isotropic matrix with quadratic terms in the dispersed fiber invariant \(I_{4,i}^*=\kappa_i I_1+(1-3\kappa_i)I_{4,i}\) and eliminates pressure through the traction-free third direction in biaxial loading.
Treat axes 1 and 2 as the diaphragm's in-plane directions and axis 3 as its thickness direction. Each of the three fiber families is dispersed about its reference axis.
| Fiber family | Reference direction | \(\kappa_i\) |
|---|---|---|
| 1 | \((1,0,0)\) | 0.05 |
| 2 | \((0,1,0)\) | 0.15 |
| 3 | \((0,0,1)\) | 0.10 |
| Loading | Tags | Points per tag |
|---|---|---|
| Biaxial | 1:1, 1:0.75, 0.75:1, 1:0.5, 0.5:1 |
17 |
| Simple shear | fs, fn, sf, sn, nf, ns |
19 |
TestType,Tag,Stretch_1,Stretch_2,Stretch_3,Stress_1,Stress_2
shear,fn,0.25,,,0.4720703125,
3. Configure and run Rend¶
Configure Rend¶
Use INCOMPRESSIBLE_ANISOTROPIC_DISPERSIVE with the three supplied material axes to let the search explore aligned and dispersed contributions. Add Operator.ACTIVE_I4 with SearchConfig so candidate laws may activate a fiber term in tension. Enable GroupWeighting(balance_tags=True) to reduce the influence of differences in sample count and stress magnitude between loading branches. This helps the search account for shear curves that would otherwise contribute less to the fitting error. Use biaxial probes from 1 to 1.12 and signed shear probes from −0.45 to 0.45 with a variance-scaled target of 1e-2.
Screen reference stability and rank-one curvature, then test the stress and tangent, objectivity, covariance, reference state and domain. Leave the optional symmetry check out of this comparison and use FEM kinematics and robustness to screen directional patch behavior. Export material JSON with the fixed axes for the patch calculation.
Run the tutorial¶
Install the Rend wheel, then save fiber_composit.csv and fiber_composit.py in the same folder. You can also copy the script below into a file named fiber_composit.py. Open a terminal in that folder and run:
python fiber_composit.py
The script uses a maximum of 3,000 generations. For your first run, set max_generations=500 and live_plot=True. Open the generated result.html to compare the discovered models and their predictions for each loading direction.
Complete Python script
"""Synthetic fiber composite with biaxial and directional shear loads."""
from pathlib import Path
from rend import (
SearchPhysicsChecks,
StrongEllipticityCheck,
PostSearchChecks,
ConstitutiveChecks,
DeformationRange as Range,
FEChecks,
GroupWeighting,
MaterialProfile,
MaterialRegressor,
Operator,
SearchConfig,
StressUnit,
ValidationRanges,
)
CSV = "fiber_composit.csv"
if __name__ == "__main__":
regressor = MaterialRegressor.advanced(
search=SearchConfig(add_operators=(Operator.ACTIVE_I4,)),
csv_path=Path(__file__).with_name(CSV),
name="Synthetic fiber composite",
profile=MaterialProfile.INCOMPRESSIBLE_ANISOTROPIC_DISPERSIVE,
material_directions=((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)),
stress_unit=StressUnit.KPA,
max_generations=3000, # Use 500 for a first exploratory run.
verbose=True,
live_plot=False, # Set True to watch the search progress.
target_mse=1e-2,
validation_ranges=ValidationRanges(
uniaxial=None,
biaxial=Range(1.0, 1.12),
planar=None,
shear=Range(-0.45, 0.45),
volumetric=None,
),
search_checks=SearchPhysicsChecks(
strong_ellipticity=StrongEllipticityCheck(step=0.04),
reference_stability=True,
),
post_search_checks=PostSearchChecks(
constitutive=ConstitutiveChecks(
stress=True,
tangent=True,
objectivity=True,
stress_covariance=True,
material_symmetry=False,
reference=True,
domain=True,
max_states=40,
),
fe=FEChecks(kinematic=True, robustness=True),
),
group_weighting=GroupWeighting(balance_tags=True),
export_json=True,
export_uhyper=False,
)
result = regressor.run()
if result.error:
raise RuntimeError(result.error)
if result.cancelled:
raise SystemExit(130)
print("Report:", result.report_path)
Recorded runs¶
| Run | Generation cap | Recorded stop | Rows | Curves | Elapsed | Returned models |
|---|---|---|---|---|---|---|
| Dispersive anisotropy | 3,000 | Target at 30 | 199 | 11 | 6 min 33 s | 12 |
Elapsed time includes discovery, report generation and exports. The variance-scaled target can stop a search before its cap.
4. Compare the candidates¶
| Run | Model | Why inspect it | Complexity | Weighted MSE (kPa²) | Overall R² | Configured coverage gaps |
|---|---|---|---|---|---|---|
| Dispersive anisotropy | 1 | Lowest weighted MSE | 63 | 0.0054892 | 0.99396 | — |
| Dispersive anisotropy | 3 | Simpler candidate with an explicit dispersion coefficient | 27 | 0.0088365 | 0.989 | — |
Both models pass the enabled validation checks, cover the configured deformation ranges, and meet the overall and per-tag \(R^2\) requirements. The weakest biaxial branch for both is 0.5:1, with R² of 0.96999 for Model 1 and 0.94563 for Model 3. Its terminal synthetic stresses \((P_{11},P_{22})\) are \((1.721,1.578)\) kPa. Model 1 predicts \((1.807,1.344)\) kPa and Model 3 gives \((1.824,1.323)\) kPa. The biaxial figures show the first component. The second component has the larger terminal error in both candidates.
| Candidate | Weakest shear tags by R² | Tag R² | Peak stress error on those tags (kPa) |
|---|---|---|---|
| Dispersive anisotropy, model 1 | fn, sn |
0.95971 | 0.22374 |
| Dispersive anisotropy, model 3 | fn, sn |
0.96477 | 0.13361 |

Dispersive anisotropy, model 1.

Dispersive anisotropy, model 3.
Dispersive anisotropy: equations, branch scores and checks
| Loading or tag | Model 1 | Model 3 |
|---|---|---|
| Biaxial | 0.9931 | 0.98703 |
| Shear | 0.98579 | 0.9749 |
| 1:1 | 0.99753 | 0.99314 |
| 1:0.75 | 0.99858 | 0.99576 |
| 0.75:1 | 0.99083 | 0.97963 |
| 1:0.5 | 0.99345 | 0.99312 |
| 0.5:1 | 0.96999 | 0.94563 |
| fs | 0.99147 | 0.9851 |
| fn | 0.95971 | 0.96477 |
| sf | 0.99629 | 0.97402 |
| sn | 0.95971 | 0.96477 |
| nf | 0.99629 | 0.97402 |
| ns | 0.99147 | 0.9851 |
| Reported check | Model 1 | Model 3 |
|---|---|---|
| Sampled strong ellipticity | Passed | Passed |
| Reference tangent PSD | Passed | Passed |
| Float64 audit | Passed | Passed |
| Stress | Passed | Passed |
| Tangent | Passed | Passed |
| Frame indifference | Passed | Passed |
| Stress covariance | Passed | Passed |
| Material symmetry | Not run | Not run |
| Reference state | Passed | Passed |
| Energy domain | Passed | Passed |
| FEM kinematics | Passed | Passed |
| FEM robustness | Passed | Passed |
| Affine patch benchmark | Not run | Not run |
| Free-DOF convergence | Not run | Not run |
| Sampled common interval | Model 1 | Model 3 |
|---|---|---|
| Uniaxial | λ 0.005018352119–1.793673849 | λ 0.005018352119–10000 |
| Biaxial | λ 0.7488244766–2.081701001 | λ 0.005018352119–14.05855946 |
| Planar | λ 0.4809039183–199.2092312 | λ 0.005018352119–199.2092312 |
| Shear | γ -198.8716556–198.8716556 | γ -198.8716556–198.8716556 |
Write \(I_{n,i}=I_n(C,a_i)\). For the unit axes, \(I_8(C,a_i,a_i)=I_{4,i}\) and \(I_{80}=1\).
Model 1: model_001.json
Original report equation
Model 3: model_003.json
Original report equation
5. Apply the result and check its limits¶
Start the directional patch check with Model 1 for the lowest weighted MSE. Model 3 provides a smaller law for comparison. On fn and sn, its peak stress error is 0.134 kPa versus 0.224 kPa for Model 1.
In biaxial loading, let \(d_i=I_{4,i}-1\) and \(S=I_1-3\). The generator uses \(I_{4,i}^*-1=(1-3\kappa_i)d_i+\kappa_i S\). Near the incompressible reference state, \(S\) is second order in the \(d_i\), so the leading fiber terms are proportional to \((1-3\kappa_i)^2d_i^2\). Model 1 can approximate that stiffness because its aligned products are \(2d_i^2+d_i^3\) on these paths and its matrix term satisfies \(\bar I_2-3=S-d_1d_2d_3\). The resulting biaxial \(R^2\) of 0.99310 helps explain the pooled score of 0.99396.
Simple shear reveals a difference in the laws. On fn at \(\gamma=0.45\), Model 1 gives 1.162 kPa against 0.939 kPa in the CSV. Model 3 fits a single \(\kappa=0.099209\) on axis 1, whose generating value is 0.05. Use the fitted laws for stress comparison within the sampled paths. To estimate all three dispersions, fit an explicit three-family law using additional off-axis and mixed loading paths, then check parameter sensitivity and hold back paths for validation.
- Load a candidate's material JSON with the stored orthogonal axes. Reconstruct the two in-plane stretches, set the third by incompressibility and impose a traction-free thickness face in the biaxial comparison.
- Check both shear signs in the rim's material frame. On
fnat \(\gamma=0.25\), Models 1 and 3 predict \(P_{13}\) of 0.542 and 0.587 kPa against 0.472 kPa in the CSV. - Use a single-element directional patch before the diaphragm model, then verify the rim constraints and local deformation paths in the geometry.