This MATLAB code calculates electromagnetic properties for a spherical scatterer illuminated by an electric dipole source based on the Mie theory.
This repository contains:
- Main.m: main program to initiate a calculation.
- InputFiles: input files, which are read by main.m (demonstration).
- Functions: function called by Main.m.
- To use this code, you can either download the zipped file or clone the repository (you need to install Git on your PC first).
git clone https://github.com/CoFFeeSooDa/MieDipole.git
- After the download, you can start a calculation in MATLAB (2016a and after is recommended).
Main.m starts a calculation by reading a JSON file in lines 22-23,
FilePath = './InputFiles/'; % Folder Path of Input Files
FileName = 'Demo_WavelengthMode_CF_PCRET'; % File Name
To customize your own calculation, you can establish your settings in a JSON file. Here are some examples to demonstrate what you can do in this program.
A standard JSON input file comprises three main objects, "Settings", "tmp_set" and "fplot".
The first object defines the geometry of a system.
"Settings" : {
"ModeName" : "wavelength",
"Quantity" : "CF",
"DPos" : {
"Cart" : [0, 0, 80e-9]
},
"APos" : {
"Cart" : [0, 0, -80e-9]
},
"DOri" : {
"Cart" : [0, 0, 1]
},
"AOri" : {
"Cart" : [0, 0, 1]
},
"nmax" : 70,
"BC" : "coreshell",
"rbc" : [70e-9,60e-9],
"Dpstrength" : 1
}
-
ModeName
: sets the calculation type. Currently, the code supports the following types:wavelength
,angle
andmapping
. In thewavelength
mode, the program sweeps the wavelength (wavenumber) of the donor dipole; in theangle
mode, the program sweeps the position of the acceptor dipole, which is described by$\theta$ ; in themapping
mode, the program plot the mapping of a specific plane (see alsotmp_set
). -
Quantity
: specifies the quantity presented in the figures. Currently,CF
(coupling factor, the definition can be found in here) andPurcell
(Purcell factor, the enhancement of spontaneous emission) are available. -
DPos
(APos
): sets the position of the donor (acceptor) dipole.(unit: meter) -
DOri
(AOri
): set the orientation of the donor (acceptor) dipole. (dimensionless, be sure that it is normalized) -
nmax
: the highest expansion order in a calculation. -
BC
: the boundary condition ---single
orcoreshell
. -
rbc
: the radius of a single (core/shell) sphere (descending order) -
Dpstrength
: the strength of the donor dipole (Unit: cgs)
The second object defines dielectric properties of the space,
"tmp_set" : {
"mode" : "Auto",
"lambda_s" : 300e-9,
"lambda_e" : 700e-9,
"epsi0" : 1,
"epsi1" : 4,
"epsi2" : ".\\InputFiles\\DielectricFunctions\\Ag_JPCL.csv",
\\(for angle mode only)-----------------------------------------------
"ThetaResol" : 1,
"Theta_i" : 5,
"Theta_f" : 180,
"Ar" : 80e-9,
"Phi" : 0,
\\(for mapping mode only)---------------------------------------------
"x_points" : 101,
"x_start" : -300e-9,
"x_end" : 300e-9,
"y_points" : 101,
"y_start" : -300e-9,
"y_end" : 300e-9,
"plane" : "xz",
"third_coord": 0
}
-
mode
: control of the fitting of dielectric functions. -
lambda_s
: the starting point of wavelength (unit: m) -
lambda_e
: the end point of wavelength (unit:m) -
epsi0
: the dielectric function of the outermost region. -
epsi1
: the dielectric function of the middle region. -
epsi2
: the dielectric function of the innermost region. (for"BC"="coreshell"
only) -
ThetaResol
: the resolution of$\theta$ (the position of the acceptor dipole, unit: degree) -
Theta_i
: the initial value of$\theta$ . (unit: degree) -
Theta_f
: the final value of$\theta$ . (unit: degree) -
Ar
: the$r$ of the acceptor dipole (unit: m) -
Phi
: the$\phi$ of the acceptor dipole (unit: degree) -
x_points
: the number of grid points along x axis. -
x_start
: the starting point of the x-axis (unit: m) -
x_end
: the endpoint of the x-axis (unit: m) -
y_points
: the number of grid points along the y-axis. -
y_start
: the starting point of the y-axis (unit: m) -
y_end
: the endpoint of the y-axis (unit: m)
The third object defines the format of the output figures,
"fplot" : {
"colorstyle" : "-k",
"range" : [null,null,null,null],
"yscale" : "log",
"xlabel" : "$\\mathrm{Wavenumber}~(\\mathrm{cm}^{-1})$",
"ylabel" : "$\\mathrm{Coupling~Factor}~(\\mathrm{cm}^{-6})$",
"subaxis" : 1,
"subrange" : [null,null,null,null],
"subxlabel" : "$\\mathrm{Wavelength}~(\\mathrm{nm})$"
}
It is recommended that the readers should be familiar with the plot setting in MATLAB before changing the settings. Otherwise, the setting should be kept in default.
If you use MieDipole in your work, please cite:
Ming-Wei Lee and Liang-Yan Hsu, "Controllable Frequency Dependence of Resonance Energy Transfer Coupled with Localized Surface Plasmon Polaritons", J. Phys. Chem. Lett. 2020, 11, 16, 6796–6804
@article{Lee2020,
author = {Lee, Ming-Wei and Hsu, Liang-Yan},
doi = {10.1021/acs.jpclett.0c01989},
issn = {1948-7185},
journal = {J. Phys. Chem. Lett.},
number = {16},
pages = {6796--6804},
pmid = {32787214},
url = {https://pubs.acs.org/doi/10.1021/acs.jpclett.0c01989},
volume = {11},
year = {2020}
}