* Z:\home\khalils\Downloads\files\data\raw_asc\3db7d43a9a20_dc_dc_buck_boost_raw_deriv.asc
* Generated by LTspice 26.0.1 for Windows.
* .op
R1 out 0 {RL}
C2 out 0 {mcg(Cwy, CwyTOL)}
D2 0 Ul1 D
S2 0 Ul2 Vp 0 KLUCZ
C1 in 0 100n
B1 drv 0 V=ddt(V(out))
B2 drvi 0 I=ddt(I(L1))
V4 Vp 0 PULSE(0 12 0 1n 1n {D*T} {T})
L1 Ul1 Ul2 {mcg(L, LTOL)}
D3 Ul2 out D
V1 in 0 12
S1 in Ul1 Vp 0 KLUCZ
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.tran 0 21m 19m startup
.param T=10u
.param RL=10
.param D=.59
.model KLUCZ SW(Ron=.1 Roff=1Meg Vt=1 Vh=0 Lser=0 Vser=0)
.param Cwy=680u
.param CwyTOL=0.2
.param L=330u
.param LTOL=0.15
.step param run 1 100 1
.func mcg(nomin, tol) = nomin*(1+gauss(tol/3))
.meas tran Irms_L RMS I(B2)
.meas tran Urms_L RMS V(Ul1,Ul2)
.meas tran L1_eff PARAM Urms_L/Irms_L
.meas TRAN Us_C2 RMS V(drv)
.meas tran Is_C2 RMS I(C2)
.meas tran C2_eff PARAM Is_C2/Us_C2
.options plotwinsize=0
.options method=gear
.options maxstep=1u
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2408 680
WIRE 64 -176 16 -176
WIRE 144 -176 64 -176
WIRE 320 -176 224 -176
WIRE 464 -176 320 -176
WIRE 672 -176 544 -176
WIRE 832 -176 672 -176
WIRE 1040 -176 896 -176
WIRE 1152 -176 1040 -176
WIRE 1184 -176 1152 -176
WIRE 1472 -144 1472 -176
WIRE 1728 -144 1728 -192
WIRE 320 -128 320 -176
WIRE 672 -128 672 -176
WIRE 64 -112 64 -176
WIRE 1040 -112 1040 -176
WIRE 1152 -112 1152 -176
WIRE -384 -80 -384 -128
WIRE -272 -80 -272 -128
WIRE 64 -32 64 -48
WIRE 160 -32 160 -128
WIRE 160 -32 64 -32
WIRE 624 -16 624 -64
WIRE 672 -16 672 -48
WIRE 672 -16 624 -16
WIRE 64 0 64 -32
WIRE 320 0 320 -64
WIRE 672 0 672 -16
WIRE 1040 0 1040 -48
WIRE 1152 0 1152 -32
WIRE 1472 0 1472 -64
WIRE 1728 0 1728 -64
WIRE -384 48 -384 0
WIRE -272 48 -272 0
IOPIN 1184 -176 Out
IOPIN -384 -128 In
IOPIN 208 -128 In
IOPIN 624 -112 In
IOPIN 16 -176 In
IOPIN -272 -128 In
IOPIN 320 -176 Out
IOPIN 672 -176 Out
SYMBOL diode 336 -64 R180
WINDOW 0 24 64 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName D2
SYMBOL bi 1728 -144 R0
SYMATTR InstName B2
SYMATTR Value I=ddt(I(L1))
SYMBOL voltage -384 -96 R0
WINDOW 3 -194 209 Invisible 2
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 0 -68 62 Left 2
SYMATTR Value PULSE(0 12 0 1n 1n {D*T} {T})
SYMATTR InstName V4
SYMBOL voltage -272 -96 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL cap 48 -112 R0
SYMATTR InstName C1
SYMATTR Value 100n
SYMBOL sw 672 -32 M180
WINDOW 3 36 73 Left 2
SYMATTR Value KLUCZ
SYMATTR InstName S2
SYMBOL cap 1024 -112 R0
WINDOW 3 -245 50 Left 2
SYMATTR Value {mcg(Cwy, CwyTOL)}
SYMATTR InstName C2
SYMBOL bv 1472 -160 R0
SYMATTR InstName B1
SYMATTR Value V=ddt(V(out))
SYMBOL res 1136 -128 R0
WINDOW 0 45 44 Left 2
SYMATTR InstName R1
SYMATTR Value {RL}
SYMBOL diode 832 -160 R270
WINDOW 0 32 32 VTop 2
WINDOW 3 0 32 VBottom 2
SYMATTR InstName D3
SYMBOL ind 448 -160 R270
WINDOW 0 39 -11 VTop 2
WINDOW 3 68 101 VBottom 2
SYMATTR InstName L1
SYMATTR Value {mcg(L, LTOL)}
SYMBOL sw 128 -176 R270
SYMATTR InstName S1
SYMATTR Value KLUCZ
FLAG -272 48 0
FLAG 320 0 0
FLAG 1184 -176 out
FLAG 1040 0 0
FLAG 1152 0 0
FLAG -384 48 0
FLAG 672 0 0
FLAG -384 -128 Vp
FLAG 208 -128 Vp
FLAG 624 -112 Vp
FLAG 16 -176 in
FLAG -272 -128 in
FLAG 64 0 0
FLAG 320 -176 Ul1
FLAG 672 -176 Ul2
FLAG 1472 -176 drv
FLAG 1472 0 0
FLAG 1728 0 0
FLAG 1728 -192 drvi
TEXT -496 -264 Left 2 !.tran 0 21m 19m startup
TEXT 352 184 Left 2 !.param T=10u
TEXT 352 216 Left 2 !.param RL=10
TEXT 352 152 Left 2 !.param D=.59
TEXT -496 -304 Left 2 ;.op
TEXT -496 152 Left 2 !.model KLUCZ SW(Ron=.1 Roff=1Meg Vt=1 Vh=0 Lser=0 Vser=0)
TEXT 576 144 Left 2 !.param Cwy=680u
TEXT 576 176 Left 2 !.param CwyTOL=0.2
TEXT 576 208 Left 2 !.param L=330u
TEXT 576 240 Left 2 !.param LTOL=0.15
TEXT -496 -232 Left 2 !.step param run 1 100 1
TEXT -496 184 Left 2 !.func mcg(nomin, tol) = nomin*(1+gauss(tol/3))
TEXT 928 144 Left 2 !.meas tran Irms_L RMS I(B2)            \n.meas tran Urms_L RMS V(Ul1,Ul2)                                \n.meas tran L1_eff PARAM Urms_L/Irms_L
TEXT 928 248 Left 2 !.meas TRAN Us_C2 RMS V(drv)\n.meas tran Is_C2   RMS I(C2)
TEXT 928 304 Left 2 !.meas tran C2_eff  PARAM Is_C2/Us_C2
TEXT 360 328 Left 2 !.options plotwinsize=0
TEXT 360 360 Left 2 !.options method=gear
TEXT 360 392 Left 2 !.options maxstep=1u