Considering a function Y=Y(L1,L2,a) how can I compute which configurations of L1,L2,a give the value Y=-0.81 and pick those of them that satisfy L1+L2+a=minimum?

1 view (last 30 days)
Hi all, I apologize in advance if this question is trivial! I would like to share the following: I have generated in maxima, after some matrices multiplications, an expression for Y:
Y=-((a^3*sin(a)^4*L1^2+(4*a^2-4*a^2*cos(a))*sin(a)^3*L1+
(4*a*cos(a)^2-8*a*cos(a)+4*a)*sin(a)^2)*L2-2*a^2*cos(a)*sin(a)^3*L1^2+
((6*a*cos(a)^2-8*a*cos(a))*sin(a)^2-2*a*sin(a)^4)*L1+(4*cos(a)-4)*sin(a)^3+
(-4*cos(a)^3+12*cos(a)^2-8*cos(a)-4)*sin(a)+4*a)/(a);
I would like to compute which configurations of L1,L2,a give the value e.g Y=-0.081, given that we fix the ranges for L1,L2 and a as follows:
L_range=0.5:0.05:2.45; %L is length in meters
alpha= 0.5:0.2:7; % a is bending angle in degrees. To convert in radians multiply with *pi/180
for k1 = 1:length(L_range)
for k2 = 1:length(alpha)
L1 = L_range(k1);
L2 = L_range(k1);
a = alpha(k2);
Y=-((a^3*sin(a)^4*L1^2+(4*a^2-4*a^2*cos(a))*sin(a)^3*L1+
(4*a*cos(a)^2-8*a*cos(a)+4*a)*sin(a)^2)*L2-2*a^2*cos(a)*sin(a)^3*L1^2+
((6*a*cos(a)^2-8*a*cos(a))*sin(a)^2-2*a*sin(a)^4)*L1+(4*cos(a)-4)*sin(a)^3+
(-4*cos(a)^3+12*cos(a)^2-8*cos(a)-4)*sin(a)+4*a)/(a);
if Y=-0.081
...
..
.
end
end
How can I then find which of the L1,L2,a configurations that give Y=-0.081 give the minimum sum L1+L2+R*a where R is e.g. R=1 meter ? Is there a built in function that I can take advantage of?
Thanks and regards!

Answers (0)

Categories

Find more on Simulink 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!