<solveEquations>
<solveEquations> numerically finds solutions of one or more equations
in one variable. It evaluates the difference between the two sides of each
equation across numDiscretizationPoints sample points, identifies sign
changes, and refines each candidate to a numerical root.
The result is a list of solutions, exposed through the solutions property
and numSolutions. Because the solver is numerical, it can find roots that
have no closed form, but it has the usual caveats: nearby roots, very flat
crossings, and roots outside the search range may be missed.
Attributes and Properties
Attributes for <solveEquations>
Other (4)
number. Upper bound of the variable's search range.
number. Lower bound of the variable's search range.
number. Default value: 100. Number of points used when searching for solutions numerically.
variables[ _variableNameList ]. Names of the variables to solve for.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <solveEquations name="s">
Other (9)
$s.disabledboolean. Whether this component is disabled and cannot be interacted with.
$s.fixedboolean. Whether this component's value is fixed and cannot be modified.
$s.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$s.numDiscretizationPointsnumber. Number of points used when searching for solutions numerically.
$s.numSolutionsinteger. The number of numerical solutions found.
$s.solutions[ math ]. The numerical solutions of the equations.
$s.variable_variableName. The first variable being solved for.
$s.variables[ _variableName ]. The variables of the equations.
Common to all components (4)
$s.doenetMLtext. The DoenetML source code that produced this component.
$s.hideboolean. Whether to hide this component from the rendered output.
$s.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$s.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Roots of a polynomial
The equation is parsed from the children. numSolutions counts the
solutions found; solutions is the list of root values.
Example: User-entered equation
The equation and the variable are taken from <mathInput>. The
variables attribute names the variable to solve for, defaulting to x when
omitted.
Attribute Examples
Attribute Example: minVar, maxVar
minVar and maxVar set the search range. Roots outside that interval are
not returned. When the attributes are omitted, the solver defaults to
. (That default is currently a fallback applied inside the
solver, not a value advertised on the attribute descriptors, so it does not
appear in the attributes table above.)
Attribute Example: numDiscretizationPoints
numDiscretizationPoints controls how densely the search range is sampled
when looking for sign changes. For oscillatory equations the default may
under-sample; increasing this value catches more roots at the cost of
performance.