Chenfan Electric
EN
Send drawing

ARTICLETechnical article

Adjoint Core-Model Gradients: Verify the Derivative Before Optimizing

  • Chenfan Power

Verify the gradient against the same objective and discrete state problem the optimizer will use. Missing parameter dependence or a nonsmooth model change can send optimization in the wrong direction despite a converged magnetic field solution.

Calculation basis. Unless a value is explicitly attributed to a cited source, numerical inputs in the demonstrations are assumptions for the stated model. Normalized variables are dimensionless. The examples define their own geometry, excitation and measurement boundary.

Before using an adjoint derivative to adjust a core model, compare it with fresh perturbed solutions and a Taylor remainder sequence. The useful question is whether the derivative matches the declared discrete problem at the declared state.

Freeze the objective and admissible directions

Write the objective as J(u,p), with state u determined by a residual R(u,p) = 0. Specify whether J represents integrated loss, a regional flux measure, a penalty or a combination of normalized terms. Include explicit parameter terms as well as changes transmitted through the state.

Define the admissible design set. At a lower dimension bound, an outward perturbation may be infeasible; at a fixed-volume constraint, independently changing every dimension may violate the intended problem. Test admissible directions and verify constraint derivatives separately.

Record physical units and parameter scaling. A derivative with respect to a normalized dimension is not numerically interchangeable with a derivative per millimeter. The directional objective change must use the same coordinate scaling and inner product as the reported gradient.

Keep the adjoint sign convention explicit

For a smooth finite-dimensional residual with an invertible state Jacobian, use the original convention L = J − lambdaᵀR. The adjoint equation and reduced derivative are:

R_uᵀ lambda = J_u; g = J_p − lambdaᵀ R_p

Different Lagrangian signs produce different adjoint signs, while the final physical derivative should agree. This formula describes a local differentiable branch. It does not establish differentiability through contact activation, a topology change or an arbitrary hysteresis-state reset.

For transient or history-dependent models, the state includes the history needed by the actual solver. Differentiating only a final constitutive curve can omit dependencies that affect the objective. The scalar example below deliberately has no history.

Use more than one perturbation size

For a direction d, compare g·d with a central difference of the reduced objective, obtained by separately solving the state problem at p ± h d. A central difference is appropriate only when both states remain feasible and within the same differentiable regime.

Also calculate the derivative-corrected remainder:

E₂(h) = |J_hat(p + h d) − J_hat(p) − h g·d|

Test the derivative-corrected Taylor remainder over a sequence of admissible perturbations. In a smooth regime, halving h should approximately quarter its second-order remainder; record where roundoff or incomplete state convergence interrupts that trend.

Large h samples nonlinear curvature. Very small h can expose subtraction error and incomplete state convergence instead of improving the derivative comparison. Seek a credible convergence interval, then show where the sequence ceases to support the expected order. There is no universal step size or number of matching digits.

Recompute an assumed nonlinear state

Use an original dimensionless surrogate, R = u + u³ − p = 0, with J = (u − 0.5)²/2 + 0.1p². Restrict p to [1,3] and use baseline p = 2, which gives u = 1. This is a smooth algebraic illustration, not a transformer field solution or material law.

At the baseline, R_u = 4, R_p = −1, J_u = 0.5 and J_p = 0.4. The adjoint is lambda = 0.125, giving g = 0.4 − 0.125(−1) = 0.525. Direct differentiation gives du/dp = 1/4 and the same reduced derivative.

Fresh state solves at each perturbed p produce the following independently calculated results. The direction is d = 1; E₂ uses the positive perturbation. All values are dimensionless.

hCentral differenceCorrected Taylor remainder
0.1000.5249510741.07346 × 10⁻³
0.0500.5249877872.68935 × 10⁻⁴
0.0250.5249969486.73074 × 10⁻⁵
0.01250.5249992371.68362 × 10⁻⁵
Original adjoint contribution diagram and dimensionless gradient table approaching 0.525, with an absolute-value kink showing why a zero symmetric difference is insufficient.
Original dimensionless adjoint audit with explicit and state-mediated contributions, an independently recomputed perturbation ledger and a separate nondifferentiable counterexample. The entries are analytical checks, not magnetic simulation or measured core data.

The central differences approach 0.525 and the corrected remainder falls by approximately four per halving. Omitting the explicit J_p term would report 0.125; no reduction of the perturbation size can repair that missing contribution.

This sequence verifies the assumed algebraic derivative. It is not evidence that a nonlinear magnetic solver, mesh deformation or adjoint implementation has passed an equivalent test.

Expose a nonsmooth false reassurance

Consider the separate counterexample K(p) = |p − 2| at p = 2. Every symmetric central difference is zero, but the right derivative is +1 and the left derivative is −1. There is no unique ordinary derivative at the baseline.

With a proposed gradient of zero, the corrected Taylor remainder is |h|, so halving h halves the remainder instead of quartering it. A symmetric difference alone can therefore hide a kink.

In a core model, inspect whether the perturbation activates contact, changes an intersection region, crosses a piecewise material slope or switches a maximum between locations. A point maximum can be nonsmooth even when the underlying field varies smoothly. Verify the objective actually used; introducing a smoother objective changes the optimization problem and should be recorded.

Diagnose failures against the same discrete model

Keep the baseline mesh, material interpolation, boundary definitions and convergence controls identifiable. If perturbations trigger unrelated remeshing or a different state initialization, the finite difference may compare different numerical problems.

That does not justify suppressing geometry dependence. A shape derivative must include the intended geometry variation, including source and objective domains. The check should reproduce that variation while controlling unrelated numerical changes.

Test individual and mixed admissible directions, and report the supported smooth regime for each. Release the gradient with its objective definition, perturbation interval, convergence evidence and unresolved branches before using the optimization result for a core decision.

Verify a dimensional derivative before shape optimization

Use catalog density 7,650 kg/m³ and M-3X specific loss 0.998694 W/kg at 1.7 T and 50 Hz. [1] Assume a uniform steel path with fixed net area A = 0.0100 m² and variable length l. The deliberately simple material-loss objective is P(l) = ρAlp. Thus dP/dl = 76.400095 W/m. Increasing l from 1.00 to 1.01 m adds 0.764001 W. An adjoint routine that reports a derivative per millimetre must return 0.076400095 W/mm. This dimensional benchmark checks scaling and explicit mass dependence before any nonlinear field derivative is accepted.

Maintain cut dimensions, steel area, rolling-direction axes and the geometry-to-mass mapping. When a manufacturing constraint changes sheet width, joint area or layer count, include that dependence in the objective and the admissible shape perturbation. IEC 60404-8-7 provides the delivery-specification framework for fully processed grain-oriented steel. [2]

References

[1] Cleveland-Cliffs, Grain-Oriented Electrical Steels — LITE CARLITE and Mill-Anneal, October 2023, Tables 1 and 5; Stress-Relief Annealing.

[2] IEC, IEC 60404-8-7:2020, Magnetic materials — Part 8-7: Specifications for individual materials — Cold-rolled grain-oriented electrical steel strip and sheet delivered in the fully-processed state.

Chenfan Electric

Direct coordination

Start a conversation.

A drawing, a material requirement, or a project to discuss.

Send drawing