I have some experimental data that I want to fit to the following simultaneous equations:
-1.7x - 1.7y = res1
1.7x + 0y = res2
In this case:
res1 = -1.7
res2 = 1.7
(This is one of the more trivial examples)
Importantly I also want to include the following restraints to the fit
0 <= x <= 1
0 <= y <= 1
x + y <= 1
What would be the best way to do this?
I have already tried using lmfit
and matrices to solve this but it didn't seem to work so well.
EDIT:
So then in cases where the real solution lies
outside the constraints then the closest point in
the solution space and inside the restraints is returned