Tutorials

End-to-end walkthroughs of NEML2, grouped by what you’re trying to do: run and compose existing models, extend NEML2 with a model of your own, or calibrate model parameters against data.

Introduction

NEML2 ships a large collection of material models that can be used on their own or composed into more complex ones. The wiring lives entirely in a text-based input file, so you don’t need to write Python or C++ glue to put models together. These tutorials walk through the everyday workflow of loading, evaluating, and composing existing models.

Extension

When the built-in library doesn’t cover what you need, you can add your own model as a small Python class deriving from Model, plug it into an input file like any registered type, and optionally compile it. These tutorials build one such model from scratch on a single running example.

Parameter calibration

The earlier tutorials evaluate a model — given parameters and inputs, compute outputs. Calibration is the inverse: given input/output observations, find the parameters that best fit them. These tutorials cover gradient-based calibration through PyTorch autograd, plus the pyzag adapter for recurrent (time-stepped) calibration.