Calcualting the tension in a wire
Show older comments
close all; clear all; clc
%Calculates tension in a cable
m=50; g=9.81; l=50; %Parameters are fixed for run
c=linspace(50,100,100);
d=linspace(0,l,100); %Vector for distance from wall
D=zeros(100,1);
Tmin=zeros(100,1);
for x=1:length(c);
tension=m*g*c(x)*l./(d.*sqrt(c(x)^2 - d.^2)); %Calculation
[a,b]=min(tension);
Tmin(x)=a;
D(x)=d(b);
end
plot(D,Tmin,'b') %Plot
[p,q]=min(Tmin); %To find minimum tension, and postn
output=['Minimum tension ', num2str(p), ' occurs at d=', num2str(D(q)), ' Cable length ', num2str(c(q))];
disp(output)
Above is my code for calclulating the tension in a wire (different lengths). The resultant plot is similar to a staircase going downwards, but i am led to believe that it should be more parabolic...could anyone shed any light on the situation, thank you.
EDIT:
m=mass g=gravity l=length of beam c=length of cable Tmin=minimum tension a,b = minimum tension, a, at location, b.
6 Comments
Mischa Kim
on 15 Mar 2014
Could you post the equations you are working with? That would make it easier for those of us that are not that deep into structures.
matt
on 15 Mar 2014
Mischa Kim
on 15 Mar 2014
Edited: Mischa Kim
on 15 Mar 2014
I was talking about the "original" equations from a paper or textbook, a scan or photo would do. Not sure but I think the staircase behavior could be due to the min function.
Star Strider
on 15 Mar 2014
Edited: Star Strider
on 15 Mar 2014
You’re plotting the minimum over the interval. It’s going to be discontinuous by definition.
matt
on 15 Mar 2014
matt
on 15 Mar 2014
Answers (1)
Roger Stafford
on 15 Mar 2014
1 vote
The "staircase" effect you are getting is due to the fact that your minimum always occurs at the far end where d = 1, since the tension is always monotone decreasing for the d values you are using. Consequently you get a vertical line for the plot. You are very far from reaching the true minimum at d = c/sqrt(2). If you did have d ranging that far, you would get a hyperbolic, not parabolic, curve of minimum tension versus d.
Categories
Find more on Programming 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!