_SolveSystem
it.grypho.scala.leonardo.equation._SolveSystem
case class _SolveSystem(equations: _Expression, variables: List[_Variable]) extends _Expression
AST node for solveSystem(equations, v1, v2, ...) in the grammar.
equations is expected to be a _Matrix whose elements are _Equation nodes -- e.g. [[2*x + y = 5, x + 3*y = 10]]. After the REPL substitutes any named matrix binding, eval extracts the equations and delegates to solveSystem.
The solve variables are binders (excluded from children / substitute traversal), exactly as in _Derivative and _Integral -- solving for x does not substitute x itself.
eval result shape (mirrors _Solve):
- no solution (singular, nonlinear, ...) ->
Left(this)(stays symbolic) - single variable ->
Left(v = expr) - multiple variables ->
Left([[v1 = e1, v2 = e2, ...]])
toString is "solveSystem(equations, v1, v2, ...)" -- round-trips through the parser.
Value parameters
- equations
-
a
_Matrixexpression whose elements must be _Equation nodes - variables
-
the solve variables (binders -- excluded from
children)
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait _Expressionclass Objecttrait Matchableclass Any
Members list
In this article