Optimization/ Error minimization to reach target
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello
I have a problem where in I calculate Ratio_final which is a column vector. I also have column vector Ratio_target which is my target values. I basically need to minimize the error between Ratio_final and Ratio_target to as close as possible(maybe tolerance of 0.1 %). The parameter to vary would be the values in Ratio_one, Ratio_two and Ratio_three which have to be within certain limits (the limits I ll define later)
But the problem is that each value in Ratio_final are somehow interdependent on each other based on the calculation done to achieve its value if you look at the Matlab code that I have appended. Please let me know how to proceed with the next step to achieve the solution.
P.S- I do not have any toolbox to work with as of now.
% e12 e13 e14 e15 e23 e24 e25 e34 e35 e45
Gear_pattern=[ 0 0 0 0 0 1 0 0 0 1;
0 0 1 0 0 0 0 0 0 1;
0 0 0 0 0 2 0 0 0 1;
0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 1 0 0 0 2;
0 0 1 0 0 0 0 0 0 2;
0 0 0 0 0 2 0 0 0 2;
0 0 0 2 0 0 0 0 0 0;
0 0 0 0 0 1 0 0 0 3;
0 0 1 0 0 0 0 0 0 3;
0 0 0 0 0 2 0 0 0 3];
% x12 x13 x14 x15 x23 x24 x25 x34 x35 x45
Ratio_one= [0; 0; 1.274; 7.054; 0; 1.623; 0; 0; 0; 8.99];
Ratio_two= [0; 0; 0; 2.674; 0; 1; 0; 0; 0; 3.408];
Ratio_three=[0; 0; 0; 0; 0; 0; 0; 0; 0; 1.292];
Ratio_matrix=zeros(size(Gear_pattern));
Ratio_matrix=zeros(size(Gear_pattern));
for i=1:size(Gear_pattern,1)
for j=1:size(Gear_pattern,2)
if Gear_pattern(i,j)==1
Ratio_matrix(i,j)=Ratio_one(j);
elseif Gear_pattern(i,j)==2
Ratio_matrix(i,j)=Ratio_two(j);
elseif Gear_pattern(i,j)==3
Ratio_matrix(i,j)=Ratio_three(j);
else
end
end
end
Ratio_final=size(Ratio_matrix,2);
for u=1:size(Ratio_matrix,1)
prod=1;
for v=1:size(Ratio_matrix,2)
if Ratio_matrix(u,v)>0
temp=Ratio_matrix(u,v);
prod_temp=temp*prod;
prod=prod_temp;
else
end
end
Ratio_final(u,1)=prod;
end
Ratio_target=[15;12;9;8;6;5;4;3;3;2;2];
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!