Explain exactly what the system is and where you get an output energy.
Also in the system you describe , for example anLRC circuit,where w=wn, the current is in phase with the voltage.
For the mechanical equivalent the velocity is in phase with the force.