You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a system of dipoles and nanoparticles, the expansion coefficients of the source and system can be calculated with this:
defget_p_src(cluster, origin=[0,0,0]):
"""get the p_src expansion coefficients; assumes all sources are dipoles Arguments: cluster miepy.cluster or miepy.sphere_cluster origin origin around which to obtain expansion """ifisinstance(cluster.source, miepy.sources.combined_source):
p_src= []
positions= []
fordipoleincluster.source.sources:
p_src_d=np.zeros([2,3], dtype=complex)
p_src_d[0] = (dipole.weight[-1], dipole.weight[0], dipole.weight[1])
p_src.append(p_src_d)
positions.append(dipole.position)
p_src=np.asarray(p_src)
positions=np.asarray(positions)
else:
dipole=cluster.sourcep_src=np.zeros([2,3], dtype=complex)
p_src[0] = (dipole.weight[-1], dipole.weight[0], dipole.weight[1])
positions=np.array([dipole.position])
p_src=np.array([p_src])
returnmiepy.cluster_coefficients(positions, p_src,
cluster.material_data.k_b, origin, lmax=cluster.lmax)
defget_p_scat(cluster, origin=[0,0,0]):
"""get the p_scat expansion coefficients of the nanoparticles Arguments: cluster miepy.cluster or miepy.sphere_cluster origin origin around which to obtain expansion """returnmiepy.cluster_coefficients(cluster.position, cluster.p_scat,
cluster.material_data.k_b, origin=origin, lmax=cluster.lmax)
Then the flux of the source (P0) and system (P) is:
Z0=miepy.constants.Z0k=2*np.pi/wavelengthp_src=get_p_src(cluster)
p_scat=get_p_scat(cluster)
P0=0.5/Z0*np.pi/k**2*np.sum(np.abs(p_src)**2) # power sourceP=0.5/Z0*np.pi/k**2*np.sum(np.abs(p_scat+p_src)**2) # power systemenhance=P/P0
These functions should be added to MiePy in some way to make this type of calculation straightforward.
The text was updated successfully, but these errors were encountered:
For a system of dipoles and nanoparticles, the expansion coefficients of the source and system can be calculated with this:
Then the flux of the source (P0) and system (P) is:
These functions should be added to MiePy in some way to make this type of calculation straightforward.
The text was updated successfully, but these errors were encountered: