Plot for tension for a statics problem

I have a tension problem that I need to finish soon. Im having a hard time getting Matlab to plot my three Tensions (T) vs. the angle of PHI I used a for loop for the angle of PHI and calculated my tensions using a matrix What am I doing wrong?
% My Givens
%-----------------------------------------------------------%
THETA = 30; % Found by using the Law of Cosines
M = 2000; % Weight (kg)
G = 9.8; % Gravity (m/s^2)
W = M*G; % Force = 2000 kg x 9.8 m/s^2
Force = W; % Newtons(N)
RAB =3;
%(i,j,k) Coordinates for points ABCDE in meters(m)
% A (0,0,0) Point location i,j,k
Ax = 0;
Ay = 0;
Az = 0;
% B (0,3,0) Point location i,j,k
Bx = 0;
By = 3;
Bz = 0;
% C (Cx,Cy,Cz) Point location i,j,k
Cx = 3*cosd(THETA);
Cy = 3*sind(THETA);
%Cz = Cx*sind(PHI) See for Loop Statement below
% D (2,0,1.5) Point location i,j,k
Dx = -2;
Dy = 0;
Dz = 1.5;
% E (2,0,-1.5) Point location i,j,k
Ex = -2;
Ey = 0;
Ez = -1.5;
%-----------------------------------------------------------%
% Loop for Phi Angle in Degrees
for J = 0:5:60; %Array for PHI
J;
% Angle PHI in XZ plane
PHI = J;
%%------------------------Equation for PHI----------------------------%%
Cz = (3*cosd(THETA))*sind(PHI);
% Magnitudes
MAGbe = sqrt((Ex-Bx).^2+(Ey-By).^2+(Ez-Bz).^2);
MAGbd = sqrt((Dx-Bx).^2+(Dy-By).^2+(Dz-Bz).^2);
MAGbc = sqrt((Cx-Bx).^2+(Cy-By).^2+(Cz-Bz).^2);
%DIRECTION COSINES
Lxbe = (Ex-Bx)/MAGbe;Lybe = (Ey-By)/MAGbe;Lzbe = (Ez-Bz)/MAGbe;
Lxbd = (Dx-Bx)/MAGbd;Lybd = (Dy-By)/MAGbd;Lzbd = (Dz-Bz)/MAGbd;
Lxbc = (Cx-Bx)/MAGbc;Lybc = (Cy-By)/MAGbc;Lzbc = (Cz-Bz)/MAGbc;
% Solving for the some of the Moments using a Metrix
A1 = [Lxbe, Lxbd, Lxbc];
A2 = [Lybe, Lybd, Lybc];
A3 = [Lzbe, Lzbd, Lzbc];
A = [A1;A2;A3];
b = [0;19600;0];
T = ((A\b)*-1)/1000;
disp('The angle of PHI for the boom is');
disp(PHI);
disp('The tension in cable Tbe is');
disp(T(1));
disp('The tension in cable Tbd is');
disp(T(2));
disp('The tension in cable Tbc is');
disp(T(3));
P=length(T(1));
Q=PHI.';
plot(T,PHI)
S=size(PHI)
plot(T,Q)
end
% Zenth=0:5:60;
% Zenth1=Zenth.'
% V=size(T)
% V2=size(Zenth1)
% plot(Zenth,T(1),'r')
%plot(T(1),PHI, 'r')
%plot(T(2),PHI, 'b')
% T1V is Tension (Tbe) on free diagram = T1
% T2V is Tension (Tbd) on free diagram = T2
% ForceV is the force (Force) of 2000kg x 9.8 m/s^2 on free diagram = Fbc
% T1V = T1((Lxbe)i + (Lybe)j + (Lzbe)k)=0
% T2V = T2((Lxbd)i + (Lybd)j + (Lzbd)k)=0
% ForceV = Force((Lxbc)i + (Lybc)j + (Lzbc)k)=0
% Some of the forces to find 5 unkowns which are Tbd(T1),Tbc(T2),Ax,Ay,Az
% Forces in X = -Tbe - Tbd + Ax = 0
% Forces in Y = -Tbe - Tbd + Ay =19600N
% Forces in Z = -Tbe + Tbd + Az = 0

回答(0 个)

标签

提问:

2015-5-15

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by