I recommend you study the following manuscripts which are helpful for how to model Power Electronic devices using MATLAB programming and SIMULINK toolbox.
Regards,
Morteza Shabanzadeh
http://mortezash.blogfa.com/
Data Voltage Source Inverter (VSI) Simulation and Design using MA...
Data Current Controlled Voltage Source Inverter (CCVSI) Simulatio...
Data Simulation and Design of Distributed Generation Units' Conne...