Skip to content

Conversation

@wavefrontshaping
Copy link
Owner

Fixed (try to) duplicate modes and missing modes for large MMFs

Problem identified:

It found beta values outside the range where the cost function changed sign(!)
This was due not resetting the value of r_max where we estimate the field far away that should converge to zero.
r_max was lowered for low order modes, that have a small size and for which the far field value estimation was not numerically stable.
As r_max was not put back to the original (higher) value. for high order modes, there was still some oscillations, so the sign was not the same as the first estimation.

Solution:

  • Rename the initial r_max value to r_max0
  • In the loop over the m values, add r_max = r_max0

@wavefrontshaping wavefrontshaping merged commit f9cf46a into master Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants