How to add (soft?) constraints to the model?

It would be much easier if we have a solver for algebraic equation, but we dont…