Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please code following problem in MATLAB as requested format. In MATLAB code plea

ID: 3842585 • Letter: P

Question

Please code following problem in MATLAB as requested format.

In MATLAB code please, not algebraic function solution.

20 Figure P20 shows a mass-spring model of the type used to design packag ing systems and vehicle suspensions, for example. 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 Wis too heavy for the center spring. When the weight Wis gently placed, it moves through a distance x before coming to rest. From statics, the weight force must balance the spring forces at this new position. Thus klx if x

Explanation / Answer

function [f]=plotSpringCompression(Wmin,Wmax,k1,k2,d)
W=[Wmin:1:Wmax]
x1=1
if x1<d
f=@(x)k1*x
elseif
f=@(x)(k1*x)+2*k2*(x-d)
end
ezplot(f,'b')
grid on;