Finding variables using a simple optimization (maybe linear programming)
조회 수: 1 (최근 30일)
이전 댓글 표시
% 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:
a1<=x1<=b1
a2<=x2<=b2
a3<=x3<=b3
...
an<=xn<=bn
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!
댓글 수: 0
답변 (1개)
Alan Weiss
2016년 3월 31일
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.
Alan Weiss
MATLAB mathematical toolbox documentation
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!