The problem of misalignment encountered in rotating machinery is of great concern to designers and maintenance engineers. On several occasions stability conditions can change the shaft alignment between the driver and driven machines. Owing to high speed of rotating machinery, a good understanding of the phenomena of misalignment is becoming necessary for maintenance engineers for troubleshooting. Mostly, rotating equipment consists of a driver and a driven machine. Coupled through a mechanical coupling. Rigid mechanical coupling are widely used in rotating machinery to transmit torque from the driver to the driven machine. When two connected machines are under misalignment, they produce higher vibrations to the machine assembly. In this study an analysis of rigid flange coupling is done. The two dimensional analysis of whole system having flanged coupling was performed numerically using MATLAB programming in order to detect faults from unbalanced and misaligned parts. The results are compared with the experimental results obtained from literature and were in good agreement. Moreover a frequency plot obtained from MATLAB of aligned and misaligned shaft was compared to detect faults in the design. Thus after detection of fault using MATLAB, rpm of shaft is varied and its effects on whole coupling system are noted. While the three dimensional rigid coupling model was analyzed in ANSYS in order to determine stress and model frequencies under normal and misaligned condition. The results were in good agreement with literature study. The healthy system in ANSYS was considered to be of bonded nuts and bolts while in misaligned Flange model nuts and bolts were given frictional contacts.