Derivative Workflows

Use solver derivatives to study how result data changes when a value in a JCMsuite project changes. First declare the derivative parameters in the project, then run solve and select the result data that contains the derivatives.

Choose A Workflow

  • Set up derivatives when you need to declare DerivativeParameter blocks, or enable derivative order.

  • Export derivative data when you need dictionaries, pandas DataFrames, or xarray data for tabular and field-export results.

  • Use Torch Integration when a solver result must participate in a PyTorch objective and receive autograd gradients.

Workflow Steps

  1. Declare each solver derivative parameter in the input files. A derivative output name can differ from the project keys used to fill a template.

  2. Set the derivative order in the project file and call solve with the required project keys.

  3. Select derivative data through result.postprocesses.

  4. Export ordinary derivative data with to_dict(), to_df(), or to_xarray().

  5. Alternatively, pass gradient-enabled Torch tensors to jcmsuite.torch.solve with explicit derivative bindings.

Tutorials

Run the Derivative Tutorials for complete Torch autograd, export, gradient-check, and binding-validation examples.

Workflow Pages