Comments (7)
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.
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.
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.
from scattnlay.
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.
@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.
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:
In case you still want to see the scattered field only, here it is (the parameters are the same as in the OP):
And here's the current master
output for incident-only field (I just subtracted the scattered field from the full output):
from scattnlay.
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)
- pip version tests fail with buffer wrong dimensions HOT 3
- build errors, nscattlay_dp not found HOT 4
- possible numerical problems HOT 6
- Compilation problem HOT 20
- Microsphere nanojet simulation HOT 6
- Improvements for webapp HOT 8
- Fused silicon dioxide HOT 1
- Update convergence preset?
- nan values in the central part of the sphere HOT 4
- memory required HOT 5
- Support of materials with negative refractive index
- Add support of azimutal and radial polarization of incident light.
- First point calculated by fieldnlay is always inf&nan HOT 12
- Jump of field value at z=0 HOT 2
- Near-field verification for a 10mkm water droplet - create test case
- Try to use arblib
- Compilation issues for mac HOT 2
- Inconsistent results between PyPi package, python package installed from repository and web app HOT 4
- errors when trying to install scattnlay in Mac HOT 2
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 scattnlay.