Underdertermined system of equations
Let's say we have 2 equations and 3 variables (N equations and M variables, where M > N), for example:
0.3a+0.1b+0.2*c=10 + E
0.1a+0.2b+0.3*c=11 + E
We want to find a, b, c that are in the range [0.0, 1.0] and we want to minimize the error E.
We want a smooth solutions that in this context means that if we chart a, b, c in a chart, the chart is smooth.
How this kind of problems can be approached with sagemath?
This kind of problems can be solved with MILP - see details and examples at https://doc.sagemath.org/html/en/them...
Hello, in my case all variables are non-integer (can have decimals)
That's fine. MILP supports non-integer variables as well.
In fact it's not $E$ which should be minimized but $|E|$. So the problem should receive a special formalization which can transform a minimization of an absolute value (which is not linear) in the minimization of an affine objective. This can be correctly be done as Max underline with
MixedIntegerLinearProgram
inSageMath
. Elle if you need some help I can write the program for ypu.Good catch! E is actually |E|. If you have any example of how to code the system would be great!