-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding wiggler passmethod to integrators #38
Conversation
Hello @mashl, |
Hello @mashl, |
There is also this issue still open: #1 |
In @bnash do we know what the |
Also, we should have some documentation on adding an integrator. Is there some documentation already? |
Hello @simoneliuzzo |
Dear @mashl, |
hello @carmignani ExportMode int* passFunction(const mxArray *ElemData, int *FieldNumbers, double *r_in, int num_particles, int mode) |
Yes @mashl! The passfunction has to be changed in a trackFunction, then also the mexfunction has to be modified by using the functions in atelem.c. |
I agree with @willrogers about the documentation for developers. It was one of the documents started on overleaf by @bnash, if I'm not wrong, but I think there was not much in it. |
Documentation could be in a README in the |
dear @simoneliuzzo |
@simoneliuzzo @willrogers |
Dear @mashl, |
I don't know exactly. We inherited this structure. I guess the idea was to put individual user developed integrators into the user directory. The analytic symplectic integrator for wigglers using the method of Y. Wu and E. Forest (included in gwig.c) (see paper) have been thought to require a bit more work to get working properly, so was separated out from the others. |
Dear @simoneliuzzo |
Hello @mashl, thanks so much for this contribution. That would be great to be able to include radiation properly with insertion device modeling. If the damping times between AT and Elegant are coming out the same, and the emittances are not, then I guess this means the diffusion is different. By changing the passmethod, you can get the damping right, but you can't get the diffusion right unless you edit the diffusion matrix computation in the Ohmi Envelope calculation. The diffusion matrix computation is here I wonder if Elegant includes the quantum diffusion from Wigglers correctly in their implementation? |
Likewise, for U0, we need to check how that is computed. Normally the function may not know to look in the Wiggler pass method to find some additional energy loss. |
@carmignani @mashl Ok, then one has to make sure that the wiggler is included in the radiation integrals. When I get a chance, I will try this pass method. |
Dear @bnash |
@bnash @carmignani @simoneliuzzo |
Dear All, We did a similar thing for AT1.3 (sorry, our student started with the old version and he has done most of the development on AT1.3, in the future I think we will try to develop for AT2.0). He used the AT formula for dH/dl which converges with much less slices than the Elegant version. Instead of: dFactor = ((1+X[4])*(1+X[4])); (line 468 of your gwigR.c), in our code we used: SQR(1+X[4])*(1 + X[0]irho + 0.5e0(SQR(X[1])+SQR(X[3]))/SQR(1+X[4])) Regarding the emittance calculations, we are also trying to make the omhienvelope method to work for this pass method. Our student has done some preliminary tests with a modified version of findmpoleraddifmatrix, but so far we do not get a good agreement with the Sands integrals method... Unfortunatelly our student will leave soon, we will try to continue his work. In any case, we are open to anyone who wants to collaborate (I already contacted Ahmad)! Best, Zeus |
Then also the modified |
Is I4 correct? |
dear @willrogers |
dear @simoneliuzzo |
Hello @mashl, |
Dear @carmignani |
Dear @simoneliuzzo |
Dear @mashl we have some converters from AT to Elegant. Could you send me an AT lattice file, I will give it a try (single one) for conversion and ask @carmignani to check some basic values in Elegant. That way we may compare lattices more appropriately and be sure about the correct import of the elegant features. We do not see in the pull request the ringpara.m file. Did you commit and push it? ciao |
any progress on this topic? |
@mashl, make sure that you commit all needed changes in the "pull request", that way we may checkout the fork, test it, and eventually approve the pull request (that merges all the modifications to AT directly).
thank you |
Dear @simoneliuzzo |
Merged in #121 . |
symplectic wiggler passmethod with classic radiation similar to Elegant Cwiggler