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_Final_Project/Part H/part_h.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
21 lines (18 sloc)
530 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
% Part G Script | |
% From Problem Statement | |
P=0.001; | |
n = 5:5:50; | |
% Sets vector length so it doesn't change every iteration in for loop | |
a = zeros(1,length(n)); | |
% Uses tension_sol and membrane_solution functions along with a regression line to solve for the constant A in the regression line | |
for i = 1:length(n) | |
T = tension_sol(P,n(i)); | |
w = membrane_solution(T,P,n(i)); | |
wmax = max(w); | |
x = wmax'; | |
y = P'; | |
Z = x.^3; | |
a(i) = Z\y; | |
end | |
% Calculates the relative error between the constant A values | |
Rel_error(a) |