Hello Murtaza,
the first thing I would do is use an actual inverter model with diodes parallel to your switches. Also, please start with this model and modify to your needs instead of starting from scratch.
Regards,
Joel
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!