Dear Student
The papillary muscles are the muscles located in the ventricles of the heart. They attach to the cusps of the atrioventricular valve (also known as the mitral and tricuspid valves) via the chordae tendineae and contract to prevent inversion or prolapse of these valves on systole(or ventricular contraction).
Regards