Optimize a 2 variable function
Show older comments
I'm trying for a very long time to optimize this function:
V(a,b)=(26*(2000*cos((pi*a)/180) + (sin((pi*(a + 45))/180)*((2600000*cos((pi*(a + b))/180)*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180)))/(cos((pi*a)/180)^2*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180))) + (2600000*cos((pi*a)/180)*sin((pi*(a + 45))/180))/(cos((pi*(a + b))/180)*sin((pi*b)/180)*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180)))))/((1300*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180))^2)/cos((pi*a)/180)^3 + (1300*sin((pi*(a + 45))/180)^2)/(cos((pi*(a + b))/180)*sin((pi*b)/180)^2) + 8085710131136235/4398046511104)))/(3*cos((pi*(a + b))/180)*sin((pi*b)/180)) - (26*((2^(1/2)*((2600000*cos((pi*(a + b))/180)*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180)))/(cos((pi*a)/180)^2*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180))) + (2600000*cos((pi*a)/180)*sin((pi*(a + 45))/180))/(cos((pi*(a + b))/180)*sin((pi*b)/180)*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180)))))/(2*((1300*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180))^2)/cos((pi*a)/180)^3 + (1300*sin((pi*(a + 45))/180)^2)/(cos((pi*(a + b))/180)*sin((pi*b)/180)^2) + 8085710131136235/4398046511104)) + (cos((pi*(a + b))/180)*(2000*cos((pi*a)/180) + (sin((pi*(a + 45))/180)*((2600000*cos((pi*(a + b))/180)*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180)))/(cos((pi*a)/180)^2*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180))) + (2600000*cos((pi*a)/180)*sin((pi*(a + 45))/180))/(cos((pi*(a + b))/180)*sin((pi*b)/180)*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180)))))/((1300*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180))^2)/cos((pi*a)/180)^3 + (1300*sin((pi*(a + 45))/180)^2)/(cos((pi*(a + b))/180)*sin((pi*b)/180)^2) + 8085710131136235/4398046511104)))/sin((pi*b)/180)))/(3*cos((pi*a)/180)^2) - (539047342075749*((2600000*cos((pi*(a + b))/180)*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180)))/(cos((pi*a)/180)^2*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180))) + (2600000*cos((pi*a)/180)*sin((pi*(a + 45))/180))/(cos((pi*(a + b))/180)*sin((pi*b)/180)*(cos((pi*(a + b))/180)*sin((pi*a)/180) - sin((pi*(a + b))/180)*cos((pi*a)/180)))))/(43980465111040*((1300*(2^(1/2)/2 + (cos((pi*(a + b))/180)*sin((pi*(a + 45))/180))/sin((pi*b)/180))^2)/cos((pi*a)/180)^3 + (1300*sin((pi*(a + 45))/180)^2)/(cos((pi*(a + b))/180)*sin((pi*b)/180)^2) + 8085710131136235/4398046511104))
The variables i need to solve for are a and b which represent angles. I want the GLOBAL MAXIMUM of the function. The solutions i need must satisfy the following conditions: -the derivative of V with respect to a in the points determined as global maximum must be equal to 0; -likewise for the derivative of V with respect to b; -the sum of a and b must be less then 90 degrees(a+b<90);
I tried with Optimization toolbox but i have no ideea what I'm doing. Thank you very much
Accepted Answer
More Answers (0)
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!