Here is an example circuit from the DC-DC folder that I’ve modified to add a resetting integral so that a cycle by cycle calculation of the switching and conduction losses can be seen.

The switch voltage and current is multiplied and then a resetting integrator is used. The integral is reset by the gating waveform on the rising edge.

I am using the level two MOSFET and I’ve added some lead inductance to model typically package inductance.

test - MOSFET switching loss calculation(IRFS4310).psimsch (57.2 KB)