Scripting reference · Nerdamer Language
evaluate
Evaluates a value now, optionally with values for its variables.
With one argument, it evaluates numerically. With a dictionary such as {x=>2}, it uses those values for this call only. With a list of variables and a list of values, it does the same faster when you evaluate many points.
Scripting
evaluate(value[, substitutions]) | evaluate(value, variables, point)
Write it in a script: nerdamer('evaluate(sin(2))'), or in the Playground.
Parameters
value- An expression, equation, vector, matrix, set or solution set.
substitutions- Optional. A dictionary of values, such as
{x=>2}. variables- In the three-argument form: a vector of variables.
point- In the three-argument form: a vector of their values, in the same order.
Examples
Pick one solution from a periodic family by giving _n a value.
sol: solve(sin(x),x); evaluate(sol,{_n=>0})
// → {0}Open in PlaygroundGood to know
- The values apply to this call only. They don't assign the variables, so
{_n=>0}works even though_n:0is an error. - If it can't evaluate further,
evaluatereturns its input unchanged. - To store a value first, assign it with
:;=makes an equation.
