Clear Filters
Clear Filters

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

2 views (last 30 days)
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

Accepted Answer

Star Strider
Star Strider on 9 Feb 2015
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.
  2 Comments
Jason
Jason on 9 Feb 2015
This is what I've done so far and I think its wrong, I'm really not sure what this wants me to do. Any suggestions?
clear; clc;
% spring constant in Newtons/meter
k1 = 10*10^4;
k2 = 1.5*10^4;
% distance
d = 0.1;
% work
W = 500;
x = W/k1;
if (x < d)
W = k1 * x;
else (x >= d);
W = k1* x + 2*k2*(x - d);
end
Star Strider
Star Strider on 9 Feb 2015
I suggest you consider your definitions of ‘k1’ since it is now !E+5, while ‘k2’ is 1.5E+3. Are they what you want?
I don’t know what your homework assignment wants you to do, so give it your best effort. Does the answer you get make sense? Create ‘x’ as a continuous variable — perhaps with linspace — then plot it and see if it looks as you would expect it to look, including the minor discontinuities that will appear when the shorter springs take some of the load. Remember that the force ‘W’ generates is mass times acceleration (presumably gravity), and the springs exert an opposite force of -k*x, so equate them to see where the ‘x’ equilibrium occurs.

Sign in to comment.

More Answers (0)

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!