nerdamer/solve
Equation solvers, system solvers, solution containers, and solver options.
nerdamer/solve. For the functions you write inside nerdamer('...'), see the function reference.Functions
roots(input: ExpressionInput, variable?: ExpressionInput, method?: ExpressionInput): VectorFunctionReturns 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): SolutionSetFunctionSolves 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[]): VectorFunctionSolves 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
MultivariateSolverClassFinds real solutions to systems of equations using numerical methods. For certain systems involving sine and cosine, the equations show that exactly one real solution exists. The solver first tries a starting point derived from those equations. Otherwise, or if that attempt fails, it tries several starting points and collects the distinct solutions it finds.
PolynomialSolverClassFinds all complex roots of a univariate polynomial numerically. Coefficient arrays use ascending powers: the element at index k is the coefficient of x^k. Expression, Polynomial, and string inputs are converted directly to numerical complex coefficients before solving. Linear and quadratic inputs are handled directly; higher degrees use simultaneous Aberth iteration followed by Newton refinement. Jenkins–Traub can be selected explicitly for real coefficients without changing the default. Exact real-rational inputs with repeated factors use square-free decomposition to preserve their root multiplicities.
SolutionSetClassA finite set of solution descriptors with solver-specific metadata.
SymbolicSolverClassClass exported by Nerdamer.
Interfaces
FunctionSolverOptions: unknownInterfaceOptions for numerical root searches over a fixed interval with FunctionSolver.
MultivariateSolverOptions: unknownInterfaceControls where the solver starts and how long it tries to find each solution.
Root: unknownInterfaceMetadata returned by a single numerical root-refinement attempt.
APIs
PolynomialMethod: "aberth" | "jenkinsTraub"APIAvailable numerical polynomial algorithms. Aberth remains the default.
SolutionForm: "finite" | "parametric" | "all"APIDescribes whether the stored descriptors represent finite solutions, indexed families, or all values.
SolutionsType: "numeric" | "symbolic" | "mixed" | undefinedAPIDescribes whether accepted solutions were produced by numerical strategies, symbolic strategies, or both.
