Finding variables using a simple optimization (maybe linear programming)
1 view (last 30 days)
% Dear Users,
% I have three equatians as below:
A = x(1)s(11)+x(2)s(12)...+x(n)x(1n)
B = x(1)s(21)+x(2)s(22)...+x(n)x(2n)
C = x(1)s(31)+x(2)s(32)...+x(n)x(3n)
% I know the values of (A,B,C) and all 's' variables
% Additionally all 'x' variables have upper and lower bands (I know also those values) such as:
Is there any way to find (x1, x2,...xn) values with the information above. Please don't send me the related page about "linprog". I tried to implement it but I failed to realize objective and all 'x' variables took the values of lower bands.
Thanks a lot!
Alan Weiss on 31 Mar 2016
You have three equations and n unknowns x1, ..., xn. In general you will have an n - 3 dimensional set of variables that satisfy all the conditions, if there are any solutions at all.
If you want a unique solution, give a linear objective function such as minimizing sum(x(i)) and solve it using the linprog function from Optimization Toolbox. If you want to find the set of all solutions, I suppose that you could give a bunch of different objectives, then take the convex hull of the resulting set.
MATLAB mathematical toolbox documentation