clear all
close all

%https://www.infineon.com/dgdl/Infineon-IPA95R130PFD7-DataSheet-v02_01-EN.pdf?fileId=8ac78c8c81ae03fc0181f72507e62e68


fs = 100e3;         %Switching frequency [Hz]
n = 12;
V_in_max = 600;     %Maximum input voltage [V]
Ip_rms = 3;         %Primary RMS Current [A]
R_DS = 0.13;        %Drain-Source-Resistance [Ohm]
C_oss = 53e-12;     %Output Capacitance [F]
V_DS_meas = 400;    %Drain-Source-Voltage during measurement of Coss [V]
C_oss_avg = C_oss*sqrt(V_DS_meas/V_in_max); %Average output capacitance [F]
Q_g = 141e-9;        %Total gate charge [nC]
V_GS = 10;          %Applied Gate Voltage [V]

%Calculate losses
P_cond = power(Ip_rms,2)*R_DS;  %Conduction Losses [W]
P_cap = Q_g*V_GS*fs;            %Capacitive switching losses [W]
P_loss = 4*(P_cond+P_cap);      %Losses of the full bridge [W]

%Calculate Shim Inductor
Ipp = 4.4;                   %Peak to Peak primary Current at 300W and 600V [A]
dI_L = 5.1;                  %Output Inductor ripple [A]
Ls_min = 2*C_oss_avg*power(V_in_max/((Ipp-dI_L/n)/2),2);  %Necessary leakage inductance [H]






