k12,k13,k23,k11,k22,k33 are constant and equal
P1a = 400; P2a = -200;P3a = -200;Q1a = 193;Q2a = 96.86;Q3a = -96.86; P1d = (k12.*cos(x(1)*pi/360).*cos(x(2)*pi/360).*sin(x(4)*pi/180))+(k13.*cos(x(1)*pi/360).*cos(x(3)*pi/360).*sin(x(5)*pi/180))P2d = -(k12.*cos(x(1)*pi/360).*cos(x(2)*pi/360).*sin(x(4)*pi/180))+(k23.*cos(x(2)*pi/360).*cos(x(3)*pi/360).*sin((x(5)-x(4))*pi/180))P3d = -(k13.*cos(x(1)*pi/360).*cos(x(3)*pi/360).*sin(x(5)*pi/180))+(k23.*cos(x(2)*pi/360).*cos(x(3)*pi/360).*sin((x(4)-x(5))*pi/180))Q1d = (k11.*cos(x(1)*pi/360).*cos(x(1)*pi/360))-(k12.*cos(x(1)*pi/360).*cos(x(2)*pi/360).*cos(x(4)*pi/180))-(k13.*cos(x(1)*pi/360).*cos(x(3)*pi/360).*cos(x(5)*pi/180))Q2d = -(k12.*cos(x(1)*pi/360).*cos(x(2)*pi/360).*cos(x(4)*pi/180))+(k22.*cos(x(2)*pi/360).*cos(x(2)*pi/360))-(k23.*cos(x(2)*pi/360).*cos(x(3)*pi/360).*cos((x(5)-x(4))*pi/180))Q3d = -(k13.*cos(x(1)*pi/360).*cos(x(3)*pi/360).*cos(x(5)*pi/180))-(k23.*cos(x(2)*pi/360).*cos(x(3)*pi/360).*cos((x(5)-x(4))*pi/180))+(k33.*cos(x(3)*pi/360).*cos(x(3)*pi/360))delP1 = (P1d - P1a);delP2 = (P2d - P2a);delP3 = (P3d - P3a);delQ1 = (Q1d - Q1a);delQ2 = (Q2d - Q2a);delQ3 = (Q3d - Q3a);fcost = (((delP1).^2)+((delP2).^2)+((delP3).^2)+((delQ1).^2)+((delQ2).^2)+((delQ3).^2))
the equality constraints: the angles may vary between -180 degree to 180 degree x=fmincon(@cuptpc,x0,a,b)
Hi all, I was trying to solve a set of trigonometric equations taking as a optimization problems to find five unknown variables i.e. angles x(1), x(2), x(3), x(4), x(5). The actual P and Q values are given. The objective is to search for the angles x(1), x(2), x(3), x(4), x(5) that will minimize the cost function by minimizing the Q values. I am getting like this
fcost = 572.8147 x = -0.0000 28.2228 71.3840 27.8753 29.6215
I am not sure this is the optimum solution for angles or not. I think the cost function should be much smaller than what I am getting. Could anyone please help me with this? Is there any other methods that can be used to solve these equations?
Best Answer