A two-port nonlinear model for magnetoelastic energy-harvesting devices