JavaScript / TypeScript API

nerdamer/solve

Equation solvers, system solvers, solution containers, and solver options.

Import from nerdamer/solve. For the functions you write inside nerdamer('...'), see the function reference.
13 exports

Functions

roots(input: ExpressionInput, variable?: ExpressionInput, method?: ExpressionInput): VectorFunction

Returns polynomial roots as a Vector. Unlike solve(), which returns a SolutionSet with solver metadata, this function preserves the roots API's Vector return type. Numeric constants retain the historical square-root interpretation. Univariate polynomials delegate to PolynomialSolver and therefore return numerical roots. An optional third argument selects aberth (default) or jenkinstraub.

solve(input: Equation | ExpressionInput, variable?: ExpressionInput, onInterval?: Vector | FunctionSolverOptions, recursion?: SolveRecursionContext): SolutionSetFunction

Solves an equation or finds the zeros of an expression in one variable. The solver normalizes the input to expression = 0, tries direct symbolic transformations, factors numerator and denominator, and then applies symbolic, polynomial-numeric, and limited-range function-numeric strategies to the factors. Zeros of denominator factors are excluded from the result.

solveSystem(equations: Vector | Equation | ExpressionInput | Equation | ExpressionInput[], variables?: string[]): VectorFunction

Solves a system of expressions or equations for an ordered set of variables. Expressions are interpreted as equal to zero. The solver first tries exact linear reduction, then a lexicographic Groebner basis with symbolic back substitution for polynomial systems. For one-variable systems with multiple equations, it exactly intersects supported rational-pi sine/cosine families and otherwise verifies finite univariate candidates before falling back to multivariate Newton-Raphson over a fixed search interval. Rational polynomial systems may have denominators cleared for symbolic work; candidates are checked against the original domain.

Classes

Interfaces

APIs