Giter Site home page Giter Site logo

Comments (7)

kostyfisik avatar kostyfisik commented on June 26, 2024

Are you using the latest master branch from Github? It should be printing a warning message if the convergence is poor. Note, Le Ru nmax estimate is correct for near field inside a bulk sphere an space about one radius away from it.

from scattnlay.

10110111 avatar 10110111 commented on June 26, 2024

Yes, I'm using the latest master. As for the warning, I do get one, but I thought it was about the single failing point discussed in #42.

Is there any available way to estimate nmax for larger distance from the sphere?

from scattnlay.

kostyfisik avatar kostyfisik commented on June 26, 2024

No, Le Ru seems to be the latest update on this. In general, near-field evaluation is a poorly investigated aspect of Mie theory. The next problem I would like to adress here, is to develop a more stable algorithm for near-field evaluation inside the sphere. As for the near-field outside the sphere it is way more stable than, e.g. in Matlab implementations, or some published results (wich are simply wrong). In the attached figre you can find Stratify result on the top left (note halo-type problem away from the sphere due to use of Wiscombe cutoff), our Scattnlay result on the right (with Le Ru cutoff), and published result in the background.
near-field

from scattnlay.

10110111 avatar 10110111 commented on June 26, 2024

I think the problem here is that incident field is calculated from the spherical partial wave expansion, using the termination criterion that is designed for scattered field properties, but is inadequate for incident field. (Le Ru doesn't even discuss incident field.)

It may be more efficient (i.e. less demanding on number of terms) to calculate the incident field as an actual exp(ikz) function, instead of summing its expansion in spherical waves along with the scattered near field.

from scattnlay.

kostyfisik avatar kostyfisik commented on June 26, 2024

@10110111 Good idea! Could you please plot separately the incident and scattered fields for some set of parameters, when it really helps? You can use https://github.com/ovidiopr/scattnlay/blob/master/src/nmie-nearfield.hpp#L402 as a blue-print for your code. Note, that we use the same summation cycle both for incident and scattered field incide and outside the particle https://github.com/ovidiopr/scattnlay/blob/master/src/nmie-nearfield.hpp#L330-L334 , we just set c and d expansion coefficients to be one https://github.com/ovidiopr/scattnlay/blob/master/src/nmie-nearfield.hpp#L107-L108

from scattnlay.

10110111 avatar 10110111 commented on June 26, 2024

I've actually now implemented my idea using your pointers (see the patch here: 10110111@6c84064), and the results look the same as the last screenshot in #44 (comment) — i.e. ideally:

Screenshot - 201221 - 15:17:34

In case you still want to see the scattered field only, here it is (the parameters are the same as in the OP):

Screenshot - 201221 - 15:07:57

And here's the current master output for incident-only field (I just subtracted the scattered field from the full output):

Screenshot - 201221 - 15:16:45

from scattnlay.

kostyfisik avatar kostyfisik commented on June 26, 2024

Great! Looks very promising. Still need some verification for a general case (there is still a possibility e.g. messing a sign in some direction); however, it looks like a way to go... I would like to finish with adding near- and far-field computations to the webapp and will work on this next...

from scattnlay.

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.