Sensitivity analysis
Forward- and adjoint-mode local sensitivities. These are extension stubs: concrete methods attach when SciMLSensitivity (and Zygote) are loaded — see Extensions. The User Guide's sensitivity chapter covers the p_inject pattern and worked examples; the Technical Reference's sensitivity theory chapter covers the underlying formulations.
Pyrolysis.forward_sensitivity — Function
forward_sensitivity(base_problem, θ, p_inject; output_fn = sol -> sol,
solve_kwargs...) -> (output, ∂output_∂θ)Compute the local forward sensitivity ∂output/∂θ at the parameter point θ for base_problem. p_inject(base_problem, θ) -> problem' materialises the perturbed problem; output_fn(sol) -> y reduces a solution to the quantity of interest.
Backed by SciMLSensitivity.ForwardDiffSensitivity — load SciMLSensitivity to enable.
Pyrolysis.adjoint_sensitivity — Function
adjoint_sensitivity(base_problem, θ, p_inject, loss_fn;
solve_kwargs...) -> (loss, ∂loss_∂θ)Compute the adjoint gradient ∂loss/∂θ at the parameter point θ for base_problem. p_inject(base_problem, θ) materialises the perturbed problem; loss_fn(sol) -> ℝ reduces a solution to a scalar loss.
Backed by SciMLSensitivity adjoint methods. Pass a sensealg through solve_kwargs... when you need a specific reverse-mode algorithm. Load SciMLSensitivity to enable.
Pyrolysis.verify_mixing_derivatives — Function
verify_mixing_derivatives(material; rtol = 1e-8, atol = 1e-10) -> NamedTupleFor each mixing rule (PARALLEL, SERIES, WEIGHTED, BRUGGEMAN where applicable) on the supplied material, derive the analytical ∂keff/∂ξ and ∂keff/∂T symbolically via Symbolics.jl and compare against the package's AD path. Returns a NamedTuple of (rule_name => max_relative_error). Test code asserts each entry satisfies ≤ rtol.
Backed by Symbolics.jl — load Symbolics to enable.