Modify Mathematica solver