MATLAB: Not sure how to do this when you cant use x in your if statement without providing what x is first…

arrayhomeworkif statement

The springs exert a force that is proportional to their compression and the proportionality constant is the spring constant k. The two side springs provide additional resistance if the weight W is too heavy for the center spring. When the weight is gently displaced, it moves through a distance x before coming to rest. The weight must balance the spring forces at this new position:
W = k1*x if x < d and W = k1*x+2*k2(x-d) if x >= d
k1=10^4 N/m; k2=1.5*10^4 N/m; and d=0.1 m.
Test case W = 2000
** also cant use iteration

Best Answer

It would seem to me that the initial value of ‘x’ is the initial length of the unloaded springs. Solve for the value of ‘x’ in the equilibrium equation once ‘W’ is placed upon them.