我有一个包含余弦和正弦函数的方程组。未知数是角度,因此范围在0到360度之间。当我在这些范围内时,vpasolve会在存在解的情况下返回空向量。 vpasolve如何不退还解决方案?当我缩小范围时,vpasolve会返回解决方案。但是它应该在最多90度的范围内找到解决方案。
这是我的代码:
clear; close all; clc
% Given parameters
A = [0 0]; % Coordinates of winch
SlingPos = [2 3;
10 8;
0 26;
22 20;
52 32;]; % Coordinates of the fixed point of the slings
SlingLen = [1;
2;
2.5;
3;
4]; % Length of the slings
Pwr = [0;
0;
0;
0;
0;]; % Percent friction in sheave 1
M = 500; % Mass of load
% Calculate angles and resultant force in the slings
syms(sym('theta',[1 length(SlingLen)])) % Create symbolic variables for the angles theta
syms(sym('T',[1 length(SlingLen)])) % Create symbolic variables for the resultant forces T
syms(sym('phi',[1 length(SlingLen)])) % Create symbolic variables for the angles phi
Fg = M*9.81; % Gravity
Fpull = zeros(length(SlingLen),1);
Fpull(end) = ((100+Pwr(end))/100)*Fg; % Pulling force of the last sheave
% Calculate other pulling forces
for i = length(SlingLen)-1:-1:1
Fpull(i) = ((100+Pwr(i))/100)*Fpull(i+1);
end
%TEST
[phi1, theta1, T1, phi2, theta2, T2, phi3, theta3, T3, phi4, theta4, T4, phi5, theta5, T5] = vpasolve(...
-Fpull(1)*cosd(phi1)-T1*cosd(theta1)+Fpull(2)*cosd(phi2)==0,...
Fpull(1)*sind(phi1)+T1*sind(theta1)-Fpull(2)*sind(phi2)==0,...
-Fpull(2)*cosd(phi2)-T2*cosd(theta2)+Fpull(3)*cosd(phi3)==0,...
Fpull(2)*sind(phi2)+T2*sind(theta2)-Fpull(3)*sind(phi3)==0,...
-Fpull(3)*cosd(phi3)-T3*cosd(theta3)+Fpull(4)*cosd(phi4)==0,...
Fpull(3)*sind(phi3)+T3*sind(theta3)-Fpull(4)*sind(phi4)==0,...
-Fpull(4)*cosd(phi4)-T4*cosd(theta4)+Fpull(5)*cosd(phi5)==0,...
Fpull(4)*sind(phi4)+T4*sind(theta4)-Fpull(5)*sind(phi5)==0,...
-Fpull(5)*cosd(phi5)-T5*cosd(theta5)==0,...
Fpull(5)*sind(phi5)+T5*sind(theta5)-Fg==0,...
A(1,1)+sqrt((abs(A(1,1)-SlingPos(1,1))+SlingLen(1)*cosd(theta1))^2+(abs(A(1,2)-SlingPos(1,2))-SlingLen(1)*sind(theta1))^2)*cosd(phi1)==SlingPos(1,1)+SlingLen(1)*cosd(theta1),...
SlingPos(1,1)+SlingLen(1)*cosd(theta1)+sqrt((abs(SlingPos(1,1)+SlingLen(1)*cosd(theta1)-SlingPos(2,1))+SlingLen(2)*cosd(theta2))^2+(abs(SlingPos(1,2)-SlingLen(1)*sind(theta1)-SlingPos(2,2))-SlingLen(2)*sind(theta2))^2)*cosd(phi2)==SlingPos(2,1)+SlingLen(2)*cosd(theta2),...
SlingPos(2,1)+SlingLen(2)*cosd(theta2)+sqrt((abs(SlingPos(2,1)+SlingLen(2)*cosd(theta2)-SlingPos(3,1))-SlingLen(3)*cosd(theta3))^2+(abs(SlingPos(2,2)-SlingLen(2)*sind(theta2)-SlingPos(3,2))-SlingLen(3)*sind(theta3))^2)*cosd(phi3)==SlingPos(3,1)+SlingLen(3)*cosd(theta3),...
SlingPos(3,1)+SlingLen(3)*cosd(theta3)+sqrt((abs(SlingPos(3,1)+SlingLen(3)*cosd(theta3)-SlingPos(4,1))+SlingLen(4)*cosd(theta4))^2+(abs(SlingPos(3,2)-SlingLen(3)*sind(theta3)-SlingPos(4,2))+SlingLen(4)*sind(theta4))^2)*cosd(phi4)==SlingPos(4,1)+SlingLen(4)*cosd(theta4),...
SlingPos(4,1)+SlingLen(4)*cosd(theta4)+sqrt((abs(SlingPos(4,1)+SlingLen(4)*cosd(theta4)-SlingPos(5,1))+SlingLen(5)*cosd(theta5))^2+(abs(SlingPos(4,2)-SlingLen(4)*sind(theta4)-SlingPos(5,2))-SlingLen(5)*sind(theta5))^2)*cosd(phi5)==SlingPos(5,1)+SlingLen(5)*cosd(theta5),...
[phi1,theta1,T1,phi2,theta2,T2,phi3,theta3,T3,phi4,theta4,T4,phi5,theta5,T5],...
[0 360;0 360;-inf inf;0 360;0 360;-inf inf;0 360;0 360;-inf inf;0 360;0 360;-inf inf;0 360;0 360;-inf inf]);
PosSheave1 = [double(SlingPos(1,1)+SlingLen(1)*cosd(theta1)); double(SlingPos(1,2)-SlingLen(1)*sind(theta1))]
PosSheave2 = [double(SlingPos(2,1)+SlingLen(2)*cosd(theta2)); double(SlingPos(2,2)-SlingLen(2)*sind(theta2))]
PosSheave3 = [double(SlingPos(3,1)+SlingLen(3)*cosd(theta3)); double(SlingPos(3,2)-SlingLen(3)*sind(theta3))]
PosSheave4 = [double(SlingPos(4,1)+SlingLen(4)*cosd(theta4)); double(SlingPos(4,2)-SlingLen(4)*sind(theta4))]
PosSheave5 = [double(SlingPos(5,1)+SlingLen(5)*cosd(theta5)); double(SlingPos(5,2)-SlingLen(5)*sind(theta5))]
我尝试更改vpasolve中的范围。