diff --git a/examples/rectangular_constant_tmatrix/README.md b/examples/rectangular_constant_tmatrix/README.md new file mode 100644 index 0000000..b722391 --- /dev/null +++ b/examples/rectangular_constant_tmatrix/README.md @@ -0,0 +1,7 @@ +An example with arectangular array of a very simplistic +model of scatterer with completely fabricated constant +T-matrix and manually specified set of VSWFs the scatterer +interacts with (i.e. instead of constant lMax cutoff). + +This might be useful e.g. in symmetry-breaking thought +experiments. diff --git a/examples/rectangular_constant_tmatrix/modes/00_params.sh b/examples/rectangular_constant_tmatrix/modes/00_params.sh new file mode 100644 index 0000000..f0224f4 --- /dev/null +++ b/examples/rectangular_constant_tmatrix/modes/00_params.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Common parameters for a rectangular array +# N.B. We put those into bc, which does not understant exponential notation + +export PX_nm=375 +export PY_nm=375 +export BG_REFINDEX=1.52 + +export BSPEC='[6,14]' # l = 1, m = +- 1 (i.e. xy) electric dipoles, nothing more + +# Input parameters for T-matrix. It shall have the following form: +# '[[ T_mm, T_mp], +# [ T_mp, T_pp]]' +# +# The following lines are used to specify parameters for the most +# simplistic T-matrix that b having only diagonal elements, but + +T_PHASE_MM=0.1 +T_PHASE_PP=0.05 +# "gain" factors; values larger than 1 are unphysical, 1 conserves energy +T_GAINFACTOR_MM=1 +T_GAINFACTOR_PP=1 + +# Setup bc +echo 'scale=20;pi=3.14159265358979323846;' > bc_env +export BC_ENV_ARGS="bc_env" + + +# We have only one particle per unit cell here +export P1X_nm=0 +export P1Y_nm=0 + + +# Lattice vectors (for the general scripts) +export A1X_nm=${PX_nm} +export A1Y_nm=0 +export A2X_nm=0 +export A2Y_nm=${PY_nm} + +# Reciprocal lattice vectors +export B1X_nmi=$(bc <<< '1/'${PX_nm}) +export B1Y_nmi=0 +export B2X_nmi=0 +export B2Y_nmi=$(bc <<< '1/'${PY_nm}) + +# Constant T-matrix +T_MM="$(bc -l <<< -.5+.5*${T_GAINFACTOR_MM}*c\(${T_PHASE_MM}\))+$(bc -l <<< .5*${T_GAINFACTOR_MM}*s\(${T_PHASE_MM}\))j" +T_PP="$(bc -l <<< -.5+.5*${T_GAINFACTOR_PP}*c\(${T_PHASE_PP}\))+$(bc -l <<< .5*${T_GAINFACTOR_PP}*s\(${T_PHASE_PP}\))j" +export TMATRIX="\ +[[${T_MM},0],\ +[0,${T_PP}]]" # note no unescaped whitespaces allowed here + diff --git a/examples/rectangular_constant_tmatrix/modes/01a_realfreq_svd.sh b/examples/rectangular_constant_tmatrix/modes/01a_realfreq_svd.sh new file mode 100755 index 0000000..7267062 --- /dev/null +++ b/examples/rectangular_constant_tmatrix/modes/01a_realfreq_svd.sh @@ -0,0 +1,17 @@ +#!/bin/bash +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +MISCDIR=../../../misc + +source ${SCRIPTDIR}/00_params.sh + +# try several lMaxes + +${MISCDIR}/lat2d_realfreqsvd.py \ + -B $BG_REFINDEX \ + -b s${A1X_nm}e-9 s${A1Y_nm}e-9 \ + -b s${A2X_nm}e-9 s${A2Y_nm}e-9 \ + -p s${P1X_nm}e-9 s${P1Y_nm}e-9 \ + -w ${BSPEC} -T ${TMATRIX} \ + -k 0 0 \ + -F 2.001 0.001 2.250 \ + -P