I am trying to simulate a bidirectional half bridge with MOSFETs. I have a thermal model for the losses, however depending on the duty cycle the current across one of the switches is always negative (using PLECS convention), therefore the switching losses are not calculated and I am getting zero. I tried to modify the look-up table by mirroring the original table across the current axis (for example if 50A=2 mJ, -50A= 2mJ and so on) to account for negative currents but I am still getting zero switching losses. I did a similar trick for the conduction losses and they work ok. Thank you in advance for your help.