Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
formatting
  • Loading branch information
nin13001 committed Dec 16, 2017
1 parent ca8a423 commit 94cc919
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions README.md
@@ -1,7 +1,11 @@
# ME3255_FInalProject
I noticed that I was never assigned to a group so I did this project solo
## Part A
**Problem**
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); The output w should be a vector, but the solution represents a 2D data set w(x,y).

**Approach**
First off for this part I created a matrix using analysis of the interior nodes of a 5x5 matrix. After that I created a vector for the Y direction, after which it is converted into a vector for the displacement of the nodes. The vector is then transformed to be the surface of the new matrix.
```
function [w] = membrane_solution3(T,P)
Expand Down Expand Up @@ -31,14 +35,18 @@ end
```

## Part B

**Problem**
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.
```
membrane_solution3(0.006,0.001)
```
![](assets/README-20ed9cd0.png)

## Part C

**Problem**
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); The output w should be a vector, but the solution represents a 2D data set w(x,y).
**Approach**
This part of the assignment was handled similarly to part A, as the only thing that changed from the two scripts was the ability of the user to input their own dimensions, which was done by altering the indexing in the function.
```
function [w] = membrane_solution3(T,P)
Expand Down Expand Up @@ -68,13 +76,22 @@ end
```

## Part D

**Problem**
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. Include the graph in your README.
```
membrane_solution(0.006,0.001,10)
```
![](assets/README-579fb915.png)

## Part E
**Problem**
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**
The first thing I did was pull the solution from membrane_solution.m, after which the average displacement of each node was calculated. This was done through taking the displacement at each corner, after which it was all averaged. The same was done for the left and right points (boundary conditions).
```
function [pw_se,w]=SE_diff(T,P,n)
Expand Down Expand Up @@ -106,6 +123,12 @@ pw_se = pw-se;
```

## Part F
**Problem**
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**
Using previous knowledge of bisecting functions, as well as the outputs of the SE_diff function, the script ran every single iteration for the different amounts of nodes. The script then saves the values as a vector T, from which it is able to compare and output error from rel_error.
```
function [root,fx,ea,iter]=bisect(func,xl,xu,es,maxit,varargin)
if nargin<3,error('at least 3 input arguments required'),end
Expand Down Expand Up @@ -156,6 +179,10 @@ ea = zeros(1,length(n));
|40|0.0603|0.05%|

## Part G
**Problem**
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. Plot the data and best-fit curve in your README.
**Approach**
Utilizing the previous tension_sol results, the script runs all the iterations of pressure and tension. After this it also calculates the maximum deflection of every single iteration. The results are plotted as a linear regression, and plotted on the chart pictured below.
```
No = linspace(.001,.01,10);
n = 20;
Expand Down

0 comments on commit 94cc919

Please sign in to comment.