|
387 | 387 | "\n", |
388 | 388 | "During an inverse solve, a minimisation problem involving the responses, changes in coil currents, and constraints, is repeatedly solved:\n", |
389 | 389 | "\n", |
390 | | - "$$ \\min_{x} \\| A\\vec{x} - \\vec{b}\\|^2 + \\| \\gamma \\vec{x} \\|^2, $$\n", |
| 390 | + "$$ \\min_{x} \\| A\\vec{x} - \\vec{b}\\|^2 + \\vec{x}^{T} \\Gamma \\vec{x}, $$\n", |
391 | 391 | "\n", |
392 | 392 | "where\n", |
393 | 393 | "- $A$ is the fixed response matrix (that determines how a change in coil currents $x$, affects constraint values). \n", |
394 | 394 | "- $\\vec{x} = \\Delta \\vec{I}^c$ is the step change in active coil currents required to match the constraints. \n", |
395 | 395 | "- $\\vec{b}$ is the vector of constraint values being enforced. \n", |
396 | | - "- $\\gamma > 0$ is the regularisation parameter/vector.\n", |
| 396 | + "- $\\Gamma$ is the non-negative diagonal regularisation matrix: a scalar `l2_reg` gives $\\Gamma = \\mathtt{l2\\_reg} I$, while a vector supplies its diagonal entries.\n", |
397 | 397 | "\n", |
398 | | - "We solve for $\\vec{x}$ using a gradient-based optimiser. \n", |
| 398 | + "Without inequality constraints, FreeGSNKE solves the equivalent augmented system\n", |
| 399 | + "\n", |
| 400 | + "$$ \\min_x \\left\\| \\begin{bmatrix} A \\\\ \\Gamma^{1/2} \\end{bmatrix} \\vec{x} - \\begin{bmatrix} \\vec{b} \\\\ 0 \\end{bmatrix} \\right\\|^2, $$\n", |
| 401 | + "\n", |
| 402 | + "using a direct least-squares solve. This avoids forming the normal equations $(A^T A + \\Gamma)\\vec{x} = A^T\\vec{b}$. When coil-current or normalised-flux limits are active, the same regularised objective is handled by the constrained quadratic optimiser instead.\n", |
399 | 403 | "\n", |
400 | 404 | "[Song et al. (2024)](https://www.mdpi.com/2571-6182/7/4/45) provide a nice overview of the inverse problem.\n", |
401 | 405 | "\n", |
402 | | - "The coil limits are handled in a slightly different manner because they are box constraints that cannot be encoded in the minimisation problem. Instead, FreeGSNKE adds additional constraints to the solver that bound the solution $\\Delta \\vec{I}^c$. These bounds have a tolerance (slack) which allows the coils to violate their limits, but penalises violations; this allows the coil limits to be violated 'on the path' to a solution that respects the prescribed limits.\n" |
| 406 | + "The coil limits are handled in a slightly different manner because they are box constraints that cannot be represented by the unconstrained augmented least-squares system. Instead, FreeGSNKE adds constraints to the quadratic optimiser that bound the solution $\\Delta \\vec{I}^c$. These bounds have a tolerance (slack) which allows the coils to violate their limits, but penalises violations; this allows the coil limits to be violated 'on the path' to a solution that respects the prescribed limits.\n" |
403 | 407 | ] |
404 | 408 | }, |
405 | 409 | { |
|
414 | 418 | "\n", |
415 | 419 | "The `verbose=True` option will provide an indication of the progression of the solve. \n", |
416 | 420 | "\n", |
417 | | - "The `l2_reg` parameter defines the Tikhonov regularisation (i.e. $\\gamma$ in the cell above) used by the optimiser. This can be set as a scalar or as a vector (equal to the number of coil currents being solved for). Larger values force coil currents to stay closer to their original values while lower values will encourage more freedom. This can be useful in particular for vertical control coils (e.g. the P6 coil in MAST-U), in which we don't want the coil current to \"jump around\" during optimisation and cause vertical instability issues. \n", |
| 421 | + "The `l2_reg` parameter defines the diagonal of the Tikhonov regularisation matrix $\\Gamma$ in the cell above. It can be set as a scalar or as a vector (equal to the number of coil currents being solved for). Larger values force coil currents to stay closer to their original values while lower values encourage more freedom. This can be useful in particular for vertical control coils (e.g. the P6 coil in MAST-U), in which we don't want the coil current to \"jump around\" during optimisation and cause vertical instability issues. \n", |
418 | 422 | "\n", |
419 | 423 | "\n", |
420 | 424 | "The solver steps are (roughly):\n", |
|
0 commit comments