AngouriMath
Navigation
AngouriMath.Functions.Algebra.AnalyticalSolving
Classes within the AngouriMath.Functions.Algebra.AnalyticalSolving namespace
AnalyticalEquationSolver
AnalyticalInequalitySolver
CommonDenominatorSolver
ExponentialSolver
FractionedPolynoms
LambertWSolver
Summary
K (alpha x + beta) b^(gamma x + delta) = c , a linear function times an exponential of
another, solved by the Lambert W function. https://github.com/asc-community/AngouriMath/issues/2182
Remarks
Writtene^((gamma x + delta) ln b) , the exponent isu = g x + d , and with
s = beta g / alpha - d the equation is(u + s) e^(u + s) = A ,
A = c g e^s / (K alpha) , sou + s = W(A) andx = W(A) / g - beta / alpha .
Over the complex numbers every branch is a root,W_n for a wholen , as a periodic
equation's roots are written. Over the reals two branches can be:W_0 where
A >= -1/e andW_(-1) where-1/e <= A < 0 , and none where
A < -1/e , sincew e^w >= -1/e for every realw .
LinearSystemSolver
Summary
A linear system with fewer equations than unknowns, answered as the family of all its
solutions: the unknowns a row reduction leaves free become parameters, and the rest are
written in terms of them.
#212Remarks
2x - 4y = 12 forx andy is the issue's own example. It has
infinitely many solutions and one degree of freedom, so the answer is a single row
[12/2 + 2t, t] rather than a list of them, and thet in it is a variable
the caller did not name.
The answer type did not need changing, which is why this is small. A solution is a
row of Matrix whose i-th entry is the i-th unknown's value, and nothing
says those entries may not mention a variable. The same device already carries the
constant of integration out of the ODE solver, and
InSolveSystem(System.Collections.Generic.List{AngouriMath.Entity},System.ReadOnlySpan{AngouriMath.Entity.Variable},AngouriMath.Entity,AngouriMath.Core.Budgets.BudgetLedger) already mints onet for the single case
where its recursion bottoms out unconstrained
(#550).
Reached only where the count is short, which is the one shape that had no answer
at all —SolveSystem threwWrongNumberOfArgumentsException for it before
reaching any elimination. A square system that is rank-deficient is left to the
eliminator, which already answers it; taking those here as well would change answers that
are not wrong.
Rational coefficients on the unknowns, and that is a soundness requirement rather than
a convenience. Row reduction has to decide whether a pivot is zero, and the general
test available here is structural —Matrix.ReducedRowEchelonForm asks
a == 0 , which an expression that is zero everywhere without being written as
0 fails. Choosing such a pivot divides by zero and produces a wrong family rather
than no answer. Over the rationals the question is decidable, so it is asked there. The
constant term is under no such restriction: it is never a pivot, so
2x - 4y = k is answered withk symbolic.
LogarithmSolver
Summary
An equation linear in logarithms of polynomials to one base,
k_1 log_b(P_1) + ... + k_n log_b(P_n) = c with rationalk_i and at least two
logarithms, solved by exponentiating.
Remarks
Every root makesb to either side the same, so it is a root of
P_1^(k_1 L) ... P_n^(k_n L) = b^(c L) , forL the common denominator of the
k_i : a polynomial equation, with finitely many roots, which holds at every root of the
original. The converse does not hold. Over the complex numberslog(u) + log(v) is
log(u v) only up to a multiple of2 pi i , and a factor can be zero, so each
candidate is put back into the equation as written, under the principal logarithm, and kept
only where it holds.ln(x) + ln(x + 1) = 0 isx (x + 1) = 1 , whose roots are
(-1 +- sqrt(5)) / 2 ; at the negative one both logarithms carryi pi and their sum
is2 pi i , so the answer is{ (sqrt(5) - 1) / 2 } . Newton's method answered it
in decimals, andln(1 + 3x^2) - ln(4x) = 1 with one of its two roots.
ModulusSolver
Summary
Equations in moduli: where one is real for every complexx , how one in moduli of
polynomials is solved over the reals, and how one in and out of moduli, conjugates, real
and imaginary parts is solved over the complex numbers.
Remarks
Over the complex numbers|x - 2| = |x - 3| holds on the whole line
Re x = 5/2 : both sides are real whateverx is, so the equation is one real
condition on the two real unknownsx is made of, and what solves it is a curve. A
numerical search finds points of it and would answer them as the set. Over the reals the
same equation isx = 5/2 , found by cases: between two neighbouring kinks every
modulus has one sign, and the equation there has no moduli.
https://github.com/asc-community/AngouriMath/issues/1573
NonSquareSystemSolver
Summary
A system with more or fewer equations than unknowns that neither the triangularisation nor
LinearSystemSolver takes, such asx^2 + y^2 = 1 forx and
y , orsin(x) = 0 andx = 0 forx . Each unknown is eliminated in
turn, an unknown that nothing is left to constrain becomes a parameter, and every family
found is substituted back into every equation.
#212Remarks
An answer is given only where it is shown to hold. The elimination trusts each solve
it makes, and a solve can answer for a case its equation does not cover. So each family is
kept only where every equation, with the family substituted, simplifies to0 . A family
that says where it holds is checked there:sqrt(y) = x is solved fory as
x^2 providedx is wheresqrt takes its values, andsqrt(t^2) - t is zero wherever that holds.
A decline declines the whole system. An equation left with no unknown in it is zero,
a number away from zero, or neither as far as can be told, like(a + b)/2 - c . A
branch where one is away from zero has no solutions and is dropped. A branch where one
cannot be told gives no answer for the system, rather than leaving the other branches to
read as all of its solutions.
A square system does not come here. It is the eliminator's in
InSolveSystem(System.Collections.Generic.List{AngouriMath.Entity},System.ReadOnlySpan{AngouriMath.Entity.Variable},AngouriMath.Entity,AngouriMath.Core.Budgets.BudgetLedger), whose answers this would change.
PolynomialSignTable
Summary
p(x) > 0 for a univariate polynomial overQ of any degree, answered by
the sign ofp between consecutive real roots.
Remarks
A polynomial has one sign on each open interval between consecutive real roots, so the
answer is the union of those intervals where the sign is positive. Everything hard is
in the word *consecutive*: the intervals are only the answer if the list of real roots
is complete, and a missed root merges two intervals of opposite sign into one
and reports the wrong half of it as the solution. So this refuses wherever completeness
cannot be established, rather than answering from whatever roots were found.
Completeness is established algebraically and in two steps. First
FactorPrimitive(AngouriMath.Functions.IntegerPolynomial) writes the polynomial as a
product of powers of irreducibles overQ , and it verifies that the factors
multiply back to what it was given — so every real root of the whole is a real root of
exactly one factor, an irreducible being square-free and two distinct irreducibles
being coprime. Second, the number of real roots of each factor is read off its
Discriminant(AngouriMath.Functions.MultivariatePolynomial,System.Int32,System.Collections.Generic.IReadOnlyList{System.Int32}): a factor of degree two has two real
roots where its discriminant is positive and none where it is negative, and one of
degree three has three and one respectively. A factor of degree four needs two more
quantities alongside the discriminant, and there is no such criterion at five — nor a
formula for the roots — which is where this stops. That count is what makes a root
list a complete root list rather than a list of the roots that happened to come back.
The roots themselves come from the solver reached through SolveEquation ,
which is exact, and their order is decided numerically, which is not. So the
ordering is checked rather than trusted: the sign of the polynomial at an exact
rational point in each interval is computed in exact integer arithmetic, and the
resulting sequence has to change sign at every root of odd multiplicity and keep it at
every root of even multiplicity. A misordered or merged root shows up as a sequence
that does not, and is refused. The two outermost sample points are placed beyond
Cauchy's bound, so no root can lie outside the sampled range.
Part of the polynomial layer of
#746, item 43 —
and the consumer that the resultant was waiting for.
PolynomialSolver
Summary
Solves all forms of Polynomials that are trivially solvedStatementSolver
ThresholdSearch
Summary
{ n in ZZ : 2^n > n^2 } , an inequality with an exponential or a factorial over
the whole numbers, is searched over a window from the least member and its tails are
proved: the members are the points of the window where it holds, and the whole numbers
from the start of the final run where the quantifier decides it holds there -- by
induction, which is how Sullivan and Mackey do it (Ex 5.3.2:{0, 1} \/ ZZ /\ [5; +oo) ).
OverZZ the other tail is proved the same way, downwards. A tail the quantifier
leaves undecided leaves the set as written: a window is evidence about the window.
https://github.com/asc-community/AngouriMath/issues/1409
TrigonometricSolver
Angouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 5629 pages online