Jarroba Tools · Calculation

v0.3.2
io.github.Invarato/jarroba-tools-calc Checked 2 days ago Published 9 days ago

Maths a model gets wrong: units with dimensional checking, equations, sheets.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

calc_eval

Evaluate a mathematical expression WITH UNITS and dimensional checking: "100 km/h to m/s", "5 km + 300 m", "70 kg to lbs", "det([[1,2],[3,4]])". Adding incompatible units is an error, not a silent number. Also flags results that are not finite (NaN, infinity).

ParameterTypeDescription
expression *stringe.g. "100 km/h to m/s" or "sqrt(2)^2 + 2^10"

calc_solve

Solve an equation in one unknown ("x^2 - 5x + 6 = 0", "sin(x) = 0.5") or a linear system (one equation per line). Says whether the answer is EXACT or an approximation, and over which interval it searched. Never invents a root it did not find.

ParameterTypeDescription
equations *stringOne equation, or several separated by newlines for a system
fromnumberLower bound for the numeric search
tonumberUpper bound for the numeric search
unknownstringWhich variable to solve for (guessed if omitted)

calc_sheet

Evaluate a multi-line calculation sheet and return the result of EVERY line. Variables carry downwards, units travel with the value, "#" starts a comment, "ans" is the previous result, and an error stays on its own line instead of killing the sheet. Declare currencies with "# @moneda USD = 1.08 EUR". Good for checking a quote or a budget line by line.

ParameterTypeDescription
sheet *stringOne expression per line, e.g. "width = 3.5 m height = 2.4 m area = width * height"
as_markdownbooleanAlso return the sheet as a Markdown table

calc_derive

Differentiate an expression symbolically, exactly: "x^3 + 2x", "sin(x)*cos(x)", "x^x". Keeps units, so d/dx (3 m * x) is "3 m" and not 3. Can take higher-order derivatives and evaluate the result at a point. Says which name it read as a unit, and refuses to answer "0" when the variable is not in the expression.

ParameterTypeDescription
expression *stringe.g. "x^3 + 2x" or "9.8 m/s^2 * t^2 / 2"
atnumberAlso evaluate the derivative at this value of the variable
orderinteger1 = first derivative, 2 = second… up to 4
variablestringDifferentiate with respect to this (guessed if omitted)

calc_steps

Show the WORKED STEPS of a calculation, verified step by step: a linear or quadratic equation, a derivative (naming which rule applies), or Gaussian elimination on a linear system row by row. Each step comes with the name of the rule used. When it cannot explain a case it says so (covered: false) instead of inventing a plausible-looking derivation — useful when you have to show your work to a person.

ParameterTypeDescription
input *stringAn equation ("2x + 6 = 0"), an expression to differentiate ("sin(x)*x^2"), or one equation per line for a system
kindstringWhat to explain
variablestringThe unknown or the variable to differentiate by (guessed if omitted)