A mathematical programming framework for economy/energy models