|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--TimeDepSchrodinger
Performs numerical integration of the time-dependend Schrodinger equation.
| Field Summary | |
protected double |
dt
|
protected double |
energy
|
protected double |
h
|
protected double[] |
pot
A cache of the values of the potential function |
protected Function |
potFn
The potential function |
protected Complex[] |
psi
The function data |
protected double |
t
|
protected double |
width
|
protected double |
x0
|
| Constructor Summary | |
TimeDepSchrodinger()
Creates a new instance, using a single square well for the potential function. |
|
TimeDepSchrodinger(Function fn)
|
|
| Method Summary | |
void |
advanceOnce()
Performs one step of the Runge-Kutta method, using the member variable dt to determine the size of the step in
the time direction. |
protected void |
advanceOnce(double dt)
Performs one step of the Runge-Kutta method. |
double |
getEnergy()
Returns the value of the energy parameter |
double |
getT()
Returns the simulation time |
double |
getWidth()
Returns the width of the initial gaussian |
double |
getX0()
Returns the position of the initial gaussian |
void |
initFunction(double x,
double h,
int steps)
Resets the model, replacing the function data with a new gaussian. |
double |
integralCheck()
Approximates the integral of the function, by summing the (modulus squared of the) function data and dividing by h. |
void |
setEnergy(double d)
Sets the value of the energy parameter |
void |
setT(double t)
Sets the simulation time. |
void |
setWidth(double d)
Sets the width of the initial gaussian |
void |
setX0(double d)
Sets the position of the initial gaussian |
void |
solve(double x,
double h,
double[] vals)
Since all the work is done in advanceOnce(), this method need only return the (modulus squared of
the) function data. |
protected Complex |
xderiv(Complex[] c,
int i)
Measures the second derivative with respect to x using a finite difference method. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Complex[] psi
protected double energy
protected double x0
protected double width
protected double t
protected double dt
protected double h
protected Function potFn
protected double[] pot
| Constructor Detail |
public TimeDepSchrodinger(Function fn)
fn - The potential function to usepublic TimeDepSchrodinger()
| Method Detail |
public void initFunction(double x,
double h,
int steps)
x - The smallest x-value to considerh - The gap between x-valuessteps - The number of x-values to considerprotected void advanceOnce(double dt)
dt - The size of the advancement in time
protected Complex xderiv(Complex[] c,
int i)
i <= 1 or
i >= c.length-2, zero will be returned.c - The function data on which to operatei - The index at which the derivative is requiredpublic void advanceOnce()
dt to determine the size of the step in
the time direction.
public void solve(double x,
double h,
double[] vals)
advanceOnce(), this method need only return the (modulus squared of
the) function data. Since it is not practical to adjust the size
or x-spacing of the data in the array while the simulation is
running, the x and h parameters are ignored.vals is not the same
size as the array of function datapublic double integralCheck()
h.public double getT()
public void setT(double t)
public double getEnergy()
public void setEnergy(double d)
public double getX0()
public void setX0(double d)
public double getWidth()
public void setWidth(double d)
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||