A muscle twitch is the response of a muscle to a single stimulation. During the latent period, action potentials enter muscle cells through t-tubules. In cardiac muscle cells, the action potential causes Ca ions to enter the cells through Ca ion channels from the extracelular fluids. This Ca acts as a signal for release of Ca ions from the sarcoplasmic reticulum (SR).
During the contraction period of the muscle twitch, the released Ca ions have the same effect as in skeletal muscles (the sliding filament model). Troponin binds Ca, shifting tropomyosin to expose myosin binding sites on actin filaments. Myosin heads attach to thin filaments in the presence of Ca to bring the Z-lines of the sarcomeres closer to each other. A significant difference is that, in cardiac muscle cells, the force of contraction depends upon the strength of the stimulus for Ca release. That is, the strength of a cardiac muscle contraction can vary (it is said to be graded).
As in skeletal muscle, the strength of contraction can vary with how much the fiber is initially stretched (its length). More force is generated with optimal overlap of the myofilaments. This length-tension relationship allows the strength of contraction to vary with the extent of filling of the heart. Ordinarily, the heart operates on the ascending portion of the curve.
During the relaxation period of the muscle twitch, tension is reduced as the muscle fibers return to their resting length. Ca pumps restore Ca ions to the extracellular fluids and the sarcoplasmic reticulum. Both contraction and reuptake of Ca ions require ATP that is provided by aerobic metabolism in cardiac muscle cells, which have abundant mitochondria.

