Configuration and weighting¶
After the quick start, use this guide to choose a material profile, set the validation ranges and decide which optional checks to run. stress_unit labels the stress values supplied in the CSV. Rend uses the values as supplied.
Rend provides detailed configuration options to accommodate a wide range of materials and applications. If you prefer a graphical user interface or a simpler, application-specific API, you can use the workflow integration skill with a coding agent to build an interface tailored to your needs.
Material profile and reference directions¶
MaterialProfile |
Deformation assumption | material_directions |
Typical example |
|---|---|---|---|
INCOMPRESSIBLE_ISOTROPIC |
\(J=1\), isotropic | Empty () |
Treloar rubber |
INCOMPRESSIBLE_ANISOTROPIC |
\(J=1\), fiber-invariant anisotropy | One to three unit fiber axes | Reinforced membrane |
INCOMPRESSIBLE_ANISOTROPIC_DISPERSIVE |
\(J=1\), dispersed fibers | One to three unit fiber axes | Fiber composite |
COMPRESSIBLE_ISOTROPIC |
\(J>0\), isotropic | Empty () |
Foam |
COMPRESSIBLE_CUBIC |
\(J>0\), cubic symmetry | Exactly three orthonormal lattice axes, not fibers | BCC lattice |
Supply 3D reference directions in the same material coordinates as the deformation measurements. Tags group curves. For fiber profiles, the unit-vector norm tolerance is 0.01. Cubic profiles require an orthonormal frame within 1e-6 for the 24 proper symmetry rotations. Isotropic profiles use an empty tuple. See operator presets and validation for the corresponding invariants and symmetry checks.
material_directions = ((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0))
# For COMPRESSIBLE_CUBIC these represent lattice axes.
Search configuration¶
All MaterialRegressor arguments are keyword-only. The following are required:
| Argument | Meaning | Selection guidance |
|---|---|---|
csv_path |
Path to experimental CSV | One file per run, multiple loading modes/tags can share one file. |
profile |
Symmetry and compressibility | Select from the five profiles above. |
max_generations |
Evolutionary search budget | A higher limit gives the search more opportunities to discover better models, but does not guarantee convergence. The search may stop earlier if the target MSE is reached. |
target_mse |
Variance-scaled, weighted full-data early-stop criterion | Set a dimensionless tolerance, such as 1e-3. The scaling uses the unweighted variance of Rust's nominal stress targets. Fit metrics. |
validation_ranges |
Sampled deformation/load intervals | Choose physical screening intervals relevant to the intended use. |
stress_unit |
PA, KPA or MPA |
Labels the measured values, no automatic rescaling. |
validation_ranges sets the loading families and intervals used for Rust screening, optional constitutive checks and selection of optional FEM load cases. Use None to skip probes for a loading family while keeping its measurements in the fit. Reference-state checks remain active. The automatic applicability scan probes fixed windows and reports coverage of the original configured intervals. See the validation pipeline.
ValidationRanges(uniaxial=DeformationRange(...), biaxial=None, planar=None, shear=None, volumetric=None) requires the four main fields. volumetric is permitted only for compressible materials. The Rust volumetric interval is specified in principal stretch, while the automatic applicability scan presents volume as \(J\). These are different conventions.
Optional checks¶
| Parameter | Default | Execution phase | Effect |
|---|---|---|---|
search_checks |
None |
Rust, during search and final acceptance | Optional SearchPhysicsChecks (rank-one curvature and reference tangent PSD). StrongEllipticityCheck(step=0.04) accepts steps in [0.005, 0.15]. This is not a deformation interval. |
post_search_checks |
None |
Python, after Rust finishes | Optional independent ConstitutiveChecks and FEChecks. Disabling either does not disable the mandatory float64 audit or applicability scan. |
For example, add search_checks=SearchPhysicsChecks(reference_stability=True) to screen for a positive semidefinite reference tangent during search. Add post_search_checks=PostSearchChecks(fe=FEChecks()) to request FEM kinematic and robustness checks after search. The API reference lists the available switches.
Weighting¶
No curve-end or grouping weights are applied by default (edge_weighting=None, group_weighting=None). To opt in to endpoint emphasis:
from rend import EdgeWeighting
edge_weighting = EdgeWeighting(
head_fraction=0.05,
head_multiplier=5.0,
tail_fraction=0.05,
tail_multiplier=5.0,
)
The first and last fractions apply within each (TestType, Tag) curve in CSV order. Overlapping weights multiply. Use edge_weighting=None for unity endpoint weights.
Use GroupWeighting(mode_weights={"planar": 2.0}) to double the weight of planar rows. Use GroupWeighting(tag_weights={("shear", "fs"): 0.5}) to halve the weight of one curve, or use a plain tag key to apply the weight across modes. Alternatively, GroupWeighting(balance_tags=True) weights groups inversely to sample count times squared stress span, with a span floor. Choose either balancing or explicit mode and tag weights.
Endpoint and group weights multiply. The fitting objective and clear_mse use those weights for each Rust target. The HTML R² uses the supplied nominal stress or pressure observations without weights. See fit metrics.
Optional advanced search¶
Use MaterialRegressor.advanced(search=SearchConfig(...), **normal_constructor_arguments) when default search settings are insufficient. The ordinary constructor deliberately keeps search internals optional.
SearchConfig field |
Default | Explanation |
|---|---|---|
parsimony_penalty |
5e-6 |
Penalty for complex symbolic trees, scaled internally by stress variance. |
island_size |
1000 |
Individuals per evolutionary island. |
num_islands |
16 |
Number of island tasks (not a fixed OS thread count). |
max_tree_size |
64 |
Maximum symbolic tree complexity. |
mutation_max_depth |
6 |
Limit on mutation subtree depth. |
stagnation_threshold |
200 |
Stagnation before strategy diversification, followed later by a complete island reset. |
tournament_size |
3 |
Tournament competitors for selection. |
opt_iterations |
24 |
Per-event L-BFGS optimization iterations during evolution. |
opt_prob |
0.05 |
Probability of invoking L-BFGS during evolution. |
subset_size |
256 |
Working subset for fitting (None means full data). |
mini_batch_size |
32 |
Evaluation mini-batch. |
add_operators |
() |
Additional typed Operator instructions. |
exclude_operators |
() |
Operators to remove (exclusion takes precedence). |
Use multiples of 16 for mini_batch_size and any explicit subset_size. The defaults are 32 and 256. Start with the profile presets and add operators when the application calls for them. See operator definitions and the foam example.
Optional execution and output settings¶
verbose=True adds a console update every 25 generations. Info, warnings and errors appear with either setting. Set live_plot=True to observe the search progress while Rend is running. This is particularly useful when exploring a new dataset or testing search settings. name sets the result-directory label and defaults to "unnamed". Enable export_json=True for material JSON, or choose an Abaqus or CalculiX export.
How to select settings¶
- Exploration: keep the search budget modest and optional checks disabled (see the soft elastomer).
- Research comparison: record selected
validation_ranges, check statuses and unweighted global/per-tag R² alongside weighted MSE. - Solver prequalification: enable application-specific
SearchPhysicsChecks, independentConstitutiveChecks, relevantFEChecks, and confirm generated source in the actual solver (Treloar).