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/2defines a constant. Define at most 12 constants. Constants can refer topi(π),tau,e, or earlier constants, but not toθ.plot current = gain * sin(θ) color tealdefines a named trace. Define at most six traces. Use+,-,*,/,^, and parentheses. Available colors:copper,blue,teal,gold,pink, andviolet.θ,theta, andxrepresent the plot angle in radians. Angle literals include90°,1.5708 rad, and100 gon(or100 grad). Usepi/2for 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.