Function reference · Solving

solveSystem

Solves a system of equations and returns the solution assignments.

Nerdamer can solve linear symbolic systems and supported nonlinear polynomial systems. The JavaScript / TypeScript API uses solveSystem(...), while Nerdamer Notation uses solveeqs(...).

The JavaScript / TypeScript form can also receive an explicit variable order.

Examples

These examples use Nerdamer Notation.

Solve a two-equation linear system through Nerdamer Notation.

solveeqs([x+y=3,x-y=1])
// → [{x => 2, y => 1}]

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API · Direct API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

solveeqs(arg1)

nerdamer.solveSystem

Call the operation through the default nerdamer import.

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

Parameters

NameTypeDescription
equationsVector | ExpressionInput | Equation[]Vector or array of equations and zero-valued expressions.
variablesstring[]Optional variable order. When omitted, variables are collected from the normalized expressions.

Returns

Vector — A Vector of solution dictionaries keyed by variable name.

Browse the nerdamer API →

Direct JavaScript / TypeScript API

Import the operation directly from its package entry point.

import { solveSystem } from 'nerdamer/solve';
solveSystem(equations: Vector | ExpressionInput | Equation[], variables?: string[]): Vector

Parameters

NameTypeDescription
equationsVector | ExpressionInput | Equation[]Vector or array of equations and zero-valued expressions.
variablesstring[]Optional variable order. When omitted, variables are collected from the normalized expressions.

Returns

Vector — A Vector of solution dictionaries keyed by variable name.

Browse nerdamer/solve

Notes

  • Systems whose solutions are not isolated, or unsupported underdetermined nonlinear systems, may throw rather than return incomplete assignments.

Aliases

solveeqs

← Back to Reference