fullseye

optimize_lens — OPTICS optimization op

使い方

Damped-least-squares (Levenberg–Marquardt) optimisation of a prescription (table).

variables: surface parameters to move — strings "R<i>"/"c<i>" (curvature; a radius may pass through flat), "t<i>" (thickness), "k<i>" (conic), "A4_<i>", "A6_<i>" … (even aspheric coefficients). Default: every finite radius. efl_target: hold the effective focal length (default: the starting EFL, so a design does not “improve” by getting longer); pass 0 / False to leave it free. Fields / wavelengths / rings / weights as in :func:merit_function.

Each iteration builds the Jacobian by forward differences, solves (JᵀJ + λ diag(JᵀJ)) δ = −Jᵀr and accepts the step only if the merit falls (then λ /= 3; otherwise λ ×= 4 and retried, up to 6 times); a step that yields an invalid prescription counts as a failure. Stops when the relative merit change is below tolerance twice in a row (converged, status="converged"), when two iterations in a row accept no step or λ blows past 1e8 (status="stalled", converged=False), or after iterations (status="iterations"). Thickness is clamped to [min_thickness, max_thickness] and |R| >= min_radius — the start included, so the returned system always obeys the bounds.

Returns {"system": optimised prescription, "merit_initial", "merit_final", "rms_initial", "rms_final", "efl_initial", "efl_final", "history": [merit per accepted iteration], "iterations", "converged", "variables": [{"name", "surface", "initial", "final"}], "rays_lost"}.

ファミリ共通の入力契約(fail-closed)

optics の全 op は入力を検証してから計算する(黙って通さない):

詳しい使い方ガイド

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(table を入力に取れる)

abcd_matrix · wavefront_stats · paraxial_trace · seidel_coefficients · spot_stats · tolerance_analysis · wavefront_from_opd · spot_diagram

同カテゴリ(optimization)

merit_function · bend_singlet


Provenance: lensopt.py — OPTICS operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.