Create multiple independent phasor diagram sets, each with its own equations, canvas, and oscilloscope. Variables defined in any set are available in all other sets for cross-referencing.
This version supports multiple independent phasor diagram sets. Click + Add Phasor Set to create a new set. Each set has its own equation editor, phasor canvas, oscilloscope, adjustment sliders, and computed values table.
Cross-set variable sharing: Variables defined in any equation set are automatically available in all other sets. For example, define Z1 = 0.0 + j0.15 in Set 1, then use Z1 freely in Set 2's equations. Cross-referenced variables appear with a purple badge in the computed values table showing their source set. Sets are evaluated in order (Set 1 first, then Set 2, etc.), with a two-pass evaluation that resolves forward references between sets.
Set management: Rename sets by clicking the title. Collapse/expand sets to save screen space. Duplicate a set to fork it. Delete sets you no longer need (at least one must remain).
Each line in the equation editor defines a phasor variable. The format is Name = expression. Variables defined on earlier lines can be used in later equations. Lines starting with # or // are comments.
You can also use |X| (vertical bars) to get the magnitude of a phasor inline, and the variable angle operator d < 120 treats the left side as a magnitude variable rather than a literal number — so if you change d with a slider, the angle stays fixed.
| Input Format | Example | Description |
|---|---|---|
| Polar | Vs = 1.0 ∠ 30 or Vs = 1.0 < 30 | Magnitude (RMS) and angle in degrees |
| Rectangular | Z = 3 + j4 or Z = 3 + 4j | Real + imaginary components |
| Pure imaginary | X = j0.3 or X = -j5 | Imaginary only |
| Pure real | R = 0.05 | Real scalar value |
| Operator | Example | Description |
|---|---|---|
A + B | Vs = VR + VX | Phasor addition |
A - B | Vr = Vs - Vdrop | Phasor subtraction |
A * B | Vdrop = Z * I | Phasor multiplication (magnitudes multiply, angles add) |
A / B | I = V / Z | Phasor division (magnitudes divide, angles subtract) |
A ^ n | Zbase = Vbase ^ 2 / Sbase | Complex power: |A|n at angle n·θ |
-A | I2 = -I1 | Negate (180° phase shift) |
j * X | VX = j * X * I | 90° rotation (multiply by √−1) |
| Function | Example | Description |
|---|---|---|
abs(A) or |A| | Imag = abs(I1) | Magnitude (returns real scalar) |
ang(A) | theta = ang(V1) | Angle in degrees (returns real scalar) |
re(A) | Px = re(S) | Real part (returns real scalar) |
im(A) | Qx = im(S) | Imaginary part (returns real scalar) |
conj(A) | S = V * conj(I) | Complex conjugate (negates angle) |
sqrt(A) | VLN = VLL / sqrt3 | Complex square root: √|A| at θ/2 |
pow(A, n) | Z2 = pow(Z, 2) | Complex power: |A|n at n·θ (same as A^n) |
proj(A, deg) | BfA = proj(Ia, 0) | Signed projection of phasor A onto an axis at the specified angle. Returns real scalar: positive = along axis, negative = opposite. Used for extracting radial field components in motor analysis. |
| Function | Example | Description |
|---|---|---|
sin(x) | y = sin(30) → 0.5 | Sine (input in degrees) |
cos(x) | PF = cos(36.87) → 0.8 | Cosine (input in degrees) |
tan(x) | slope = tan(45) → 1.0 | Tangent (input in degrees) |
asin(x) | deg = asin(0.5) → 30 | Inverse sine (returns degrees) |
acos(x) | deg = acos(0.8) → 36.87 | Inverse cosine (returns degrees) |
atan(x) | deg = atan(1) → 45 | Inverse tangent (returns degrees) |
atan2(y, x) | deg = atan2(1, 1) → 45 | Two-argument arctangent (returns degrees, resolves quadrant) |
| Function | Example | Description |
|---|---|---|
ln(x) | y = ln(2.718) → 1.0 | Natural logarithm (base e) |
log(x) | dB = 20 * log(Vout/Vin) | Base-10 logarithm |
exp(x) | y = exp(1) → 2.718 | Exponential (ex) |
These functions perform the standard symmetrical component transformations using multi-assignment syntax. Each call takes three phasor inputs and assigns all three outputs at once.
| Syntax | Description |
|---|---|
| Phase → Sequence (forward transform) | |
V0, V1, V2 = seq(Vag, Vbg, Vcg) | Decompose line-to-ground phase quantities into zero, positive, and negative sequence components. V0 = ⅓(Vag + Vbg + Vcg) V1 = ⅓(Vag + a·Vbg + a²·Vcg) V2 = ⅓(Vag + a²·Vbg + a·Vcg) |
| Sequence → Phase (inverse transform) | |
Vag, Vbg, Vcg = phase(V0, V1, V2) | Reconstruct line-to-ground phase quantities from sequence components. Vag = V0 + V1 + V2 Vbg = V0 + a²·V1 + a·V2 Vcg = V0 + a·V1 + a²·V2 |
Where a = 1∠120° and a² = 1∠240° are applied internally. Aliases: toseq(), abc2seq() for the forward transform; tophase(), seq2abc() for the inverse. The single-output functions seq0(), seq1(), seq2(), pha(), phb(), phc() are also still available.
Multi-assignment functions to convert between line-to-neutral (LN), line-to-line (LL), and line-to-ground (LG) voltages. All take three phasor inputs and return three phasor outputs.
| Syntax | Description |
|---|---|
| Line-Neutral ↔ Line-Line | |
Vab, Vbc, Vca = lntoll(Van, Vbn, Vcn) | LN → LL. Vab = Van − Vbn, Vbc = Vbn − Vcn, Vca = Vcn − Van |
Van, Vbn, Vcn = lltoln(Vab, Vbc, Vca) | LL → LN. Van = ⅓(Vab − Vca), etc. |
| Line-Ground ↔ Line-Line | |
Vab, Vbc, Vca = lgtoll(Vag, Vbg, Vcg) | LG → LL. Vab = Vag − Vbg, etc. (V0 cancels in subtraction) |
Vag, Vbg, Vcg = lltolg(Vab, Vbc, Vca, V0) | LL → LG. Requires V0 as 4th argument — cannot recover zero-sequence from LL alone. |
| Line-Ground ↔ Line-Neutral | |
Van, Vbn, Vcn = lgtoln(Vag, Vbg, Vcg) | LG → LN. Extracts V0 = ⅓(Vag+Vbg+Vcg), then Van = Vag − V0 |
Vag, Vbg, Vcg = lntolg(Van, Vbn, Vcn, V0) | LN → LG. Requires V0 as 4th argument — true LN voltages have zero-sequence removed. |
Key relationships: Line-to-ground = line-to-neutral + zero sequence. For a balanced system with no ground path, LG = LN. During ground faults, V0 ≠ 0 and LG ≠ LN. Converting to line-to-ground always requires V0 as a 4th argument because that information is lost in LN and LL quantities. Converting from line-to-ground can extract V0 internally. Line-to-line voltages are always the same whether computed from LN or LG because V0 cancels.
Example — SLG fault showing LG ≠ LN:
# Start with faulted phase voltages (line-to-ground) Vag = 0.0 < 0 Vbg = 1.12 < -128 Vcg = 1.12 < 128 # Extract line-to-neutral (removes V0) Van, Vbn, Vcn = lgtoln(Vag, Vbg, Vcg) # Line-to-line (same from either LG or LN) Vab, Vbc, Vca = lgtoll(Vag, Vbg, Vcg) # Get V0 for round-trip back to LG V0 = seq0(Vag, Vbg, Vcg) # Reconstruct LG from LN + V0 Vag2, Vbg2, Vcg2 = lntolg(Van, Vbn, Vcn, V0)
| Function | Example | Description |
|---|---|---|
pf(V, I) | PF = pf(Vag, Ia) | Power factor = cos(∠V − ∠I). Positive = lagging, negative = leading. |
power(V, I) | S = power(Vag, Ia) | Complex power S = V × I*. Real part = P (watts), imaginary part = Q (vars). |
preal(V, I) | Pw = preal(Vag, Ia) | Real power P = |V|·|I|·cos(θ). Returns scalar. |
qreactive(V, I) | Qv = qreactive(Vag, Ia) | Reactive power Q = |V|·|I|·sin(θ). Positive = lagging/inductive. |
s3p(Vln, I) | S3 = s3p(Vag, Ia) | Three-phase complex power = 3 × Vln × I*. Use line-to-neutral (or LG when V0 = 0). |
| Function | Example | Description |
|---|---|---|
pu(actual, base) | Vpu = pu(Vact, Vbase) | Convert to per-unit: actual / base. |
frompu(pu_val, base) | Vact = frompu(Vpu, Vbase) | Convert from per-unit: pu × base. |
zbase(Vbase, Sbase) | Zb = zbase(138000, 100e6) | Impedance base = Vbase² / Sbase. |
Plot circles on the phasor diagram for relay operating characteristics, zone boundaries, or any circular region. The circle is drawn as a dashed outline with a light fill, and the variable stores the center point as a phasor.
| Syntax | Description |
|---|---|
Name = circle(Zfar, Znear) | Mho circle — diameter from Znear to Zfar. For a standard mho element passing through the origin, use circle(Zreach, 0 < 0). |
Name = circle(Zcenter, radius) | Offset circle — centered at Zcenter with the given radius (a non-negative real scalar). Use for offset mho or any arbitrary circle. |
| Constant | Value | Usage |
|---|---|---|
pi or PI | 3.14159… | Circle constant. E.g. omega = 2 * pi * 60 |
e | 2.71828… | Euler's number. Base of natural logarithm. |
sqrt3 | 1.73205… | √3, used in three-phase conversions. E.g. VLL = VLN * sqrt3 |
j | 0 + j1 | Imaginary unit (√−1). Multiplying by j rotates 90°. |
:: SuffixAppend :: VarName to draw a phasor starting from the tip of another phasor (tail-to-tip placement). This is how voltage drop diagrams and sequence component sums are constructed. The phasor's computed value is unchanged — only its drawing position moves.
Vdrop = Z * I :: Vr | Draw Vdrop with its tail at the tip of Vr |
Z = 0.05 + j0.28 :: ds | Compute Z but don't draw it (hidden / "don't show") |
X = expr :: Vr ds | Anchor on Vr and also hide from diagram |
Ba = expr :: posA fixed | Exempt from animation rotation — stays on its axis. |
Van = expr :: d1 | Assign to diagram 1 in triple view. Use d2 or d3 for diagrams 2 and 3. |
Zflt = expr :: dot | Draw as a filled dot at the tip position instead of an arrow. |
Van = expr :: osc1 | Assign to oscilloscope 1. Use osc2, osc3, etc. to split traces. |
Every base variable (one that doesn't reference other phasors) gets angle and magnitude sliders. Drag the Angle slider to rotate a phasor ±180°. Drag the Magnitude slider to scale from 0× to 10× (logarithmic, with 0× at the bottom). All dependent variables recompute automatically. Click the per-variable reset button or "Reset All" to restore original values.
Click ▶ Animate to rotate all phasors counter-clockwise at the selected frequency (0.1–0.5 Hz). The entire phasor system rotates uniformly, preserving all relative angles. The oscilloscope updates in sync, showing how the instantaneous waveforms evolve. Click ⏸ Pause to freeze at the current angle.
Every phasor diagram and oscilloscope has a ⛶ expand button in the top-right corner. Click to open a fullscreen view.
Zoom & Pan (phasor only): Scroll wheel or +/− keys to zoom in/out. Click-drag or arrow keys to pan. Double-click to reset to auto-scale. Close with ✕, clicking the backdrop, or pressing Esc.
Click any preset button to load a pre-built example. Loading a preset resets all slider adjustments and stops animation.
Available presets: Lagging Load, Leading Load, 3φ System, Voltage Drop, PF Correction, Seq Components, SLG Fault, KVL Loop, Shunt Cap, Shunt Reactor, LL Fault, Seq↔Phase, Power Triangle, Phase Distance, Ground Distance.
Multi-set preset: Motor Field — demonstrates stator rotating field with proj() and :: fixed directives.
| Category | Functions |
|---|---|
| Phasor Operations | abs() ang() re() im() conj() sqrt() pow(A,n) proj(A,deg) |
| Trigonometric (degrees) | sin() cos() tan() asin() acos() atan() atan2(y,x) |
| Logarithmic / Exponential | ln() log() exp() |
| Sequence ↔ Phase | V0,V1,V2 = seq(Vag,Vbg,Vcg) Vag,Vbg,Vcg = phase(V0,V1,V2)Single-output: seq0() seq1() seq2() pha() phb() phc() |
| Voltage Conversions | lntoll() lltoln() — line-neutral ↔ line-linelgtoll() lltolg(…, V0) — line-ground ↔ line-linelgtoln() lntolg(…, V0) — line-ground ↔ line-neutral |
| Power Calculations | pf(V,I) power factor power(V,I) complex S = V×I*preal(V,I) real power P qreactive(V,I) reactive power Qs3p(Vln,I) three-phase complex power |
| Per-Unit Conversions | pu(actual,base) frompu(pu,base) zbase(Vbase,Sbase) |
| Circle (Relay Zones) | circle(Zfar, Znear) mho circle with diameter circle(Zcenter, radius) offset circle |
| Constants | pi e sqrt3 j |
Directives (::) | ds hide fixed lock axis dot point marker d1 d2 d3 triple diagram osc1 osc2 … oscilloscope group VarName tail placement |
Save all equation sets to a single text file, or load a previously saved file to restore all sets. The file uses ===SET: Title=== delimiters to separate each set's equations.
Shareable links: Click 🔗 Copy Shareable Link to generate a URL that encodes your current equations. Anyone who opens the link will see your exact diagram. You can also construct URLs manually:
?preset=phasedist — load a named preset
?eq=Vs%3D1.0%3C0%0AI%3D0.85%3C-32 — URL-encoded equations for a single set
#Vs%3D1.0%3C0%0AI%3D0.85%3C-32 — same but in the URL hash (not sent to server)
?title=My+Diagram&eq=... — optionally set the title with the title parameter
Links are automatically compressed with deflate (typically 40–70% shorter). Check Strip comments before generating to exclude comment lines and blank lines for even shorter URLs. The link box shows character count and compression ratio.