ilent2 / ott Goto Github PK
View Code? Open in Web Editor NEWOptical Tweezers Toolbox (Version 1)
License: Other
Optical Tweezers Toolbox (Version 1)
License: Other
I'm unsure what to do with the file ott/+ott/tmatrix_pm_cube.m in version 1.4
In version 1.4 I've added a TmatrixPm class with a static method for constructing simple T-matrices using the point matching method.
Should I create a subclass of TmatrixPm -> TmatrixPmCube or should I modify the simple() static method to use tmatrix_pm_cube instead? What is the purpose of tmatrix_pm_cube? Are there additional optimisations? What are Nmax_particle and Nmax_medium for?
In bsc_pointmatch_farfield, the documentation says beam_type
should select the type of beam, HG or LG. It is currently unused.
parameters(4) is not used. This should either be documented or used.
The examples are running really slowly. We should be able to optimise them to run at a speed comparable to the previous release.
It would be good to make the toolbox into a package, this will reduce namespace pollution. The functions can be used individually, such as
ott.force_z(...)
or all the functions can be imported
import ott.*
This will require adding the above import to all toolbox functions that use other toolbox functions and changing the directory ott-toolbox to +ott, however this change breaks backwards comparability.
A graphical use interface would greatly simplify use for certain use cases.
ott/ott-toolbox/bsc_pointmatch_farfield.m
Line 175 in 70202a1
Hi Alex,
There seems to be an issue with the power normalisation for bsc_pointmatch_farfield. Around line 175, rw is calculated from tan(theta).^2, where theta is in the range ((1:ntheta)-0.5)/ntheta*pi which will sometimes be approximately pi/2. Even when it is not exactly pi/2, nearby values still cause a problem since rw is later used in exp(rw/2 + ...) which quickly becomes too large.
Could you take a look at this.
Cheers,
Isaac
Write a unit test file for each class/component. Check that it at least constructs/runs. We can add more tests latter.
Hi Issac, how can I set the T-matrix of particle with cylinder shape in GUI? I set the radius and height with 1e-7 and 3e-6 respectively. But system went worry and told me haven't defined the 'mtimes' function. My MATLAB version is 21b and using toolbox version 1(available in github).
Replace toScattered, toTotal, and similar functions with a single set type function. For the matrix, use a set.type for default behaviour and a expand function for additional behaviour.
Add unit tests for this
Check other functions that could be simplified or replaced with a get.set interface
Excuse me, this code is applicable to calculate the trapping efficiency of optical tweezers capture how much size range of particles ?
Dear Dr. Lenton
When I read the program and the corresponding documents, I didn't find the effect of the extinction coefficient of the captured particles on the radiation pressure, whether I didn't notice this. If we calculate the radiation pressure of graphite and metal particles, how should we define the absorption coefficient or extinction coefficient
It would be nice to move the utility functions to a +utils sub package. We could then also drop the backwards compatibility requirement on the utility functions (say they are for internal use and users should use them at their own risk).
Functions I think should be included in the +utils directory, there may be others...
I don't like it. We can do something better.
Dear Dr. Lenton,
I have a small question regarding the units for E-field plotted via emFieldXyz method. I couldn't find the info about the units for electric field, so, I wonder whether emFieldXyz returns fields in SI (i.e., V/m for E-field), or they somehow inherit the normalization from beam.power = 1 (as was suggested in the documentation). So, should I convert the obtained fields by hands? I found how to convert forces from normalized units to SI, but the same trick with E-field is not so clear for me.
Thank you in advance.
Best regards,
Gleb Fedorovich
Octave is not happy about the ott_warning.m function:
error: invalid assignment to cs-list outside multiple assignment
error: invalid empty index list
error: invalid dimension inquiry of a non-existent value
A few options there of what to do, but I'll leave it to you to decide. One way is to make it detect matlab, another way is to leave it out for now? another way is to be very strict with lists and parameters so that it doesn't output "this is not defined" type error.
EDIT: Another option is to release an octave version without warnings.
Its easier if Tmatrix.Nmax is always a 1x2 vector.
What are the appropriate parameters for w0 for lg and hg beams? Is there a function to calculate this?
"Ignoring fz<0 entries at start of vector" is warned when I run modified example_sphere.m file, but when I open the find_equilibrium.m file to find the corresponding 39 lines, run find(fz<0,1) is not equal to 1, but to 3, so the program should not run warning('Ignoring fz<0 entries at start of vector'), but the result is to continue executing the program below "if zeroindex ==1". The results are shown in the following charts.
I changed 4 things, 1 is n_medium=1.53 and n_particle=1.33; 2 is NA=0.8; 3 is radius=10e-6; 4 is linspace(-4,4,80)->linspace(-30,30,300).
Thank you Dr. Lenton for your patient answer earlier. I am currently writing a simulation paper on vortex optical tweezers, and I need to use your optical tweezers kit for simulation, but I still don't know enough about some parts of the program. Thank you for your help, and I can include you as the author when the paper is published. What do you think?
Add append method
Plane wave beam with multiple angles
Translate to multiple beams
Scatter for multiple beams
It might be useful to include a material database (or methods to load external databases).
Some ideas:
Unsure what to do with:
Perhaps other files in +utils package.
It would be useful to add (maybe optionally) a printout to the command line of the code used in GUI. E.g. when I press Generate button in any gui window, I want to see which command was executed, so I can use it later in m-files. Also, it might be useful for those trying the toolbox for the first time.
Hi Dr. Issac Lenton,
I'm trying to do some scattering calculations with OTT in MATLAB. I'm able to follow the beam_visualization.m example and calculate the scattered fields when the trap beam (a gaussian beam) is offset from the particle. As I understand it, everything is in the particle's center-of-mass frame. I want to transform the far-field solutions back into the lab frame after the scattering calculation. Could you advise how I should proceed? Currently, translation in Y (using .translateXyz) seems to also cause some tilt in the far-field solutions without applying any scattering matrix. I attached a plot to show how the beam profile in blue in the translated Y dimension looks skewed in the particle's COM frame in the far field regime. I want to be in a rest frame of this incoming trap beam, where I think the beam profiles in any XY planes would look translated and not skewed. Any suggestions are appreciated.
Thanks,
Yuqi
Version 1.4 will be installed differently and have depreciated functionality. We should add a updating section to the readme for version 1.4.
At this stage, upgrading will consist of:
Download the latest release of v1.3 (probably 1.3.1), run your scripts and look for depreciation warnings. Follow the instructions in the depreciation warnings to use the new functions.
Download the new toolbox and include the package path. Remove the old toolbox from the path.
Add import ott.*
to all scripts using toolbox functions or prefix all toolbox functions with ott.
.
Is there a predefined filling factor (ratio between beam waist and aperture radius)? I couldn't find a method to change either the aperture size or the beam waist so I assume there must be one. However, in one of the additional papers to this toolbox (Multipole expansion of strongly focussed laser beams) I've read that one can define the truncation of the beam by the aperture. Could someone explain to me what I am missing?
This class was introduced in R2020b, at some stage we should update to use this container (perhaps in 2.1 or 2.2?)
translate_z
to output non-square matricesIt would be nice (and useful) to have an option to translate plane waves by applying a phase shift to the beam.
Important: need to make sure that the same translation rule isn't applied to beams once they have been scattered by another particle (or check that they are still compatible).
I think this is a feature request but I may be overlooking a way to do what I want with the existing code so... please bear with me. I am interested in computing not only the scattering of fields from particles but also their absorption. Now, the SMARTIES code base constructs T-matrices using a formulation that looks like: T = -P*inv(Q) but the OTT just calculates T directly without that factorization. This works like: E_incident~(a;b), E_scattered~(p;q), and E_internal~(c;d) where my lowercase letters represent the coefficients of the basis functions, etc. Then (p;q) = T(a;b) tells the scattered from the incident using the T-matrix. But also we can do (p;q) = -P(c;d) and (a;b) = Q(c;d) or (c;d) = inv(Q)(a;b). It is this last bit that I think I need since only if I have the coefficients for the internal field components can I figure out the dissipated power?
As a note, the SMARTIES function that does this is called: "sphCalculatePQ" which says, "Calculates P,Q matrices for a spheroid using the algorithm of [JQSRT 123, 153 (2013)]" [here is the article: https://www.sciencedirect.com/science/article/pii/S0022407313000423 ]
When Bsc.translateZ is called with multiple positions, the beams are translated correctly but only the last beam translation matrix is returned.
Does the program take into account the effect of different laser wavelengths on the refractive index of the medium (such as water)? Since the refractive index of most media is corresponding to the refractive index of D-light (589.3nm), while optical tweezers are commonly used for 1064nm laser, the corresponding refractive index of media will decrease somewhat at 1064nm band, resulting in slightly different results.
Thank you, Dr. Lenton
% This file is part of the optical tweezers toolbox. % See LICENSE.md for information about using/distributing this file.
In bsc_pointmatch_focalplane, parameters(1), parameters(2) and parameters(4) are not used. These should be used or documented as depreciated.
beam_type is not used, however the documentation says it should choose the beam type LG/HG.
RE: Our previous conversation, can you add the ability to override he fit points. This will be helpful for people calculating simple SLM beams which may not need many fit points.
Attempting to use either the GUI for "Geometric Shape T-matrix" or the command line "ott.Tmatrix.simple" fails when the user attempts to use the documented optional parameter 'method' with the value 'smarties'. The error is thrown by the ott.TmatrixSmarties function on line 123 indicating that method is not a recognized parameter. This seems like the parameter is getting passed down from the ott.Tmatrix.simple function to the subsidiary ott.TmatrixSmarties function when it shouldn't be but I am unfamiliar with the object oriented programming approach in Matlab so I may be wrong here. It is also possible this errror is somehow due to smarties not being installed but, if so, the error does not seem to alert the user to that effect. (I did, in fact, install smarties and used the initpath function to add it to my path prior to running ott.) This error was seen using Matlab R2019b on Mac OS Catalina.
The Warning messages are obtrusive in 1.3.1. It is possible to change a particular warning state (using the tag) to only display a warning once.
I'm thinking that 1.3.1 shouldn't have the GUI as it appears to be a big deal. Suggest putting it in 1.4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.