diff --git a/README.md b/README.md index 8deb37c..7363dee 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ ### Problem Statement Create a function called membrane_solution3 that uses the central finite difference approximation to solve for the displacements of a membrane with 3 x 3 interior nodes. The function should take the pressure (P) and tension (T) as inputs and output a column vector, w. +### Approach +Using the central difference approximation, the matrix K is created using the coefficients from the diagonal and off-diagonals and the matrix y is a column vector of ones multiplied by h^2*(P/T). The vector w is found by using the backslash key, which is a built-in Matlab function for matrix division. + ``` matlab function [w] = membrane_solution3(T,P) % Set up initial matrix % T = given tension (microNewton/micrometer) @@ -28,6 +31,9 @@ end ### Problem Statement Using the function from part A as well as a given tension of 0.006 uN/um and a given pressure of 0.001 MPa, solve for w and plot the result in 3 dimensions +### Approach +The function created in part A is called using the values from the problem statement. Surf(x,y,z) plots the surface of the membrane in 3 dimensions. + ``` matlab [w] = membrane_solution3(0.006,0.001); ``` @@ -38,6 +44,9 @@ Using the function from part A as well as a given tension of 0.006 uN/um and a g ### Problem Statement Create a function called membrane_solution that uses the central finite difference approximation to solve for the displacements of a membrane with n x n interior nodes. The function should take the pressure (P), tension (T), and number of interior nodes (n) as inputs and output the column vector, w. +### Approach +Similar to part A, the central difference approximation is used to create the K matrix. However, this time the dimensions of the matrix are dependent on the number of interior nodes, which is an input to the function. The w matrix is once again solved using the backslash key. + ```matlab function [w] = membrane_solution(T,P,n)% Set up initial matrix % T = given tension (microNewton/micrometer) @@ -61,7 +70,10 @@ end ## Part D ### Problem Statement -Solve for the vector w using the function from part C with a P value of 0.001, T value of 0.006, and 10 interior nodes. The 3 dimensional coordinates will then be plotted. +Solve for the vector w using the function from part C with a P value of 0.001 MPa, T value of 0.006 un/um, and 10 interior nodes. The 3 dimensional coordinates will then be plotted. + +### Approach +The function written in part C is called using the input values seem in the problem statement. The 3D surface plot of the membrane is created. ``` matlab [w] = membrane_solution(0.006,0.001,10) @@ -73,6 +85,9 @@ Solve for the vector w using the function from part C with a P value of 0.001, T ### Problem Statement Create a function that calculates the difference between the strain energy and the work done by pressure for a membrane with n x n elements. The function should output a single value for this difference (pw_se) as well as the w vector from part C. +### Approach +Using the output vector from part C (w), a matrix of the interior and exterior nodes is created. From here, dx and dy matrices are made, which are found by taking the difference between the columns and rows of the initial matrix. From here, the dw_dx and dw_dy matrices are created and plugged into the equation given in the project description. From here, the difference between the right and left sides of the equation could be found. + ``` matlab function [pw_se,w] = SE_diff(T,P,n) @@ -141,14 +156,19 @@ end - At 10 nodes, pw_se = 53.4902 -### Part F +## Part F +### Problem Statement +Using a root finding method, calculate the tension in the membrane with a given pressure of 0.001 MPa and while testing every 5 nodes from 0 to 20. Display the results in a table and show that the error in the tension is decreasing as the number of nodes is increased. + +### Approach +Using the bisect method, the tension in the membrane based on the conditions given in the problem statement is found. The relative error is found by calculating the difference between the error from the initial number of nodes to all of the subsequent node values. ``` matlab [pw_se,w] = SE_diff(T,P,n); [root,fx,ea,iter] = bisect_final_project(@(T) SE_diff(T,0.001,25),.001,1,.1) ``` -The same code was run five times, changing the value of n from 20 to 40 for intervals of 5. +- The same code was run five times, changing the value of n from 20 to 40 for intervals of 5. | number of nodes | Tension (uN/um) | rel. error| | --- | --- | --- | @@ -158,3 +178,22 @@ The same code was run five times, changing the value of n from 20 to 40 for inte | 30 | 0.0602 | 0.17% | | 35 | 0.0603 | 0.16% | | 40 | 0.0603 | 0.00% | + +## Part G +### Problem Statement +For a given pressure range of 0.001 to 0.01 MPa with 10 steps, determine the membrane tension using a root finding method at each pressure. Plot the results of pressure vs. maximum deflection and use a cubic best-fit line to determine the coefficient A, which is the best-fit constant for the line. + +### Approach +Using the given pressure range, the tension was found at each different pressure value using the bisect method. The best fit line was found + +## Part H +### Problem Statement + +| number of nodes | Value of A | rel. error| +| --- | --- | --- | +| 3 | | N/A | +| 20 | | | +| 25 | | | +| 30 | | | +| 35 | | | +| 40 | | |