org.opensourcephysics.sip.ch16
Class Eigenstate

java.lang.Object
  extended by org.opensourcephysics.sip.ch16.Eigenstate
All Implemented Interfaces:
ODE

public class Eigenstate
extends java.lang.Object
implements ODE

Eigenstate computes energy eigenstates for an arbitrary potential.


Field Summary
static int DID_NOT_CONVERGE
           
static int INSUFFICIENT_NUMBER_OF_POINTS
           
static int NO_ERROR
           
 
Constructor Summary
Eigenstate(Function potential, int numberOfPoints, double xmin, double xmax)
          Constructs an Eigenstate using the given potential function and the given x-domain.
 
Method Summary
 double[] getEigenstate(int qnumber)
          Gets the energy eigenfuntion for the given quantum number.
 int getErrorCode()
          Gets the error code for the last eigenstate computation.
 void getRate(double[] state, double[] rate)
          Gets the rate of change using the argument's state variables.
 double[] getState()
          Gets the state.
 double[] getXCoordinates()
          Gets the x coordinates during the eigenstate computation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ERROR

public static final int NO_ERROR
See Also:
Constant Field Values

DID_NOT_CONVERGE

public static final int DID_NOT_CONVERGE
See Also:
Constant Field Values

INSUFFICIENT_NUMBER_OF_POINTS

public static final int INSUFFICIENT_NUMBER_OF_POINTS
See Also:
Constant Field Values
Constructor Detail

Eigenstate

public Eigenstate(Function potential,
                  int numberOfPoints,
                  double xmin,
                  double xmax)
Constructs an Eigenstate using the given potential function and the given x-domain.

Method Detail

getEigenstate

public double[] getEigenstate(int qnumber)
Gets the energy eigenfuntion for the given quantum number.

Parameters:
qnumber - quantum number
Returns:
double[] the eigenstate

getXCoordinates

public double[] getXCoordinates()
Gets the x coordinates during the eigenstate computation.

Returns:
double[]

getErrorCode

public int getErrorCode()
Gets the error code for the last eigenstate computation.

Returns:
int

getState

public double[] getState()
Gets the state. The state for the ode solver is phi, d phi/dx, x.

Specified by:
getState in interface ODE
Returns:

getRate

public void getRate(double[] state,
                    double[] rate)
Description copied from interface: ODE
Gets the rate of change using the argument's state variables. This method may be invoked many times with different intermediate states as an ODESolver is carrying out the solution.

Specified by:
getRate in interface ODE
Parameters:
state - the state array
rate - the rate array