Comments (5)
ah I found that this is all fine when calculating the matrix. When you calculate the propagation forward and than backwards you have to inverse the matrix.
from rezonator2.
Another question pop out for the definition of forward and backward.
In the ABCD formalism you calculate the forward propagation matrix by starting the matrix multiplications from the last element. That is in rezonator the other way round. What's the reason?
from rezonator2.
That is in rezonator the other way round. What's the reason?
'Forward' in 'backward' are not about 'beam propagation' in these commands. They just say 'multiply from the first to last selected' (forward), and 'multiply from the last to first selected' (backward). That's all, sorry for the confusion. I think it's worth renaming them to something more clean. They are rather debug command used to compare multiplication result with what the test Python code gives.
I found that this is all fine when calculating the matrix
Yes, rezonator doesn't do analytical inversion, it just multiplies matrices one-by-one following the light path. The below test code shows that the multiplication is correct. We can see that back propagation matrix is not exactly an inverted forward one:
import numpy as np
from numpy.linalg import inv
M_L1_t = np.matrix([[1, 0.1], [0, 1]])
M_M1_t = np.matrix([[1, 0], [-20, 1]])
M_L2_t = np.matrix([[1, 0.05], [0, 1]])
M_M2_t = np.matrix([[1, 0], [-13.33333333333333, 1]])
M0_t = M_L1_t * M_M1_t * M_L2_t * M_M2_t
M0_t_1 = M_M2_t * M_L2_t * M_M1_t * M_L1_t
M0_t_inv = inv(M0_t)
print('M0_t\n', M0_t, '\n')
print('M0_t_1\n', M0_t_1, '\n')
print('M0_t_inv\n', M0_t_inv, '\n')
M0_t
[[ -1.66666667 0.05 ]
[-20. 0. ]]
M0_t_1
[[ 0. 0.05 ]
[-20. -1.66666667]]
M0_t_inv
[[ 0. -0.05 ]
[20. -1.66666667]]
from rezonator2.
Yes, it renaming would help to make it clear ;-)
from rezonator2.
from rezonator2.
Related Issues (20)
- Brewster surface HOT 3
- Restore Special Points feature HOT 2
- Display issues on high resolution displays. HOT 3
- Typos in some texts HOT 1
- Export of all caustic data HOT 7
- Wrong RTM calculation HOT 6
- Negative Thermal Lens Instability HOT 1
- Simulating cavity with incoupling optics HOT 8
- Copy graph data for sagittal and tangential planes simultaneously HOT 3
- Gaussian apertures don't seem to work in RR or SW modes HOT 2
- filename incorrectly displayed in window title bar HOT 1
- GRIN Calculator does not solve correctly in Linux build HOT 1
- Add plot legend HOT 1
- Resonator mirror assuming vacuum environment? HOT 2
- Feature request: Add z0, d0, M² to "Beam Parameters at Elements" HOT 3
- Beam size exhibits discontinuous jump at "tilted plane-parallel slab" boundaries HOT 6
- GRIN/Thermo element calculated wrong in SP resonators HOT 1
- Show smallest waist and its position in "Beam Data" HOT 4
- Help viewer doesn't show manual on some hosts. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rezonator2.