small fixes

Former-commit-id: 90d007ae19ad42222c406564adc80b5394703b83
This commit is contained in:
Marek Nečada 2017-01-11 11:27:50 +02:00
parent fda639304a
commit 5b0bd8d099
2 changed files with 15 additions and 9 deletions

View File

@ -262,11 +262,13 @@ Original formulation, sect.
\begin_layout Standard
\begin_inset Formula
\begin{eqnarray*}
\vect A_{1lm}\left(\hat{\vect r}\right) & = & \frac{1}{\sqrt{l\left(l+1\right)}}\left(\hat{\vect{\theta}}\frac{1}{\sin\theta}\frac{\partial}{\partial\phi}Y_{lm}\left(\hat{\vect r}\right)-\hat{\vect{\phi}}\frac{\partial}{\partial\theta}Y_{lm}\left(\hat{\vect r}\right)\right)\\
\vect A_{2lm}\left(\hat{\vect r}\right) & = & \frac{1}{\sqrt{l\left(l+1\right)}}\left(\hat{\vect{\theta}}\frac{\partial}{\partial\phi}Y_{lm}\left(\hat{\vect r}\right)-\hat{\vect{\phi}}\frac{1}{\sin\theta}\frac{\partial}{\partial\theta}Y_{lm}\left(\hat{\vect r}\right)\right)\\
\vect A_{3lm}\left(\hat{\vect r}\right) & = & \hat{\vect r}Y_{lm}\left(\hat{\vect r}\right)
\end{eqnarray*}
\begin{eqnarray}
\vect A_{1lm}\left(\hat{\vect r}\right) & = & \frac{1}{\sqrt{l\left(l+1\right)}}\left(\hat{\vect{\theta}}\frac{1}{\sin\theta}\frac{\partial}{\partial\phi}Y_{lm}\left(\hat{\vect r}\right)-\hat{\vect{\phi}}\frac{\partial}{\partial\theta}Y_{lm}\left(\hat{\vect r}\right)\right)\nonumber \\
& = & \frac{1}{\sqrt{l\left(l+1\right)}}\nabla\times\left(\vect rY_{lm}\left(\hat{\vect r}\right)\right)\nonumber \\
\vect A_{2lm}\left(\hat{\vect r}\right) & = & \frac{1}{\sqrt{l\left(l+1\right)}}\left(\hat{\vect{\theta}}\frac{\partial}{\partial\phi}Y_{lm}\left(\hat{\vect r}\right)-\hat{\vect{\phi}}\frac{1}{\sin\theta}\frac{\partial}{\partial\theta}Y_{lm}\left(\hat{\vect r}\right)\right)\label{eq:vector spherical harmonics Kristensson}\\
& = & \frac{1}{\sqrt{l\left(l+1\right)}}r\nabla Y_{lm}\left(\hat{\vect r}\right)\nonumber \\
\vect A_{3lm}\left(\hat{\vect r}\right) & = & \hat{\vect r}Y_{lm}\left(\hat{\vect r}\right)\nonumber
\end{eqnarray}
\end_inset
@ -1236,6 +1238,10 @@ Translation of spherical waves: getting insane
Multiple scattering: nice linear algebra born from all the mess
\end_layout
\begin_layout Chapter
Quantisation of quasistatic modes of a sphere
\end_layout
\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex

View File

@ -138,14 +138,14 @@ class Scattering(object):
btime = _time_b(verbose)
self.prepare(verbose=verbose)
pq_0 = np.broadcast_to(pq_0, (self.N,2,self.nelem))
MP_0 = np.empty((N,2,nelem),dtype=np.complex_)
MP_0 = np.empty((self.N,2,self.nelem),dtype=np.complex_)
for j in range(self.N):
MP_0[j] = np.tensordot(self.TMatrices[j], pq_0[j],axes=([-2,-1],[-2,-1]))
MP_0.shape = (N*2*self.nelem,)
MP_0.shape = (self.N*2*self.nelem,)
solvebtime = _time_b(verbose,step='Solving the linear equation')
ab = scipy.linalg.lu_solve(self.lupiv, MP_0)
_time_e(solvebtime, verbose, step='Solving the linear equation')
ab.shape = (N,2,nelem)
ab.shape = (self.N,2,self.nelem)
_time_e(btime, verbose)
return ab
@ -171,7 +171,7 @@ class Scattering(object):
_time_e(btime, verbose)
return ab
class Scattering_2D_lattice(Scattering):
class Scattering_2D_lattice_rectcells(Scattering):
def __init__(self, rectcell_dims, rectcell_elem_positions, cellspec, k_0, rectcell_TMatrices = None, TMatrices = None, lMax = None, verbose=False, J_scat=3):
'''
cellspec: dvojice ve tvaru (seznam_zaplněnosti, seznam_pozic)