A difference-equation model of the duffing equation