fix Duffing attractor and update the color determination
rearrange the code and add the 4-cosine attractor