Comments (5)
@oscarxblanco shift_elem is a pure translation of the whole element, for a curved magnet the direction perpendicular to the center of the magnet in which case I believe rotations do not apply.
For this point, it seems that only the help shall be improved. Do you agree?
Concerning the effect of the bending angle, could you please develop? It is not clear to me what you mean by this.
Thanks!
from at.
Hi @swhite2401 ,
now I realized that shift_elem only implements transverse shifts, so, you are right, for transverse shifts rotations do not apply.
Is there any other function to do longitudinal shifts ?
Wrt to the horizontal shift of a bending, it does produce an effect on T1,T2 and R1,R2 that is not symmetric, and depends on the chosen convention for the shift. For example, if you apply at the center of the bending magnet a shift of let's say 1 mm, the entrance and exit faces of the magnet will be shifted but not exactly 1 mm, and the rotation R1 and R2 are not the identity.
If you instead choose to apply a 1 mm shift to the bending magnet at the entrance, T1 will reflect the shift and R1 will be the identity, but R2 and T2 will not due to the reference system rotation.
from at.
Here is a numerical example of a 1 mm shift of a 90 degrees bending magnet applied at the center. The angle is quite large and unusual for most applications of pyat but it allows to see values that could be recognized by eye.
First the source in matlab using Simulated Commissioning https://github.com/ThorstenHellert/SC
dx = 1e-3;
dy = 0;
dz = 0; % opposite sign to the sixth particle coordinate
atilt = 0.0;
apitch = 0.0;
ayaw = 0.0;
ax = apitch;
ay = ayaw;
az = atilt;
magTheta = 2*pi/4;
magLength = 0.8;
%[T1,T2,R1,R2] = SCgetTransformation(dx,dy,dz,ax,ay,az,magTheta,magLength,'refPoint','entrance');
[T1,T2,R1,R2] = SCgetTransformation(dx,dy,dz,ax,ay,az,magTheta,magLength,'refPoint','center');
T1andT2fromSC=[T1';T2']
R1, R2
and here is the output
T1andT2fromSC =
1.0e-03 *
-0.7071 0 0 0 0 0.7071
0.7071 0 0 0 0 0.7071
R1 =
1.0000 0.0007 0 0 0 0
0 1.0000 0 0 0 0
0 0 1.0000 0.0007 0 0
0 0 0 1.0000 0 0
0 0 0 0 1.0000 0
0 0 0 0 0 1.0000
R2 =
1.0000 0.0007 0 0 0 0
0 1.0000 0 0 0 0
0 0 1.0000 0.0007 0 0
0 0 0 1.0000 0 0
0 0 0 0 1.0000 0
0 0 0 0 0 1.0000
from at.
Ok now I understand what you mean, would you like that changes are implemented or can we consider this a negligible effect and just document it in the help?
Concerning the longitudinal shift, there is nothing implemented and this can be quite tedious as you change the structure of your ring, for bending magnet in particular this will change the reference particle and lattice layout...
Is this something needed for your studies?
from at.
The error in T1 and T2 produced when ignoring the bending angle needs to be fixed because it is a wrong implementation.
I would suggest to implement the rotation matrices R1 and R2 because they depend on the longitudinal displacement (either due to a transverse shift on a bending, or due to a direct shift) and beam transverse momenta,
The implementation of a dedicated function for a longitudinal shift seems to me relevant because it is part of the errors to define on a lattice. It might be of lower priority/urgency, though.
At the same time it would be much better to have a single function that calculates T1,T2,R1 and R2 from any combination of displacements on SCgetTransformation.m
(https://github.com/ThorstenHellert/SC/blob/master/SCgetTransformation.m), so, logically I would think it is out of the scope of pyat, and might be implemented somewhere else. For example in pySC ? (https://github.com/lmalina/pySC)
from at.
Related Issues (20)
- pyAT 'Multipole has no attribute PolynomB' exception for loading multipoles from a .mat file with both PolynomB and K value defined HOT 1
- ATX makes matlab crash when Exact* integrators are used. HOT 3
- python get_1d_acceptance: return 0.0 instead of error if no particle survives HOT 2
- np.float gives error in acceptance/touschek.py HOT 1
- Improve element rotation help HOT 1
- python windows version installation HOT 4
- synoptics not visible in atplot when vertical values are above zero HOT 1
- pyAT Distinguish between a sector bending magnet and a rectangular bending magnet HOT 1
- Reduce behaves differently in Matlab and python
- B0 added twice in exactkickrad HOT 2
- python: ringparam not well identified by lattice_load HOT 6
- bug is saving lattice HOT 3
- Bug: atwiggler HOT 13
- problem with display of correctly initialised VariableMultipole element HOT 1
- Change Legend Labels for plot_trajectory() function HOT 12
- fast_ring when having harmonic cavities in the lattice HOT 4
- AT_2_Elegant uses deprecated N_KICKS
- Factor 4 missing in Touschek scattering B2 expression HOT 5
- pyAT Error when calculating damping ring HOT 3
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 at.