* SPICE netlist
VctrA VctrA 0 SINE({Vtri/2} {Vctr} {f1} 0 0 0)
VctrB VctrB 0 SINE({Vtri/2} {Vctr} {f1} 0 0 120)
VctrC VctrC 0 SINE({Vtri/2} {Vctr} {f1} 0 0 -120)
B1 N002 0 V= if(V(VctrA)>=V(tri),1,0)
E1 N003 N008 N002 0 1
S1 A N001 N003 N008 SW
B2 N011 0 V= if(V(VctrA)<V(tri),1,0)
E2 N012 N017 N011 0 1
B3 N004 0 V= if(V(VctrB)>=V(tri),1,0)
E3 N005 N009 N004 0 1
B4 N013 0 V= if(V(VctrB)<V(tri),1,0)
E4 N014 N018 N013 0 1
B5 N006 0 V= if(V(VctrC)>=V(tri),1,0)
E5 N007 N010 N006 0 1
B6 N015 0 V= if(V(VctrC)<V(tri),1,0)
E6 N016 N019 N015 0 1
V1 N001 0 314
V2 N021 N022 SINE(0 75 {f1} 0 0 0)
R1 A N020 2
L1 N020 N021 10m
V3 N024 N022 SINE(0 75 {f1} 0 0 120)
R2 B N023 2
L2 N023 N024 10m
V4 N026 N022 SINE(0 75 {f1} 0 0 -120)
R3 C N025 2
L3 N025 N026 10m
V5 tri 0 PULSE(0 {Vtri} 0 {1/(2*Fs)} {1/(2*Fs)} 0 {1/Fs})
S2 0 A N012 N017 SW
S3 B N001 N005 N009 SW
S4 0 B N014 N018 SW
S5 C N001 N007 N010 SW
S6 0 C N016 N019 SW
.param f1=50
.param Fs= 1k
.param Vtri=1
.param ma=0.95
.param Vctr= 0.5*Vtri*ma
.tran 0 100m 41m
.four {f1} I(L1)

* LTspice schematic (.asc)
Version 4.1
SHEET 1 2160 752
WIRE -1048 -360 -1080 -360
WIRE -184 -360 -680 -360
WIRE 376 -360 -184 -360
WIRE 952 -360 376 -360
WIRE -1080 -328 -1080 -360
WIRE -360 -296 -440 -296
WIRE -232 -296 -312 -296
WIRE -184 -296 -184 -360
WIRE 200 -296 120 -296
WIRE 328 -296 248 -296
WIRE 376 -296 376 -360
WIRE 776 -296 696 -296
WIRE 904 -296 824 -296
WIRE 952 -296 952 -360
WIRE -360 -280 -360 -296
WIRE -232 -280 -232 -296
WIRE 200 -280 200 -296
WIRE 328 -280 328 -296
WIRE 776 -280 776 -296
WIRE 904 -280 904 -296
WIRE -680 -248 -680 -280
WIRE -1080 -232 -1080 -248
WIRE -360 -216 -360 -232
WIRE -360 -216 -440 -216
WIRE -232 -216 -232 -232
WIRE -232 -216 -312 -216
WIRE 200 -216 200 -232
WIRE 200 -216 120 -216
WIRE 328 -216 328 -232
WIRE 328 -216 248 -216
WIRE 776 -216 776 -232
WIRE 776 -216 696 -216
WIRE 904 -216 904 -232
WIRE 904 -216 824 -216
WIRE -1048 -200 -1080 -200
WIRE -440 -200 -440 -216
WIRE 120 -200 120 -216
WIRE 696 -200 696 -216
WIRE -1080 -168 -1080 -200
WIRE -184 -168 -184 -216
WIRE -72 -168 -184 -168
WIRE 376 -168 376 -216
WIRE 504 -168 376 -168
WIRE 952 -168 952 -216
WIRE 1080 -168 952 -168
WIRE -360 -120 -440 -120
WIRE -232 -120 -312 -120
WIRE -184 -120 -184 -168
WIRE 200 -120 120 -120
WIRE 328 -120 248 -120
WIRE 376 -120 376 -168
WIRE 776 -120 696 -120
WIRE 904 -120 824 -120
WIRE 952 -120 952 -168
WIRE -360 -104 -360 -120
WIRE -232 -104 -232 -120
WIRE 200 -104 200 -120
WIRE 328 -104 328 -120
WIRE 776 -104 776 -120
WIRE 904 -104 904 -120
WIRE -1080 -72 -1080 -88
WIRE -1048 -40 -1080 -40
WIRE -360 -40 -360 -56
WIRE -360 -40 -440 -40
WIRE -232 -40 -232 -56
WIRE -232 -40 -312 -40
WIRE 200 -40 200 -56
WIRE 200 -40 120 -40
WIRE 328 -40 328 -56
WIRE 328 -40 248 -40
WIRE 776 -40 776 -56
WIRE 776 -40 696 -40
WIRE 904 -40 904 -56
WIRE 904 -40 824 -40
WIRE -440 -24 -440 -40
WIRE 120 -24 120 -40
WIRE 696 -24 696 -40
WIRE -1080 -8 -1080 -40
WIRE -184 -8 -184 -40
WIRE 376 -8 376 -40
WIRE 952 -8 952 -40
WIRE -1080 88 -1080 72
WIRE -168 104 -200 104
WIRE 8 104 -88 104
WIRE 152 104 88 104
WIRE 376 104 232 104
WIRE 552 152 536 152
WIRE 536 184 536 152
WIRE -168 232 -200 232
WIRE 8 232 -88 232
WIRE 152 232 88 232
WIRE 376 232 376 104
WIRE 376 232 232 232
WIRE 536 280 536 264
WIRE -168 360 -200 360
WIRE 8 360 -88 360
WIRE 152 360 88 360
WIRE 376 360 376 232
WIRE 376 360 232 360
FLAG -1080 -232 0
FLAG -1080 -72 0
FLAG -1080 88 0
FLAG -1048 -360 VctrA
FLAG -1048 -200 VctrB
FLAG -1048 -40 VctrC
FLAG -680 -248 0
FLAG -184 -8 0
FLAG 376 -8 0
FLAG 952 -8 0
FLAG 504 -168 B
FLAG 1080 -168 C
FLAG -200 232 B
FLAG -200 360 C
FLAG 552 152 tri
FLAG 536 280 0
FLAG -440 -200 0
FLAG -440 -24 0
FLAG 120 -200 0
FLAG 120 -24 0
FLAG 696 -200 0
FLAG 696 -24 0
FLAG -72 -168 A
FLAG -200 104 A
SYMBOL voltage -1080 -344 R0
SYMATTR InstName VctrA
SYMATTR Value SINE({Vtri/2} {Vctr} {f1} 0 0 0)
SYMBOL voltage -1080 -184 R0
SYMATTR InstName VctrB
SYMATTR Value SINE({Vtri/2} {Vctr} {f1} 0 0 120)
SYMBOL voltage -1080 -24 R0
SYMATTR InstName VctrC
SYMATTR Value SINE({Vtri/2} {Vctr} {f1} 0 0 -120)
SYMBOL bv -440 -312 R0
SYMATTR InstName B1
SYMATTR Value V= if(V(VctrA)>=V(tri),1,0)
SYMBOL e -312 -312 R0
SYMATTR InstName E1
SYMATTR Value 1
SYMBOL sw -184 -200 M180
SYMATTR InstName S1
SYMBOL bv -440 -136 R0
SYMATTR InstName B2
SYMATTR Value V= if(V(VctrA)<V(tri),1,0)
SYMBOL e -312 -136 R0
SYMATTR InstName E2
SYMATTR Value 1
SYMBOL bv 120 -312 R0
SYMATTR InstName B3
SYMATTR Value V= if(V(VctrB)>=V(tri),1,0)
SYMBOL e 248 -312 R0
SYMATTR InstName E3
SYMATTR Value 1
SYMBOL bv 120 -136 R0
SYMATTR InstName B4
SYMATTR Value V= if(V(VctrB)<V(tri),1,0)
SYMBOL e 248 -136 R0
SYMATTR InstName E4
SYMATTR Value 1
SYMBOL bv 696 -312 R0
SYMATTR InstName B5
SYMATTR Value V= if(V(VctrC)>=V(tri),1,0)
SYMBOL e 824 -312 R0
SYMATTR InstName E5
SYMATTR Value 1
SYMBOL bv 696 -136 R0
SYMATTR InstName B6
SYMATTR Value V= if(V(VctrC)<V(tri),1,0)
SYMBOL e 824 -136 R0
SYMATTR InstName E6
SYMATTR Value 1
SYMBOL voltage -680 -376 R0
SYMATTR InstName V1
SYMATTR Value 314
SYMBOL voltage 136 104 R270
SYMATTR InstName V2
SYMATTR Value SINE(0 75 {f1} 0 0 0)
SYMBOL res -184 120 R270
SYMATTR InstName R1
SYMATTR Value 2
SYMBOL ind -8 120 R270
SYMATTR InstName L1
SYMATTR Value 10m
SYMBOL voltage 136 232 R270
SYMATTR InstName V3
SYMATTR Value SINE(0 75 {f1} 0 0 120)
SYMBOL res -184 248 R270
SYMATTR InstName R2
SYMATTR Value 2
SYMBOL ind -8 248 R270
SYMATTR InstName L2
SYMATTR Value 10m
SYMBOL voltage 136 360 R270
SYMATTR InstName V4
SYMATTR Value SINE(0 75 {f1} 0 0 -120)
SYMBOL res -184 376 R270
SYMATTR InstName R3
SYMATTR Value 2
SYMBOL ind -8 376 R270
SYMATTR InstName L3
SYMATTR Value 10m
SYMBOL voltage 536 168 R0
SYMATTR InstName V5
SYMATTR Value PULSE(0 {Vtri} 0 {1/(2*Fs)} {1/(2*Fs)} 0 {1/Fs})
SYMBOL sw -184 -24 M180
SYMATTR InstName S2
SYMBOL sw 376 -200 M180
SYMATTR InstName S3
SYMBOL sw 376 -24 M180
SYMATTR InstName S4
SYMBOL sw 952 -200 M180
SYMATTR InstName S5
SYMBOL sw 952 -24 M180
SYMATTR InstName S6