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_group9/LHS.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (19 sloc)
712 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
function [ W ] = LHS ( w,EIpa,n,omega,t ) | |
%LHS rewrites the coefficient matrix w to the form denoted in | |
%equation 12 in the derivation, after the e^iwt coefficient was expanded to | |
%cos(wt)-isin(wt) | |
% Rewrite coefficient matrix in to follow form of equation 4 in derivation | |
wp = w./EIpa; | |
% Preallocate W for speed | |
W = wp; | |
% Precalculate coefficient to w term in equation 4 | |
A = ((omega)^2)/EIpa; | |
% Rewrite eigenvalue problem such that the w matrix becomes (Aw - lambda w) | |
% which is the same as the terms in paranthesis in equation 4 (see issue in | |
% our project) | |
for i = 1:n+1 | |
W(i,i) = wp(i,i) - A; | |
end | |
% Element by element multiplication of term in paranthesis by cos(omega*t) | |
W = W.*cos(omega*t); | |
end | |