Skip to main content
Start new scripts with numelectscript 2. Existing numelectscript 1 scripts still run; use the current header if you add geometry. Use one command per line. Begin comments with #. Put settings inside a phase block, for example phase 3 {, and close it with }.

Phase and display settings

Formulas, constants, and colors

  • let gain = 1/2 defines a constant. Define at most 12 constants. Constants can refer to pi (π), tau, e, or earlier constants, but not to θ.
  • plot current = gain * sin(θ) color teal defines a named trace. Define at most six traces. Use +, -, *, /, ^, and parentheses. Available colors: copper, blue, teal, gold, pink, and violet.
  • θ, theta, and x represent the plot angle in radians. Angle literals include 90°, 1.5708 rad, and 100 gon (or 100 grad). Use pi/2 for an exact radian expression.
  • Simple trig traces can use voltage or current units, for example plot voltage = 120 V * sin(θ - 30°). The lab normalizes these traces by unit group. General formulas are unitless and plot their calculated values.
numerator(6/8) returns 3, and numerator(-0.75) returns -3. The result is undefined if no fraction with a denominator up to 1,000,000 matches within rounding tolerance and the normal numeric limits.

Geometry commands