Package org.matheclipse.core.polynomials
Class QuarticSolver
- java.lang.Object
-
- org.matheclipse.core.polynomials.QuarticSolver
-
public class QuarticSolver extends Object
Solve polynomial equations up to fourth degree (Solve(a*x^4+b*x^3+c*x^2+d*x+e==0,x)
).See Wikipedia - Quadratic equation See Wikipedia - Cubic function See Wikipedia - Quartic equation
TODO not completly tested. Especially if a division through zero occurs.
-
-
Constructor Summary
Constructors Constructor Description QuarticSolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IASTAppendable
biQuadraticSolve(IExpr a, IExpr c, IExpr e, IExpr sum)
Solve the bi-quadratic expression.static IASTAppendable
biQuadraticSolve(IExpr a, IExpr c, IExpr e, IExpr sum, boolean createSet, boolean sort)
Solve the bi-quadratic expression.static IASTAppendable
createSet(IASTAppendable result)
static IASTAppendable
cubicSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr additionalSolution)
Solve(a*x^3+b*x^2+c*x+d==0,x)
.static IASTAppendable
cubicSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr additionalSolution, boolean createSet, boolean sort)
Solve(a*x^3+b*x^2+c*x+d==0,x)
.static IASTAppendable
evalAndSort(IASTAppendable result, boolean sort)
static IASTAppendable
quadraticSolve(IExpr a, IExpr b, IExpr c)
Solve(a*x^2+b*x+c==0,x)
.static IASTAppendable
quadraticSolve(IExpr a, IExpr b, IExpr c, boolean createSet)
Solve(a*x^2+b*x+c==0,x)
.static IASTAppendable
quadraticSolve(IExpr a, IExpr b, IExpr c, boolean createSet, boolean sort)
Solve(a*x^2+b*x+c==0,x)
.static IASTAppendable
quadraticSolve(IExpr a, IExpr b, IExpr c, IExpr solution1, IExpr solution2)
Solve(a*x^2+b*x+c==0,x)
.static IASTAppendable
quadraticSolve(IExpr a, IExpr b, IExpr c, IExpr solution1, IExpr solution2, boolean createSet, boolean sort)
Solve(a*x^2+b*x+c==0,x)
.static IASTAppendable
quarticSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr e)
Solve(a*x^4+b*x^3+c*x^2+d*x+e==0,x)
.static IASTAppendable
quarticSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr e, boolean createSet, boolean sort)
Solve(a*x^4+b*x^3+c*x^2+d*x+e==0,x)
.static IAST
quarticSolveN(IExpr a, IExpr b, IExpr c, IExpr d, IExpr e)
static IASTAppendable
quasiSymmetricQuarticSolve(IExpr a, IExpr b, IExpr c)
Solve the special case of a "Quasi-symmetric equation"Solve(a*x^4+b*x^3+c*x^2+b*x+a==0,x)
.static IASTAppendable
quasiSymmetricQuarticSolve(IExpr a, IExpr b, IExpr c, boolean createSet, boolean sort)
Solve the special case of a "Quasi-symmetric equation"Solve(a*x^4+b*x^3+c*x^2+b*x+a==0,x)
.static IASTMutable
solve(IExpr exprPoly, IExpr x)
static IASTMutable
solve(IExpr exprPoly, IExpr x, boolean createSet, boolean sort)
static IASTMutable
sortASTArguments(IASTMutable resultList)
Sort the arguments of a list.
-
-
-
Method Detail
-
solve
public static IASTMutable solve(IExpr exprPoly, IExpr x) throws ArithmeticException
- Throws:
ArithmeticException
-
solve
public static IASTMutable solve(IExpr exprPoly, IExpr x, boolean createSet, boolean sort) throws ArithmeticException
- Throws:
ArithmeticException
-
quarticSolve
public static IASTAppendable quarticSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr e)
Solve(a*x^4+b*x^3+c*x^2+d*x+e==0,x)
. See Wikipedia - Quartic equation- Parameters:
a
- coefficient forx^4
b
- coefficient forx^3
c
- coefficient forx^2
d
- coefficient forx
e
- coefficient for1
- Returns:
-
quarticSolve
public static IASTAppendable quarticSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr e, boolean createSet, boolean sort)
Solve(a*x^4+b*x^3+c*x^2+d*x+e==0,x)
. See Wikipedia - Quartic equation- Parameters:
a
- coefficient forx^4
b
- coefficient forx^3
c
- coefficient forx^2
d
- coefficient forx
e
- coefficient for1
createSet
- delete duplicates from result list- Returns:
-
cubicSolve
public static IASTAppendable cubicSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr additionalSolution)
Solve(a*x^3+b*x^2+c*x+d==0,x)
. See Wikipedia - Cubic function- Parameters:
a
- coefficient forx^3
b
- coefficient forx^2
c
- coefficient forx
d
- coefficient for1
additionalSolution
- ann additional solution, which should be appended to the result- Returns:
-
cubicSolve
public static IASTAppendable cubicSolve(IExpr a, IExpr b, IExpr c, IExpr d, IExpr additionalSolution, boolean createSet, boolean sort)
Solve(a*x^3+b*x^2+c*x+d==0,x)
. See Wikipedia - Cubic function- Parameters:
a
- coefficient forx^3
b
- coefficient forx^2
c
- coefficient forx
d
- coefficient for1
additionalSolution
- ann additional solution, which should be appended to the result- Returns:
-
createSet
public static IASTAppendable createSet(IASTAppendable result)
-
evalAndSort
public static IASTAppendable evalAndSort(IASTAppendable result, boolean sort)
-
quadraticSolve
public static IASTAppendable quadraticSolve(IExpr a, IExpr b, IExpr c)
Solve(a*x^2+b*x+c==0,x)
. See Wikipedia - Quadratic equation- Parameters:
a
-b
-c
-- Returns:
-
quadraticSolve
public static IASTAppendable quadraticSolve(IExpr a, IExpr b, IExpr c, boolean createSet)
Solve(a*x^2+b*x+c==0,x)
. See Wikipedia - Quadratic equation- Parameters:
a
-b
-c
-createSet
-- Returns:
-
quadraticSolve
public static IASTAppendable quadraticSolve(IExpr a, IExpr b, IExpr c, boolean createSet, boolean sort)
Solve(a*x^2+b*x+c==0,x)
. See Wikipedia - Quadratic equation- Parameters:
a
-b
-c
-createSet
-sort
- the result- Returns:
-
quadraticSolve
public static IASTAppendable quadraticSolve(IExpr a, IExpr b, IExpr c, IExpr solution1, IExpr solution2)
Solve(a*x^2+b*x+c==0,x)
. See Wikipedia - Quadratic equation- Parameters:
a
- coefficient forx^2
b
- coefficient forx
c
- coefficient for1
solution1
- possible first solution fromcubicSolve(IExpr, IExpr, IExpr, IExpr, IExpr)
solution2
- possible second solution fromcubicSolve(IExpr, IExpr, IExpr, IExpr, IExpr)
- Returns:
-
quadraticSolve
public static IASTAppendable quadraticSolve(IExpr a, IExpr b, IExpr c, IExpr solution1, IExpr solution2, boolean createSet, boolean sort)
Solve(a*x^2+b*x+c==0,x)
. See Wikipedia - Quadratic equation- Parameters:
a
- coefficient forx^2
b
- coefficient forx
c
- coefficient for1
solution1
- possible first solution fromcubicSolve(IExpr, IExpr, IExpr, IExpr, IExpr)
solution2
- possible second solution fromcubicSolve(IExpr, IExpr, IExpr, IExpr, IExpr)
createSet
- delete duplicate values in the resultsortResult
- sort the result values- Returns:
-
biQuadraticSolve
public static IASTAppendable biQuadraticSolve(IExpr a, IExpr c, IExpr e, IExpr sum)
Solve the bi-quadratic expression.Solve(a*x^4+bc*x^2+e==0,x)
.See Bronstein 1.6.2.4
- Parameters:
a
-c
-e
-sum
-- Returns:
-
biQuadraticSolve
public static IASTAppendable biQuadraticSolve(IExpr a, IExpr c, IExpr e, IExpr sum, boolean createSet, boolean sort)
Solve the bi-quadratic expression.Solve(a*x^4+bc*x^2+e==0,x)
.See Bronstein 1.6.2.4
- Parameters:
a
-c
-e
-sum
-createSet
-- Returns:
-
quasiSymmetricQuarticSolve
public static IASTAppendable quasiSymmetricQuarticSolve(IExpr a, IExpr b, IExpr c)
Solve the special case of a "Quasi-symmetric equation"Solve(a*x^4+b*x^3+c*x^2+b*x+a==0,x)
. See Wikipedia - Quartic equation. See Bronstein 1.6.2.4- Parameters:
a
- coefficient forx^4
andx
b
- coefficient forx^3
andx
c
- coefficient forx^2
- Returns:
-
quasiSymmetricQuarticSolve
public static IASTAppendable quasiSymmetricQuarticSolve(IExpr a, IExpr b, IExpr c, boolean createSet, boolean sort)
Solve the special case of a "Quasi-symmetric equation"Solve(a*x^4+b*x^3+c*x^2+b*x+a==0,x)
. See Wikipedia - Quartic equation. See Bronstein 1.6.2.4- Parameters:
a
- coefficient forx^4
andx
b
- coefficient forx^3
andx
c
- coefficient forx^2
- Returns:
-
sortASTArguments
public static IASTMutable sortASTArguments(IASTMutable resultList)
Sort the arguments of a list.- Parameters:
resultList
- assumed to be of typeList()
- Returns:
- sorted
resultList
-
-