In: Mechanical Engineering
use matlab:
A cable of length Lc supports a beam of length Lb so that it is horizontal when the weight W is attached to the beam end. The tension force T in the cable is given by the following equation: T=(Lb*Lc*W)/(D*sqrt(Lc^2-D^2)) Where D is the distance of the cable attachment point to the beam pivot. 1. Create a function M-file that evaluates the tension T as a function of D. In this function M-file the parameters Lb, Lc, and W should be declared global. 2. Create a script M-file that creates these global variables and: a) Prompts for and accepts the following values from the Command Window : W = 400N, Lb= 5 m, and Lc = 3 m (the weight is in Newtons, and the lengths are in meters) b) Uses these values and the fminbnd function to compute and display in the Command Window the value of D that minimizes the tension, T, and the minimum tension value. c) Uses fzero to determine by how much the value of D can vary from it
(a). The M-file:
x = 10; W = 400; Lb = 3; Lc = 5; D = [0:0.01:Lb]; T = Lb*Lc*W./(D.*sqrt(Lb^2-D.^2)); [minT, k] = min(T) minD = D(k) Tension_at_min=T(k) Distance_at_min=D(k) %plotting Dplot = [1.5:0.001:2.2]; upper = 1.1*minT Tplot = Lb*Lc*W./(Dplot.*sqrt(Lb^2-Dplot.^2)); plot(Dplot,Tplot,[1.5,2.2],[upper,upper]) xlabel('D (mm)'); ylabel('T (N)') grid minT = 1333.3 k = 213 minD = 2.1200 Tension_at_min = 1333.3 Distance_at_min = 2.1200 upper = 1466.7
(b), In Command Window:
minT = 1333.3 k = 213 minD = 2.1200 Tension_at_min = 1333.3 Distance_at_min = 2.1200 upper = 1466.7
(c) The upper tension value is 1.1(1333) = 1467 N. The intersection of the two lines on the plot gives the solution, which is approximately D = 1.6 m (1.62 is a more accurate value)
I hope its helped. Let me know whether the part (c) is correct or not.