Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
mam13081 committed Dec 15, 2017
1 parent 9a6655c commit 177eeaf
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions README.md
Expand Up @@ -36,6 +36,8 @@ w = k\y;
% Membrane displacement is shown on chart
end
end
```
### Approach
- A matrix is set up using finite element analysis of the interior nodes of a 5x5 matrix
Expand All @@ -46,6 +48,9 @@ end
# Part B
```matlab
% Part B Script
% From problem statement:
% T=0.006 uN/um
% P=0.001 MPa
[w] = membrane_solution3(0.006,0.001);
```
![](https://github.uconn.edu/ltd13002/ME3255_Final_Project/blob/master/Part%20B/PartBFigure.png)
Expand Down Expand Up @@ -77,10 +82,8 @@ function [w] = membrane_solution(T,P,n)
z = zeros(size(x));
z(2:end-1,2:end-1) = reshape(w,[n n]);
surf(x,y,z)
title('Membrane Displacement (10 x 10)')
zlabel('Z Position (micron)')
ylabel('Y Position (micron)')
xlabel('X Position (micron)')
title('Membrane Displacement')
zlabel('Displacement (micrometer)')
% Membrane displacement is shown on chart
end
```
Expand All @@ -91,6 +94,10 @@ end
# Part D
```matlab
% Part D Script
% From problem statement:
% T=0.006 uN/um
% P=0.001 MPa
% n = 10 nodes
[w] = membrane_solution(0.006,0.001,10)
```
![](https://github.uconn.edu/ltd13002/ME3255_Final_Project/blob/master/Part%20D/PartDFigure.png)
Expand Down Expand Up @@ -146,12 +153,17 @@ pw_se = pw-se;

# Part F
```matlab
% Part F script
% From Problem Statement:
n=[3,20:5:40];
P=0.001; %MPa
% Sets vector length so it doesn't change every iteration in for loop
T = zeros(1,length(n));
ea = zeros(1,length(n));
% Uses tension_sol function to solve for the tension for each input
for i = 1:length(n)
[T(i), ea(i)] = tension_sol(P,n(i));
end
```
Expand Down Expand Up @@ -237,22 +249,34 @@ end
- The script runs through all iterations of different amounts of nodes, zeroing the SE_diff function output and saving the values for tension in the T variable as a vector
# Part G
```matlab
% Part G Script
% From Problem Statement
P = linspace(.001,.01,10);
n = 20;
% Sets vector length so it doesn't change every iteration in for loop
T = zeros(1,length(P));
wmax = zeros(1,length(P));
% Uses tension_sol and membrane_solution functions to solve for the maximum displacement for all iterations
for i = 1:length(P)
T(i) = tension_sol(P(i),n);
w = membrane_solution(T(i),P(i),n);
wmax(i) = max(w);
end
% Sets up figure for plot
clf
setDefaults
% Standard Linear Regression with equation P(x) = A*w^2
x = wmax';
y = P';
Z=x.^3;
a=Z\y;
x_fcn=linspace(min(x),max(x));
% Plots regression line with actual points
plot(x,y,'o',x_fcn,a*x_fcn.^3)
title('Pressure vs Maximum Deflection')
xlabel('Maximum Deflection (um)')
Expand All @@ -269,9 +293,15 @@ print('Part g','-dpng')

# Part H
```matlab
% 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));
Expand All @@ -281,6 +311,8 @@ for i = 1:length(n)
Z = x.^3;
a(i) = Z\y;
end
% Calculates the relative error between the constant A values
Rel_error(a)
```
|number of nodes|vaalue of const. A| rel. error|
Expand Down

0 comments on commit 177eeaf

Please sign in to comment.