when the current flows through the mosfet from source to drain through the body diode, how to calculate the power loss due to diode? in IRF 540, forward voltage of the body diode is given as 1.5 V. can we calculate Ploss=Vf * Iavg?
I'd suggest to determine dynamic resistance of a diode Rd around it's expected operating point and then assess the power loss as: Pd=Id^2(rms)*Rd+Id(avg)*Vf. You would need to estimate diode switching losses, too depending on the switching frequency and a topology you use.