while((abs(Tj_HS_cicle - Tj_HS)/Tj_HS_cicle))>epsilon && (n_iter <= n_iter_max) || (n_iter<2)
n_iter = n_iter + 1;
Tj_HS_cicle = Tj_HS;
Rds_HS= Rds_25_HS*(1+dX_dT(1)*(Tj_HS_cicle-25));
Vth_HS= Vth_25_HS*(1+dX_dT(2)*(Tj_HS_cicle-25));
gfs_HS= gfs_25_HS*(1+dX_dT(3)*(Tj_HS_cicle-25));
IgON = (Vdr - Vth_HS - (Specifiche(13)/gfs_HS))/Rgtot;
IgOFF = (Vth_HS + (Specifiche(14)/gfs_HS))/Rgtot;
ton = Qgsw_HS / IgON;
toff = Qgsw_HS / IgOFF;
Psw = 0.5*(Specifiche(1)+Vf)*Specifiche(9)*(ton*Specifiche(13) + toff*Specifiche(14));
Pcond = Rds_HS*Specifiche(5)*(Specifiche(3)^2)*(1+(1/12)*((Specifiche(23)/Specifiche(3))^2));
P_Coss = 0.5*Coss*Specifiche(9)*(Specifiche(1)^2);
P_gate = Qg_HS * Specifiche(9) * Vdr;
Prr = Qrr_HS * Specifiche(9) * Specifiche(1);
Pd_HS = Prr + P_gate + P_Coss + Psw + Pcond;
Tj_HS = Ta + R_teta_ja*Pd_HS;
end;