Permalink
Cannot retrieve contributors at this time
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?
me3255_group5/central_diff10P.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (24 sloc)
876 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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 |