Commit 9905960
Fixed spurious "Max iterations exceeded" errors in the stop root-finding problem
The Newton solve in `_calc_rayfunction_stops_only` used the default
perturbation of `na.jacobian`, an absolute 1e-10 in the units of the
variable, which is below the floating-point noise floor of the raytrace
for variables measured in physical units, yielding a Jacobian made of
noise and wild iterates. The default convergence tolerance of
`na.optimize.root_newton` (1e-10 in the units of the residual) had the
same scale-dependence problem: solves whose residuals had converged to
machine precision were reported as "Max iterations exceeded". Both are
now proportional to the size of the target aperture wire.
Failures that remain are re-raised with the names of the stop surfaces
involved and a hint about marking the object surface as the field stop
for dispersive systems, instead of an anonymous "Max iterations
exceeded" from deep inside named_arrays.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 9d38b2c commit 9905960
1 file changed
Lines changed: 60 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
319 | 332 | | |
320 | 333 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
335 | 342 | | |
336 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
337 | 383 | | |
338 | 384 | | |
339 | 385 | | |
| |||
0 commit comments