Optimization of a piezoelectric energy harvester considering electrical fatigue