Piston motion equations

The motion of a non-offset piston connected to a crank through a connecting rod (as would be found in internal combustion engines), can be expressed through several mathematical equations. This article shows how these motion equations are derived, and shows an example graph.
Crankshaft geometry.
Angular velocity.
The crankshaft angular velocity is related to the engine revolutions per minute (RPM):
Triangle relation.
As shown in the diagram, the crank pin, crank center and piston pin form triangle NOP.<br>
By the cosine law it is seen that:<br>
Equations with respect to angular position (Angle Domain).
The equations that follow describe the reciprocating motion of the piston with respect to crank angle. Example graphs of these equations are shown below.
Position.
Position with respect to crank angle (from the triangle relation, completing the square, utilizing the Pythagorean identity, and rearranging):
Velocity.
Velocity with respect to crank angle (take first derivative, using the chain rule):
"( if you desire to manipulate this further, please add a subsection here, including a explanation of intent (e.g. "to isolate sin terms") )."
Acceleration.
Acceleration with respect to crank angle (take second derivative, using the chain rule and the quotient rule):
"( if you desire to manipulate this further, please add a subsection here, including a explanation of intent (e.g. "to isolate sin terms") )."
Equations with respect to time (time domain).
Angular velocity derivatives.
If angular velocity is constant, then
and the following relations apply:
Converting from angle domain to time domain.
The equations that follow describe the reciprocating motion of the piston with respect to time. If time domain is required instead of angle domain, first replace A with "ω"t in the equations, and then scale for angular velocity as follows:
Position.
Position with respect to time is simply:
Velocity.
Velocity with respect to time (using the chain rule): 
Acceleration.
Acceleration with respect to time (using the chain rule and product rule, and the angular velocity derivatives):
Scaling for angular velocity.
You can see that x is unscaled, x' is scaled by "ω", and x" is scaled by "ω"². To convert x' from velocity vs angle [m/rad] to velocity vs time [m/s] multiply x' by "ω" [rad/s]. To convert x" from acceleration vs angle [m/rad²] to acceleration vs time [m/s²] multiply x" by "ω"² [rad²/s²]. "Note that dimensional analysis shows that the units are consistent."
Velocity maxima/minima.
Acceleration zero crossings.
By definition, the velocity maxima and minima 
occur at the acceleration zeros "(crossings of the horizontal axis)"; these depend on rod length "(l)" and half stroke "(r)" and do not occur at crank angles "(A)" of ±90°.
Crank-rod angle not right angled.
The velocity maxima and minima do not necessarily occur when the crank makes a right angle with the rod. Counter-examples exist to disprove the "idea" that velocity maxima and minima only occur when the crank-rod angle is right angled.
Example.
For rod length 6" and crank radius 2" (as shown in the example graph below), numerically solving the acceleration zero-crossings finds the velocity maxima/minima to be at crank angles of ±73.17615°. Then, using the triangle law of sines, it is found that the rod-vertical angle is 18.60647° and the crank-rod angle is 88.21738°. Clearly, in this example, the angle between the crank and the rod is not a right angle. Summing the angles of the triangle 88.21738° + 18.60647° + 73.17615° gives 180.00000°. A single counter-example is sufficient to disprove the statement "velocity maxima/minima occur when crank makes a right angle with rod".
Example graph of piston motion.
The graph shows x, x', x" with respect to crank angle for various half strokes, where L = rod length "(l)" and R = half stroke "(r)":
Piston motion animation with same rod length and crank radius values in graph above:<br>
References.
1. http://www.epi-eng.com/piston_engine_technology/piston_motion_basics.htm