Numerical optimization of the piezoelectric generators