|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--freegraph.EquationSolver
class with static functions to find solutions to equations using either Newton's Method or Bisection techniques.
| Constructor Summary | |
EquationSolver()
|
|
| Method Summary | |
static double |
bisection(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double low,
double high,
double tolerance,
char solveFor)
attempts to solve the equation expr1=exrp2 using bisection looking between low and high |
static void |
main(java.lang.String[] args)
|
static double |
newton(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double value,
double tolerance,
double slopeLimit,
char solveFor)
attempts to zero in on a solution using Newtons equation solving technique. |
static double |
repeatBisection(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double low,
double high,
double tolerance,
char solveFor)
attempts to solve the equation expr1=exrp2 using bisection repeatedly by moving trying various starting points. |
static double |
repeatNewton(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double value,
double tolerance,
double slopeLimit,
char solveFor)
attempts to solve the equation expr1=exrp2 using Newton's method and repeatedly moving to different starting points looking for an answer. |
static double |
xintercept(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double value,
double tolerance,
double slopeLimit,
char solveFor)
returns the X-Intercept of the tangent to the equation expr1=expr2 at value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public EquationSolver()
| Method Detail |
public static double repeatNewton(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double value,
double tolerance,
double slopeLimit,
char solveFor)
throws NoSolutionException
expr1 - the left side of the equation.expr2 - the rigth side of the equation.value - the x value.tolerance - the tolerance of the solution (how close to the actual
answer must the result be)slopeLimit - the difference in x values used in estimating the
slope of the line
NoSolutionException - if no solution can be found
public static double newton(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double value,
double tolerance,
double slopeLimit,
char solveFor)
throws NoSolutionException
expr1 - the left side of the equation.expr2 - the rigth side of the equation.value - the x value.tolerance - the tolerance of the solution (how close to the actual
answer must the result be)slopeLimit - the difference in x values used in estimating the
slope of the line
NoSolutionException - if no solution can be found
public static double repeatBisection(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double low,
double high,
double tolerance,
char solveFor)
throws NoSolutionException
expr1 - the left side of the equation.expr2 - the rigth side of the equation.low - the low value to start in the bisectionhigh - the high value to start in the bisectiontolerance - the tolerance of the solution (how close to the actual
answer must the result be)
NoSolutionException - if no solution can be found
public static double bisection(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double low,
double high,
double tolerance,
char solveFor)
throws NoSolutionException
expr1 - the left side of the equation.expr2 - the rigth side of the equation.low - the low value to start in the bisectionhigh - the high value to start in the bisectiontolerance - the tolerance of the solution (how close to the actual
answer must the result be)
NoSolutionException - if no solution can be found
public static double xintercept(ExpressionEvaluator expr1,
ExpressionEvaluator expr2,
double value,
double tolerance,
double slopeLimit,
char solveFor)
throws freegraph.EquationSolver.SolutionFound
expr1 - the left side of the equation.expr2 - the rigth side of the equation.tolerance - the tolerance of the solution (how close to the actual
answer must the result be)slopeLimit - the difference in x values used in estimating the
slope of the line
SolutionFound - is the xintercept is a solution to the equation
expr1=expr2 within tolerance.
freegraph.EquationSolver.SolutionFoundpublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||