# Inspect Second-Order Solver Derivatives Use one ordinary solve to select first, diagonal second, and mixed derivatives. This example does not use Torch. Each tutorial folder contains its own project and support files. You can copy the folder and run it separately. The scripts use `"project.jcmp"`; `jcmsuite` resolves this path relative to the script, not the shell's current directory. ## Run The Example You need an installed `jcmsuite` package, NumPy, pandas, and a configured JCMsuite runtime with a solver license. From the repository root, run: ```bash python demos/documentation_tutorials/derivatives/setup_and_export/second_order/run.py ``` The script prints Fourier derivatives, Fourier quantity names, and a scattering table. The substrate permittivity is `2.0 + 0.2j`, and the line permittivity is `1.4`. The numbers illustrate the workflow; they are not accuracy assertions. ```{literalinclude} ../../../demos/documentation_tutorials/derivatives/setup_and_export/second_order/run.py :language: python ``` ## What To Notice - `Order = 2` requests second-order solver data. - {attr}`.derivatives[first].derivatives[second] ` selects a numeric postprocess parameter pair. Ordinary views use the solver parameter names declared in `materials.jcmt`. Missing pairs are not replaced by zeros. The geometry is fixed. The derivative directions change the real and imaginary parts of the substrate permittivity and the line permittivity. The small mesh and export grid keep the demonstration quick; they are not a convergence study. To compute second derivatives of a Torch objective, continue with the [Torch numeric postprocess tutorial](torch/second_order_postprocess.md). ## Project Files
project.jcmp ```{literalinclude} ../../../demos/documentation_tutorials/derivatives/setup_and_export/second_order/project.jcmp :language: jcm ```
materials.jcmt ```{literalinclude} ../../../demos/documentation_tutorials/derivatives/setup_and_export/second_order/materials.jcmt :language: jcm ```
layout.jcm ```{literalinclude} ../../../demos/documentation_tutorials/derivatives/setup_and_export/second_order/layout.jcm :language: jcm ```
sources.jcm ```{literalinclude} ../../../demos/documentation_tutorials/derivatives/setup_and_export/second_order/sources.jcm :language: jcm ```