PDE-constrained optimization of time-dependent 3D electromagnetic induction heating by alternating voltages