AngouriMath
AngouriMath.Functions.Algebra.AnalyticalSolving
Classes within the AngouriMath.Functions.Algebra.AnalyticalSolving namespace
AnalyticalEquationSolver
AnalyticalInequalitySolver
CommonDenominatorSolver
ExponentialSolver
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.
ModulusSolver
Summary
Equations in moduli: where one is real for every complexx , and how one in moduli of
linear functions is solved over the reals.
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
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-2023 · Project's repo · Site's repo · Octicons · Transparency · 4405 pages online