Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
%3b) The function solves for the system of equations using CDM when P>0 and
%w=0 for ten segments in terms of P and q.
function central_diff10P(P,q)
b=0.1; %width of beam
E=70E9; %Modulus of Elasticity
h=0.01;%height of beam
I=(b*(h^3))/12; %Second MOI
n=10; %Number of segments
x=1/n; %segment equivalent
z=((x.^4)*q)/(E*I); %differentiation used to solve for displacement
Off_Diag=-4-(((P*(1/(n^2)))/(E*I))); %Off Diagonal value
Diag=6+((P*(2*(1/(n^2))))/(E*I)); %Diagonal value
ODV = ones((n-2),1)*Off_Diag; %Off Diagonal vector
DV = ones(n-1,1)*Diag; %Diagonal vector
OOD = ones((n-3),1); %Off off diagonal vector
%Generate Matrix X
X=diag(ODV,-1)+ diag(DV)+diag(ODV,1)+diag(OOD,2)+diag(OOD,-2);
X(1,1)= 5+((P*(2*(1/(n^2))))/(E*I));
X((n-1),(n-1))=5+((P*(2*(1/(n^2))))/(E*I));
%Generate Matrix Y
Y=[z;z;z;z;z;z;z;z;z];
%Solve for deflection Matrix
W=X\Y;
end