BSLAMS

Relevant files

bslams.h, bslams.c

Class overview

BSLAMS_Parameters
double btol
int iter
BSLAMS_Parameters()

Non-class functions

  • int BSLAMS_findfundmode(
BSlabWaveguide bend,
Polarization pol,
BSLAMS_Parameters par,
BSlabModeArray& mode)

  • int BSLAMS_modeanalysis(
BSlabWaveguide bend,
Polarization pol,
double nmin,
double nmax,
BSLAMS_Parameters par,
BSlabModeArray& mode)

  • int bend_mode_analysis(
BSlabWaveguide bend,
Polarization pol,
double b0, double b1, int Nb,
double a0, double a1, int Na,
BSLAMS_Parameters par,
BSlabModeArray& marr)

  • Dvector Qfit(Dvector x, Dvector y)

  • Dvector Lfit(Dvector x, Dvector y)

  • Dmatrix interpolated_gamma(
char *input_gamma,
char *output_file,
char F,
int Nl,
int storage_flag)

  • Dmatrix interpolated_reduced_S(
char *input_Sr,
char *output_file,
char F,
int Nl,
int storage_flag)

  • Dmatrix interpolated_beta(
char *input_beta,
char *output_file,
char F,
int Nl,
int storage_flag)

Description of class members

Description of non-class members

int BSLAMS_findfundmode( BSlabWaveguide bend,
Polarization pol,
BSLAMS_Parameters par,
BSlabModeArray& mode)

Find the "pol" polarized fundamental mode of the bend waveguide "bend". For root finding, use parameters given by "par". Store the results in mode array "mode".


int BSLAMS_modeanalysis( BSlabWaveguide bend,
Polarization pol,
double nmin,
double nmax,
BSLAMS_Parameters par,
BSlabModeArray& mode)

Complete mode analysis, returns number of found modes. This routine finds the "pol" polarized modes of the bend waveguide "bend". Modes with effective mode indices in the interval "[nmin, nmax]" are searched. For root finding, use parameters given by "par". Store the results in mode array "mode".


int bend_mode_analysis( BSlabWaveguide bend,
Polarization pol,
double b0, double b1, int Nb,
double a0, double a1, int Na,
BSLAMS_Parameters par,
BSlabModeArray& marr)

For a bend waveguide "bend", find all "pol" polarized bent modes with (complex valued) propagation constants laying in a domain in the complex plane defined by lower left point "(b0, a0)" and upper right point "(b1, a1)".
"b0", "b1" (with b0 < b1, and both positive) are phase propagation constants, and "a0", "a1" (with a0 < a1, and both positive) are attenuation constants. Interval [b0, b1] is divided into "Nb" points, and interval [a0, a1] is divided into "Na" points.
For root finding, use parameters given by "par". Store the results in mode array "marr".


Dvector Qfit(Dvector x, Dvector y)

Given values function y=f(x) at three points, this function gives coefficients [a, b, c] for quadratic interpolation polynomial a*x^2 + b*x + c.
Returns Dvector [a, b, c].


Dvector Lfit(Dvector x, Dvector y)

Given values function y=f(x) at two points, this function gives coefficients [a, b] for linear interpolation polynomial a*x + b.
Returns Dvector [a, b].


Dmatrix interpolated_gamma( char *input_gamma,
char *output_file,
char F,
int Nl,
int storage_flag)

Gives interpolated bent mode propagation constants.
Nodal values of γ are given in the file "input_gamma" with Data structure: first line: no. of BWG modes. then for other lines: first entry wavelength then real and minus of imag part of γ from fundamental mode to higher order modes.
Interpolated values are written to file "output_file" with data structure first entry wavelength then real and minus of imag part of γ from fundamental mode to higher order modes.
"F"= interpolation flag = Q (quadratic) or L (linear)
"Nl"= nodal wavelengths interval are divided into Nl points.
"storage_flag" = If set 0, then output is not written to file, but returned as a function output. Else if set 1, then output is written to file "output_file" only.


Dmatrix interpolated_reduced_S( char *input_Sr,
char *output_file,
char F,
int Nl,
int storage_flag)

Gives interpolated reduced scattering matrix Sr (See ???).
Nodal values of Sr are given in the file "input_gamma" with Data structure: first line: no. of bent waveguide modes and then no. of straight waveguide modes. Then for other lines: first entry wavelength then real and imag part of Sr matrix (all matrix rows are sequentially ordered).
Interpolated values are written to file "output_file" with data structure first entry wavelength then real and imag part of Sr matrix (all matrix rows are sequentially ordered).
"F"= interpolation flag = Q (quadratic) or L (linear)
"Nl"= nodal wavelengths interval are divided into Nl points.
"storage_flag" = If set 0, then output is not written to file, but returned as a function output. Else if set 1, then output is written to file "output_file" only.


Dmatrix interpolated_beta( char *input_beta,
char *output_file,
char F,
int Nl,
int storage_flag)

Gives interpolated straight waveguide mode propagation constants.
Nodal values of β are given in the file "input_beta" with Data structure: first line: no. of straight waveguide modes. Then for other lines: first entry wavelength then β from fundamental mode to higher order modes.
Interpolated values are written to file "output_file" with data structure first entry wavelength then β values of fundamental mode to higher order modes.
"F"= interpolation flag = Q (quadratic) or L (linear)
"Nl"= nodal wavelengths interval are divided into Nl points.
"storage_flag" = 0 => return beta values as a function output.
"storage_flag" = 1 => write beta values to a as a file "output_file".
else do both of the above things.