Modeling and simulation of dynamics systems