diffeqsolver.java
来自「一个一元曲线多项式数值演示例子」· Java 代码 · 共 43 行
JAVA
43 行
package numbercruncher.mathutils;
/**
* The base class for differential equation solvers.
*/
public abstract class DiffEqSolver {
/** the differential equation to solve */
protected DifferentialEquation equation;
/** the initial condition data point */
protected DataPoint initialCondition;
/** current x value */
protected float x;
/** current y value */
protected float y;
/**
* Constructor.
* @param equation the differential equation to solve
*/
public DiffEqSolver(DifferentialEquation equation) {
this.equation = equation;
this.initialCondition = equation.getInitialCondition();
reset();
}
/**
* Reset x and y to the initial condition data point.
*/
public void reset() {
this.x = initialCondition.x;
this.y = initialCondition.y;
}
/**
* Return the next data point in the
* approximation of the solution.
* @param h the width of the interval
*/
public abstract DataPoint nextPoint(float h);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?