Model representation and solving