Code Monkey home page Code Monkey logo

Comments (6)

willrogers avatar willrogers commented on July 20, 2024

From @bnash on October 11, 2016 14:30

Here is a simple function to compute the 6x6 one turn map matrix. From this we can compute generalized Twiss parameters, invariants, etc. May still be a good idea to have uncoupled limits to get simple Twiss params.
I checked and got approximate agreement with Matlab on this. The Matlab version uses
an epsilon of 6.055454452393343e-006
claiming this is somehow optimal (referencing numerical recipes). I don't really know why.
(I'm trying to make the code display with indentation properly, but it doesn't work)

import at
import numpy

def pyATm66(ring):
    eps=1e-10
    epsmat=eps*numpy.identity(6)
    mm=at.atpass(ring, epsmat, 1)/eps
    return numpy.transpose(mm)

from at.

willrogers avatar willrogers commented on July 20, 2024

Three backticks before the code and three backticks afterwards.

from at.

willrogers avatar willrogers commented on July 20, 2024

(Backtick is top-left on the UK keyboard).

from at.

willrogers avatar willrogers commented on July 20, 2024

From @bnash on October 11, 2016 15:3

Thanks, next step is to make a version of the amat function (linear normal form, converts matrix to 3 rotations)
https://github.com/willrogers/at/blob/pyat/atmat/atphysics/amat.m
in python.

From there, we can also make generalized lattice functions with Forests 'betaoids' and 'etaoids'
http://journals.aps.org/pre/abstract/10.1103/PhysRevE.58.2481

https://github.com/willrogers/at/blob/pyat/atmat/pubtools/local_lattice_params/find_betaoids.m

We also need to make utilities for computing things at different places around the ring. Many of the functions in Matlab AT accept a set of indices that compute the quantities at those positions in the lattice.

from at.

willrogers avatar willrogers commented on July 20, 2024

From @bnash on October 11, 2016 15:7

amat can also be used to compute eigenemittance following computing second moment matrix (Sigma) from ohmi-envelope
https://github.com/willrogers/at/blob/pyat/atmat/atphysics/ohmienvelope.m
Though, I think the eigenvalues of J*Sigma also give you the emittances.

from at.

willrogers avatar willrogers commented on July 20, 2024

We now have substantial progress on this so I will close the ticket.

from at.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.