Gravar-mail: Optimal design and control of an electromechanical transfemoral prosthesis with energy regeneration