You are on page 1of 1

Function:

function [ x ] = Exam1_Problem2( d_i ,D_o ,N )


%Lindon Limpangog, Section 9
%Calculates the spring constant of the four steel spring.
%Inputs: diameter of the spring's wire (d), outer diameter of the spring
%coil (D), number of coils (N)
%Outputs: displacement (x)
%Constants:
G = 7.0E6; %lb/in^2 material's rigidity for copper
F = 100; %lb

%Function
k = ((d_i.^4).*G)./(8.*(D_o.^3).*N);

x = F./k


end

Command:
>> d_i = [.05 .069 .086 .074];
>> D_o = [1.5 1.69 1.45 1.63];
>> N = [10 12 9 8];
>> [ x ] = Exam1_Problem2( d_i ,D_o ,N )

x =

617.1429 292.0364 57.3251 132.0438

You might also like