Matrix implementatin of a dynamic model.