|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensourcephysics.numerics.Root
Class Root defines various root finding algorithms. This class cannot be subclassed or instantiated because all methods are static.
Method Summary | |
static double |
bisection(Function f,
double x1,
double x2,
double tol)
Implements the bisection method for finding the root of a function. |
static double[][] |
cubic(double a,
double b,
double c,
double d)
Solves for the roots of the cubic equation ax3+bx2+cx+d=0. |
static double |
newton(Function f,
double x,
double tol)
Implements Newton's method for finding the root of a function. |
static double |
newton(Function f,
Function df,
double x,
double tol)
Implements Newton's method for finding the root of a function. |
static double[][] |
quadratic(double a,
double b,
double c)
Solves for the complex roots of the quadratic equation ax2+bx+c=0. |
static double[] |
quadraticReal(double a,
double b,
double c)
Solves for the real roots of the quadratic equation ax2+bx+c=0. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static double[] quadraticReal(double a, double b, double c)
a
- double quadratic term coefficientb
- double linear term coefficientc
- double constant term
public static double[][] quadratic(double a, double b, double c)
a
- double quadratic term coefficientb
- double linear term coefficientc
- double constant term
public static double[][] cubic(double a, double b, double c, double d)
a
- double cubic term coefficientb
- double quadratic term coefficientc
- double linear term coefficientd
- double constant term
public static double newton(Function f, double x, double tol)
f
- Function the functionx
- double guess the roottol
- double computation tolerance
public static double newton(Function f, Function df, double x, double tol)
f
- Function the functiondf
- Function the derivative of the functionx
- double guess the roottol
- double computation tolerance
public static double bisection(Function f, double x1, double x2, double tol)
f
- Function the functionx1
- double lowerx2
- double uppertol
- double computation tolerance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |