Analytical solutions for transient and steady state beam loading in arbitrary traveling wave accelerating structures