This research focuses on computer modelling and magnetic field simulations of the permanent magnet undulator at the PBP-CMU Electron Linac Laboratory, Chiang Mai University. This undulator magnet will be used for generation of the mid infrared free electron laser (MIR-FEL). It has 40 periods with a period length of 40 mm. The magnetic field simulations were conducted by using computer programs PANDIRA and RADIA for 2D and 3D models, respectively. The simulation results obtained from both models are presented and discussed in this paper. The magnetic field can be varied by adjusting a gap of the undulator. A maximum magnetic field of 0.23 Tesla can be achieved for the undulator gap of 26 mm. The simulated magnetic field distributions along the undulator magnetic axis obtained from the 3D model were used to calculate the deflecting angle and trajectory of electron. The achievement of this study will be used as a significant information for further installation and operation of the undulator magnet at our facility.