Class ImprovedSchrodinger
java.lang.Object
|
+--Schrodinger
|
+--ImprovedSchrodinger
- class ImprovedSchrodinger
- extends Schrodinger
A version of the Schrodinger class where all solution data is
automatically cached, and the potential function may be changed more easily.
Some unnecessary generalisation has been removed to improve performance.
For instance, it is assumed that the potential function does not change as a
function of time.
|
Field Summary |
protected SolnCache |
cache
A cache of the values of the potential function |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
cache
protected SolnCache cache
- A cache of the values of the potential function
ImprovedSchrodinger
public ImprovedSchrodinger(Function f)
- Creates a new Schrodinger solver
- Parameters:
fn - The potential function
solve
public void solve(double x,
double h,
double[] vals)
- Description copied from interface: Solvable
- Requests that the supplied array be filled with solution data. The
nth element of the array should be the solution at x =
x0 + step*n.
- Overrides:
- solve in class Schrodinger
- Tags copied from interface: Solvable
- Parameters:
x0 - The initial x-valuestep - The increment to be applied to x0vals - The array which will hold the solution data
setPotentialFunction
public void setPotentialFunction(Function f)
- Overrides:
- setPotentialFunction in class Schrodinger