diff --git a/README.md b/README.md index f29950d..16285b3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # linear_algebra +## 6 ## | # of segments | largest | smallest | # of eigenvalues | | --- | --- | --- | --- | | 5 | 3.6180 | 0.3820 | 4 | @@ -8,3 +9,41 @@ | 10000 | 4 | 9.8696e-8 | 999 | If the segment length (dx) approaches 0, this implies that the number of segments continues to grow to infinity. Therefore, there will also be an infinite number of eigenvalues. This conclusion is supported by the pattern in behavior illustrated in the table above. + +#### Script for 6 ##### +```` +function [ max_eig,min_eig,quant_eig] = PoleVault( segments,length ) +%PoleVault The purpose of the function is to find the eigenvalues for a +%slender column subject in axial load for a general number of segments. +% This function employs a finite difference approximation in order to +% find eigenvalues that would satisfy the equation for a series of +% interior nodes along the axis of the column. Suppressed at the bottom +% is script to calculate the load P on the pole + +matrix = zeros(segments-1); %create empty matrix dependent on the # of internal nodes + +%-------- Matrix ----------------------------------------- +% Create method to create matrix for any number of segments +for i=1:segments-1 %for loop to assign value to each matrix element + matrix(i,i) = 2; %Assigns values of two to the diagonal of the matrix + if (i ~= 1) %condition for neighboring column + matrix(i,i-1) = -1; %Assigns value for each diagonal directly below the center diagonal + end + if (i~=segments-1) + matrix(i,i+1) = -1; %Assigns value for each diagonal element directly above the center diagonal + end +end +%--------- Calculations ---------------------------------- +values = eig(matrix); %vector that possesses eigen values of 'matrix' +quant_eig = numel(values); %Sum the quantity of eigenvalues +max_eig = max(values); %Identify the maximum of the eigenvalues +min_eig = min(values); %Identify the minimum of the eigenvalues + +%---------- Calculation of Load, P ---------------------------------- +%dx = length/segments; %calculate the change in length between segments +%E = 76000000000; %Pole's modulus of elasticity +%I = 4*10^(-8); %Moment of inertia of pole +%radius = sqrt(values./(dx^2)) %rdius of pole +%load = (E*I)*(radius.^2) %load calculation +end +````