Calculeaf Features Blog Guide Pricing Open app

Given and solve

A Given/solve block finds values that satisfy several equations at once. Use the Math tab Solve block buttons: Given (tooltip: Given — opens a solve block. Constraints below (using =) are solved together by solve(...)) and solve (tooltip: solve(a, b, …) — solves the simultaneous equations above for the listed unknowns. Use guess values to control which root is found (default 0).).

A Given block with two constraint regions and a solve(x, y) result.
Guesses, Given, one constraint per region, then solve. The roots write back into those names.

Workflow

  1. Assign guess values above the block. They pick the root; default is 0 if you omit them.
  2. Insert Given in its own math region (Math tab → Solve block, or type Given). That opens the block.
  3. Below it, write one constraint per region. Use = or == between the two sides. Do not put a trailing “show result” equals on a constraint line.
  4. In a later region, insert solve or type solve(a, b) with the unknown names. The count of names must match the count of equations.
  5. Evaluate. solve writes the roots back into those names and closes the block.
x := 1
y := 1
Given
x + y = 10
x - y = 2
solve(x, y) =

Errors

Messages start with solve:. Typical causes:

  • No Given block open above this solve.
  • No equations — each constraint needs a top-level = or ==.
  • Wrong number of unknowns for the number of constraints.
  • The solver did not converge — change the guesses.

What is not a Given block

solve(A, b) on a matrix is linear algebra — see Matrices and vectors. A lone trailing = on a normal assignment still means “show the result”. Inside a Given block, a top-level = is a constraint.