Code Monkey home page Code Monkey logo

Comments (4)

leon-vv avatar leon-vv commented on August 22, 2024

I think we should definitely support something like Hermite interpolation for a simple and easy to use interpolation.

However, the optimal approach I think is the one taken for axial symmetry (radial series expansion). It seems like the method can be extended to 3D and planar symmetry as explained by Hawkes[1] chapter 7 and chapter 13.

[1] Peter Hawkes. Principles of Electron Optics. Volume one. 2018.

from traceon.

leon-vv avatar leon-vv commented on August 22, 2024

I looked into it, the radial series expansion in the 3D case is complicated. In theory, if we could effectively calculate the axial harmonics along the optical axis we can do very fast 3D traces. However, how to calculate the axial harmonics is not obvious. The formula in Hawkes is I think incorrect, since it misses the sinus terms that are needed to describe a potential in 3D in full generality.

Implementing Hermite interpolation was a lot of work, and it was not obvious whether it's best to calculate the derivatives analytically or using a finite difference scheme. I figured out in the end that using a finite difference scheme directly on the field components (so not on the potential) is the best option in terms of accuracy/computation. This now works for radial symmetric geometries. See validation/dohi.py.

from traceon.

leon-vv avatar leon-vv commented on August 22, 2024

Hermite interpolation is now fully implemented for 3D and for radial symmetry. In both cases I think it performs very poorly..

I was finally able to generalize the radial series expansion method to 3D. It looks like it will be an extremely accurate and fast method. If it really works as well as I hope I need to write it down in a paper someday.

from traceon.

leon-vv avatar leon-vv commented on August 22, 2024

I have validated the new method in validation/simple-mirror.py. It seems to work really well.

from traceon.

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.