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?
ME_3255_Final_Project/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
212 lines (177 sloc)
6.18 KB
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
# ME 3255 Final Project | |
## Part A | |
#### Problem Statement | |
Create a central finite difference approximation of the gradient with 3-by-3 interior nodes of w | |
for the given membrane solution in terms of P and T. `[w]=membrane_solution3(T,P);` | |
#### Approach | |
```matlab | |
function [w] = membrane_solution3(T,P) | |
% Central finite difference approximation of gradient | |
% with 3x3 (um^2) interior nodes in terms of P & T. | |
% Input: | |
% T = tension per unit length (uN/um) | |
% P = pressure (MPa) | |
% Output: | |
% w = displacement vector for interior nodes | |
od = ones(8,1); | |
od(3:3:end) = 0; | |
k = -4 * diag(ones((3^2),1)) + diag(ones((3^2)-3,1),3) + diag(ones((3^2)-3,1),-3) + diag(od,1) + diag(od,-1); | |
y = -(10/4)^2*(P/T)*ones(9,1); | |
w = k\y; | |
% Find displacement vector w | |
% which represents 2D data set w(x,y) | |
[x,y] = meshgrid(0:10/4:10,0:10/4:10); | |
z = zeros(size(x)); | |
z(2:end-1,2:end-1) = reshape(w,[3 3]); | |
% Plot gradient of membrane displacement | |
surf(x,y,z) | |
title('Gradient of Membrane Displacement') | |
zlabel('Displacement [um] (micrometers)') | |
end | |
``` | |
## Part B | |
#### Problem Statement | |
Solve for w given a pressure, P=0.001 MPa and tension, T=0.006 uN/um. Plot the result with | |
`surf(X,Y,W)` where X, Y, and W are the x-, y-, and z-coordinates of each point on the | |
membrane from 0-10um. | |
#### Approach | |
T = 0.006 uN/um | |
P = 0.001 MPa | |
```matlab | |
[w] = membrane_solution3(0.006,0.001); | |
``` | |
![Fig. 1](./figures/PartB.png) | |
## Part C | |
#### Problem Statement | |
Create a general central finite difference approximation of the gradient with | |
n-by-n interior nodes of w | |
for the given membrane solution in terms of P and T. `[w]=membrane_solution(T,P,n);` | |
#### Approach | |
```matlab | |
function [w] = membrane_solution(T,P,n) | |
% General Central finite difference approximation of | |
% gradient with n-by-n interior nodes in terms of P & T. | |
% Input: | |
% T = tension per unit length (uN/um) | |
% P = pressure (MPa) | |
% n = # of interior node rows/columns | |
% Output: | |
% w = displacement vector for interior nodes | |
od = ones(n^2-1,1); | |
od(n:n:end) = 0; | |
k = -4 * diag(ones(n^2,1)) + diag(ones((n^2)-n,1),n) + diag(ones((n^2)-n,1),-n) + diag(od,1) + diag(od,-1); | |
y = -(10/(n+1))^2*(P/T)*ones(n^2,1); | |
w = k\y; | |
% Find displacement vector w | |
% which represents 2D data set w(x,y) | |
[x,y] = meshgrid(0:10/(n+1):10,0:10/(n+1):10); | |
z = zeros(size(x)); | |
z(2:end-1,2:end-1) = reshape(w,[n n]); | |
% Plot gradient of membrane displacement | |
surf(x,y,z) | |
title('Gradient of Membrane Displacement') | |
zlabel('Displacement [um] (micrometers)') | |
end | |
``` | |
## Part D | |
#### Problem Statement | |
Solve for w given a pressure, P=0.001 MPa and tension, T=0.006 uN/um with 10 interior nodes. Plot the result with `surf(X,Y,W)` where X, Y, and W are the x-, y-, and z-coordinates of each point on the membrane from 0-10um. | |
#### Approach | |
- T = 0.006 uN/um | |
- P = 0.001 MPa | |
- n = 10 nodes | |
```matlab | |
[w] = membrane_solution(0.006,0.001,10) | |
``` | |
![Fig. 2](./figures/PartD.png) | |
## Part E | |
#### Problem Statement | |
Create a function `SE_diff` that calculates the difference in strain energy (right hand side Eq. | |
4) and work done by pressure (left hand side Eq. 4) for n-by-n elements. | |
`[pw_se,w]=SE_diff(T,P,n)` | |
Use the solution from part **c** to calculate w, then do a numerical integral over the | |
elements to calculate work done and strain energy. | |
#### Approach | |
```matlab | |
function [pw_se,w] = SE_diff(T,P,n) | |
% function that calculates the difference between | |
% strain energy and work done by pressure on the membrane. | |
% Input: | |
% T = tension per unit length (uN/um) | |
% P = pressure (MPa) | |
% n = # of interior node rows/columns | |
% Output: | |
% pw_se = Absolute value of difference between strain energy and work done by pressure | |
% w = displacement vector for interior nodes | |
E = 1e6; % 1 TPa ~= 10^6 MPa | |
t = 3*10^-4; % thickness [um] | |
h = 10/(n+1); % height [um] | |
v = 0.31; % Poisson's Ratio | |
% Displacement vector w found using Part C | |
w = membrane_solution(T,P,n); | |
z = zeros(n + 2); | |
z(2:end-1,2:end-1) = reshape(w,[n n]); | |
% Calculate average displacement, wavg, for each element by taking the displacement at each | |
% corner and then average the found values. | |
num = n + 1; | |
wavg = zeros(num); | |
for i = 1:num | |
for j = 1:num | |
wavg(i,j) = mean([z(i,j),z(i+1,j),z(i,j+1),z(i+1,j+1)]); | |
end | |
end | |
% final work done by pressure | |
pw = sum(sum(wavg.*h^2.*P)) | |
% to find= change in displacement, find the change in displacement on | |
% the x-axis, dwdx, and the change in displacement on the y-axis, dwdy, and | |
% average the found values. | |
dwdx = zeros(num); | |
dwdy = zeros(num); | |
for i = 1:num | |
for j = 1:num | |
dwdx(i,j) = mean([z(i+1,j)-z(i,j),z(i+1,j+1)-z(i,j+1)]); | |
dwdy(i,j) = mean([z(i,j+1)-z(i,j),z(i+1,j+1)-z(i+1,j)]); | |
end | |
end | |
% Using dwdx and dwdy, calculate the strain energy, se. | |
se = (E*t*h^2)/(2*(1-v^2)) * sum(sum((1/4).*dwdx.^4+(1/4).*dwdy.^4+(1/4).*(dwdx.*dwdy).^2)); | |
% Final value of difference between strain energy and work done by pressure, pw_se. | |
pw_se = pw - se; | |
``` | |
## Part F | |
#### Problem Statement | |
Use a root-finding method to calculate the tension in the membrane given a pressure, P=0.001 MPa, and n=[20:5:40] interior nodes. | |
Show that the error in tension is decreasing with a table: | |
#### Approach | |
Root-finding Method used to find tension in the Membrane, given: | |
- P = 0.001 MPa | |
- n = [20:5:40] | |
Error | |
``` | |
|number of nodes |Tension (uN/um) |rel. error | | |
|---|---|---| | |
|3 |0.059 |n/a| | |
|20|0.0618|4.5%| | |
|25|0.0616|0.3%| | |
|30|0.0614|0.3%| | |
|40|0.0611|0.3%| | |
``` | |
## Part G | |
#### Problem Statement | |
Plot the Pressure vs maximum deflection (P (y-axis) vs max(w) (x-axis)) for | |
P=linspace(0.001,0.01,10). Use a root-finding method to determine tension, T, at each | |
pressure. Use a cubic best-fit to find A, where, P(x)=A*dw^3. State how | |
many interior nodes were used for the graph. | |
#### Approach | |
Pressure v. Maximum deflection (MPa v. um) | |
## Part H | |
#### Problem Statement | |
Show that the constant A is converging as the number of nodes is | |
increased (Similar table to **f**). | |
#### Approach | |
## Part I | |
#### Problem Statement | |
If the square membrane sides are always equal, but have a tolerance of 0.1\%, what | |
should the depth of the sensor be if 2.5% of the sensors won't hit the bottom given a | |
maximum pressure of 0.01 MPa. | |
#### Approach |