* D:\Documents\Sims\LTSpice\2026\05 - May\15\fogal-simplified.asc
* Generated by LTspice 24.1.9 for Windows.
R3 N005 N003 {boo}
Vgen N011 N010 SINE(0 {input} {freq}) Rser={res}
R4 N005 N011 {boo}
R5 0 N010 {SJ}
Q1 N005 N002 N004 0 2SCR542F3
R6 0 N006 {SJ}
L2 N007 N003 {Ltri} Rser={Ltri}
L1 N006 N001 {Ltri} Rser={Ltri}
L3 N008 N009 {Ltri} Rser={Ltri}
R9 N005 N007 {SJ}
R8 N005 N009 {SJ}
R7 N008 0 {SJ}
R1 N001 N002 {SJ}
R2 N002 N003 {SJ}
R10 0 N004 1.675
.model NPN NPN
.model PNP PNP
.lib C:\Users\vinya\AppData\Local\LTspice\lib\cmp\standard.bjt
.param input = 1m
.param Ltri = 7m
.param freq = 5e5
.param res = 10m
.param boo = 1.7e4
.param sj = 100u
.param tA = 0
.param tB = 2.74ms
K123 L1 L2 L3 -0.6
.options reltol = 1e-4
.options plotwinsize=0
.tran {tB}
.include "D:\Documents\Sims\LTSpice\2026\05 - May\15\power.inc"
; ============================================================
;  AUTOMATED POWER + DISTORTION ANALYSIS (RES, L, Q1, SOURCES)
; ============================================================
; ===================== RESISTORS R1–R9 =====================
.meas P_R1   AVG ( V(N001,N002)*I(R1) ) FROM tA TO tB
.meas Vr_R1  RMS V(N001,N002)           FROM tA TO tB
.meas Ir_R1  RMS I(R1)                  FROM tA TO tB
.meas S_R1   PARAM PwrApparent(Vr_R1, Ir_R1)
.meas Q_R1   PARAM PwrReactive(S_R1, P_R1)
.meas D_R1   PARAM sqrt(S_R1*S_R1 - P_R1*P_R1 - Q_R1*Q_R1)
.meas PctD_R1 PARAM 100*D_R1/S_R1
.meas P_R2   AVG ( V(N002,N003)*I(R2) ) FROM tA TO tB
.meas Vr_R2  RMS V(N002,N003)           FROM tA TO tB
.meas Ir_R2  RMS I(R2)                  FROM tA TO tB
.meas S_R2   PARAM PwrApparent(Vr_R2, Ir_R2)
.meas Q_R2   PARAM PwrReactive(S_R2, P_R2)
.meas D_R2   PARAM sqrt(S_R2*S_R2 - P_R2*P_R2 - Q_R2*Q_R2)
.meas PctD_R2 PARAM 100*D_R2/S_R2
.meas P_R3   AVG ( V(N005,N003)*I(R3) ) FROM tA TO tB
.meas Vr_R3  RMS V(N005,N003)           FROM tA TO tB
.meas Ir_R3  RMS I(R3)                  FROM tA TO tB
.meas S_R3   PARAM PwrApparent(Vr_R3, Ir_R3)
.meas Q_R3   PARAM PwrReactive(S_R3, P_R3)
.meas D_R3   PARAM sqrt(S_R3*S_R3 - P_R3*P_R3 - Q_R3*Q_R3)
.meas PctD_R3 PARAM 100*D_R3/S_R3
.meas P_R4   AVG ( V(N005,N011)*I(R4) ) FROM tA TO tB
.meas Vr_R4  RMS V(N005,N011)           FROM tA TO tB
.meas Ir_R4  RMS I(R4)                  FROM tA TO tB
.meas S_R4   PARAM PwrApparent(Vr_R4, Ir_R4)
.meas Q_R4   PARAM PwrReactive(S_R4, P_R4)
.meas D_R4   PARAM sqrt(S_R4*S_R4 - P_R4*P_R4 - Q_R4*Q_R4)
.meas PctD_R4 PARAM 100*D_R4/S_R4
.meas P_R5   AVG ( V(N010)*V(N010)/SJ )  FROM tA TO tB
.meas Vr_R5  RMS V(N010)                 FROM tA TO tB
.meas S_R5   PARAM ( Vr_R5*Vr_R5/SJ )
.meas Q_R5   PARAM PwrReactive(S_R5, P_R5)
.meas D_R5   PARAM sqrt(S_R5*S_R5 - P_R5*P_R5 - Q_R5*Q_R5)
.meas PctD_R5 PARAM 100*D_R5/S_R5
.meas P_R6   AVG ( V(N006)*V(N006)/SJ )  FROM tA TO tB
.meas Vr_R6  RMS V(N006)                 FROM tA TO tB
.meas S_R6   PARAM ( Vr_R6*Vr_R6/SJ )
.meas Q_R6   PARAM PwrReactive(S_R6, P_R6)
.meas D_R6   PARAM sqrt(S_R6*S_R6 - P_R6*P_R6 - Q_R6*Q_R6)
.meas PctD_R6 PARAM 100*D_R6/S_R6
.meas P_R7   AVG ( V(N008)*V(N008)/SJ ) FROM tA TO tB
.meas Vr_R7  RMS V(N008)                FROM tA TO tB
.meas S_R7   PARAM ( Vr_R7*Vr_R7/SJ )
.meas Q_R7   PARAM PwrReactive(S_R7, P_R7)
.meas D_R7   PARAM sqrt(S_R7*S_R7 - P_R7*P_R7 - Q_R7*Q_R7)
.meas PctD_R7 PARAM 100*D_R7/S_R7
.meas P_R8   AVG ( V(N005,N009)*I(R8) ) FROM tA TO tB
.meas Vr_R8  RMS V(N005,N009)           FROM tA TO tB
.meas Ir_R8  RMS I(R8)                  FROM tA TO tB
.meas S_R8   PARAM PwrApparent(Vr_R8, Ir_R8)
.meas Q_R8   PARAM PwrReactive(S_R8, P_R8)
.meas D_R8   PARAM sqrt(S_R8*S_R8 - P_R8*P_R8 - Q_R8*Q_R8)
.meas PctD_R8 PARAM 100*D_R8/S_R8
.meas P_R9   AVG ( V(N005,N007)*I(R9) ) FROM tA TO tB
.meas Vr_R9  RMS V(N005,N007)           FROM tA TO tB
.meas Ir_R9  RMS I(R9)                  FROM tA TO tB
.meas S_R9   PARAM PwrApparent(Vr_R9, Ir_R9)
.meas Q_R9   PARAM PwrReactive(S_R9, P_R9)
.meas D_R9   PARAM sqrt(S_R9*S_R9 - P_R9*P_R9 - Q_R9*Q_R9)
.meas PctD_R9 PARAM 100*D_R9/S_R9
.meas P_R10   AVG ( V(N008)*V(N008)/SJ ) FROM tA TO tB
.meas Vr_R10  RMS V(N008)                FROM tA TO tB
.meas S_R10   PARAM ( Vr_R10*Vr_R10/SJ )
.meas Q_R10   PARAM PwrReactive(S_R10, P_R10)
.meas D_R10   PARAM sqrt(S_R10*S_R10 - P_R10*P_R10 - Q_R10*Q_R10)
.meas PctD_R10 PARAM 100*D_R10/S_R10
; ===================== INDUCTORS L1–L3 =====================
.meas P_L1  AVG ( V(N006,N001)*I(L1) ) FROM tA TO tB
.meas Vr_L1 RMS V(N006,N001)           FROM tA TO tB
.meas Ir_L1 RMS I(L1)                  FROM tA TO tB
.meas S_L1  PARAM PwrApparent(Vr_L1, Ir_L1)
.meas Q_L1  PARAM PwrReactive(S_L1, P_L1)
.meas D_L1  PARAM sqrt(S_L1*S_L1 - P_L1*P_L1 - Q_L1*Q_L1)
.meas PctD_L1 PARAM 100*D_L1/S_L1
.meas P_L2  AVG ( V(N007,N003)*I(L2) ) FROM tA TO tB
.meas Vr_L2 RMS V(N007,N003)           FROM tA TO tB
.meas Ir_L2 RMS I(L2)                  FROM tA TO tB
.meas S_L2  PARAM PwrApparent(Vr_L2, Ir_L2)
.meas Q_L2  PARAM PwrReactive(S_L2, P_L2)
.meas D_L2  PARAM sqrt(S_L2*S_L2 - P_L2*P_L2 - Q_L2*Q_L2)
.meas PctD_L2 PARAM 100*D_L2/S_L2
.meas P_L3  AVG ( V(N008,N009)*I(L3) ) FROM tA TO tB
.meas Vr_L3 RMS V(N008,N009)           FROM tA TO tB
.meas Ir_L3 RMS I(L3)                  FROM tA TO tB
.meas S_L3  PARAM PwrApparent(Vr_L3, Ir_L3)
.meas Q_L3  PARAM PwrReactive(S_L3, P_L3)
.meas D_L3  PARAM sqrt(S_L3*S_L3 - P_L3*P_L3 - Q_L3*Q_L3)
.meas PctD_L3 PARAM 100*D_L3/S_L3
; ===================== FOGAL / SCR Q1 =====================
; Q1 N012 N007 N011 0
.meas P_Q1  AVG ( V(N004)*IE(Q1) + V(N002)*IB(Q1) + V(N005)*IC(Q1) ) FROM tA TO tB
.meas Vr_Q1 RMS ( V(N004) + V(N002) + V(N005) )
.meas Ir_Q1 RMS ( IE(Q1) + IB(Q1) + IC(Q1) )
.meas S_Q1  PARAM PwrApparent(Vr_Q1, Ir_Q1)
.meas Q_Q1  PARAM PwrReactive(S_Q1, P_Q1)
.meas D_Q1  PARAM sqrt(S_Q1*S_Q1 - P_Q1*P_Q1 - Q_Q1*Q_Q1)
.meas PctD_Q1 PARAM 100*D_Q1/S_Q1
; ===================== SOURCES =====================
; Vgen N031 N030
.meas P_Vgen  AVG ( V(N011,N010)*I(Vgen) ) FROM tA TO tB
.meas Vr_Vgen RMS V(N011,N010)             FROM tA TO tB
.meas Ir_Vgen RMS I(Vgen)                  FROM tA TO tB
.meas S_Vgen  PARAM PwrApparent(Vr_Vgen, Ir_Vgen)
.meas Q_Vgen  PARAM PwrReactive(S_Vgen, P_Vgen)
.meas D_Vgen  PARAM sqrt(S_Vgen*S_Vgen - P_Vgen*P_Vgen - Q_Vgen*Q_Vgen)
.meas PctD_Vgen PARAM 100*D_Vgen/S_Vgen
; ===================== GRAND TOTALS =====================
.meas P_grand PARAM P_R1+P_R2+P_R3+P_R4+P_R5+P_R6+P_R7+P_R8+P_R9+P_R10+P_L1+P_L2+P_L3+P_Vgen+P_Q1
.meas S_grand PARAM S_R1+S_R2+S_R3+S_R4+S_R5+S_R6+S_R7+S_R8+S_R9+S_R10+S_L1+S_L2+S_L3+S_Vgen+S_Q1
.meas Q_grand PARAM Q_R1+Q_R2+Q_R3+Q_R4+Q_R5+Q_R6+Q_R7+Q_R8+Q_R9+Q_L1+Q_L2+Q_L3+Q_Vgen+Q_Q1
; Distortion grand total
.meas D_grand PARAM sqrt(S_grand*S_grand - P_grand*P_grand - Q_grand*Q_grand)
.meas Pct_real       PARAM 100*P_grand/S_grand
.meas Pct_react      PARAM 100*Q_grand/S_grand
.meas Pct_distortion PARAM 100*D_grand/S_grand
.meas PF_grand       PARAM P_grand/S_grand
* R10 is the\nmotor con-\ntroller. It\nmust receive\n206A for ac-\ncelerating and\n50A for cruis-\ning a 2002,\nRAV4 EV.
.backanno
.end
