Solution of nonlinear wave equation of elastic rod