Open mikessut opened 3 years ago
Dear mikessut,
I'm afraid I can't help out much, the original code is basically as old as I am. However, during the porting to pure Python last year I also tried to understand what is going on, I hope my findings might point you in the right direction. (I will try to find my notes this week, remind me if I forget).
k
th value in the other direction) and then repeating along Y (not shown as formula, here indices would be swapped, cf. explanation below formula). Otherwise the j
-variation could not be collected away in factor f_i
in eq. (10), making the differential equation harder/impossible to solve with the double sweep elimination method used.f_i
in eq. (13), I believe there sould be no extra 2 in eq. (9).A
. I reconstructed it back from the actual code, I'll have to check my notes. I found a hint of what it should look like in an optics script in Google, keyword were something like "slowly varying envelope approximation" and "inhomogeneous media":
https://www.iap.uni-jena.de/iapmedia/de/Lecture/Fundamentals+of+Modern+Optics1427752800/FoMO14_Script_2015_02_14s.pdf
page 77
However this is not what is calculated in the current LightPipes code, Fred could also not remember what the implemented approximations were exactly.Regarding point 1., one may be able to do it better nowadays with more computing power. Especially since the double sweep implemented in pure Python is slower than the original Cpp version, I tried to find an alternative approach. A true 2D-5-point method could work better, I found an example on scipy-cookbooks: https://scipy-cookbook.readthedocs.io/items/discrete_bvp.html However my first attempt failed miserably, which is why until now the code does exactly what has been used successfully in the past >20 years.
Do remind me if I forget to look for my notes. Hope this helps, Lenny
I'm trying to understand finite different propagation and am looking at the documentation here: https://opticspy.github.io/lightpipes/manual.html#free-space-propagation
I'm confused by a couple of things in equation 9.
Any chance there is a reference you could point towards for eqn. 8. Wikipedia is a good reference for Helmholtz equation in general, but I can't follow where the A*U term comes from.