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?
linear_algebra/poleVault.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (30 sloc)
574 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
%Program used to evaluate question 6 | |
%Define constants and given values | |
N= [5,6,10]-1; | |
P=10; | |
E=76e9; | |
I=4e-9; | |
L=5; | |
%Initiate loop to solve for required numbers | |
i=1; | |
for n=N | |
derivX=L/n | |
pressE=P/(E*I); | |
ar=derivX^2*pressE^2-2; | |
m=diag(ones(1,n-1),-1)+diag(ar*ones(1,n))+ diag(ones(1,n-1),1) | |
%Find eigenvalues of above equation | |
eigVal=eig(m); | |
i; | |
minVal(i)= max(eigVal); | |
maxVal(i)=min(eigVal); | |
i=i+1 | |
end | |
%Reverse values | |
minVal=(-1*minVal); | |
maxVal=(-1*maxVal); | |
%Print desired values | |
minVal' | |
maxVal' | |
N' | |
parts=N+1; | |
parts' | |