A dynamic approach to heterogeneous elastic wires