Optimal energy-harvesting cycles for load-driven dielectric generators in plane strain