From 9181783d18777aedc4f3c360f1233bf99fbb5806 Mon Sep 17 00:00:00 2001 From: Matthew Maliniak Date: Thu, 14 Dec 2017 20:38:36 -0500 Subject: [PATCH 1/7] Update README.md --- README.md | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1bd4f88..09f3690 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,13 @@ w = k\y; zlabel('Z Position (micron)') ylabel('Y Position (micron)') xlabel('X Position (micron)') + % Membrane displacement is shown on chart % 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 @@ -78,10 +80,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 ``` @@ -267,3 +267,36 @@ print('Part g','-dpng') - Additionally, the max deflection for each pressure and tension is calculated at each iteration - From there, a general linear regression is calculated with the formula P(x) = A*w^3 - The results are plotted + +# Part H +```matlab +P=0.001; +n = 5:5:50; +a = zeros(1,length(n)); +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 +Rel_error(a) +``` +|number of nodes|vaalue of const. A| rel. error| +|---|---|---| +|5 |0.4423 |n/a| +|10|0.5389|21.84%| +|15|0.5349|0.73%| +|20|0.5483|2.5%| +|25|0.5454|0.52%| +|30|0.5503|0.89%| +|35|0.5485|0.31%| +|40|0.5510|0.45%| +|45|0.5499|0.2%| + +### Approach +- Part H uses the same basis as Part G, but with varrying n (number of nodes) valeus instead +- Additionally, the outputs and a few calculations were deleted to speed up the process since they were not needed here +- In the chart, while there are some fluctuations, there is a clear decrease in the relative error of A, leading to the assumption that it is converging as the number of nodes increases From 45dedf0c13636d50a8b5810b20e4eb34da39d47f Mon Sep 17 00:00:00 2001 From: Lucas T Dombroski Date: Thu, 14 Dec 2017 20:38:46 -0500 Subject: [PATCH 2/7] Update membrane_solution.asv --- Part C/membrane_solution.asv | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Part C/membrane_solution.asv b/Part C/membrane_solution.asv index 72568a0..a44f536 100644 --- a/Part C/membrane_solution.asv +++ b/Part C/membrane_solution.asv @@ -21,7 +21,9 @@ w = k\y; z = zeros(size(x)); z(2:end-1,2:end-1) = reshape(w,[n n]); surf(x,y,z) -title('Membrane Displacement') -zlabel('Displacement (micrometer)') +title('Membrane Displacement (3 x 3)') +zlabel('Z Position (micron)') +ylabel('Y Position (micron)') +xlabel('X Position (micron)') % Membrane displacement is shown on chart -end \ No newline at end of file +end From 6d926f0487385fd561d940c8095b0fcbc11d1315 Mon Sep 17 00:00:00 2001 From: Lucas T Dombroski Date: Thu, 14 Dec 2017 20:39:13 -0500 Subject: [PATCH 3/7] Update membrane_solution.asv --- Part C/membrane_solution.asv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Part C/membrane_solution.asv b/Part C/membrane_solution.asv index a44f536..15f7ac4 100644 --- a/Part C/membrane_solution.asv +++ b/Part C/membrane_solution.asv @@ -21,7 +21,7 @@ w = k\y; z = zeros(size(x)); z(2:end-1,2:end-1) = reshape(w,[n n]); surf(x,y,z) -title('Membrane Displacement (3 x 3)') +title('Membrane Displacement (10 x 10)') zlabel('Z Position (micron)') ylabel('Y Position (micron)') xlabel('X Position (micron)') From 4095211ce23a2de6c39da437969d834c0ff41422 Mon Sep 17 00:00:00 2001 From: Lucas T Dombroski Date: Thu, 14 Dec 2017 20:41:34 -0500 Subject: [PATCH 4/7] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 09f3690..04c55a6 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ w = k\y; zlabel('Z Position (micron)') ylabel('Y Position (micron)') xlabel('X Position (micron)') - % Membrane displacement is shown on chart % Membrane displacement is shown on chart From d963b9c600136917bca0bbe0ad36db0b01032f4d Mon Sep 17 00:00:00 2001 From: Lucas T Dombroski Date: Thu, 14 Dec 2017 20:42:12 -0500 Subject: [PATCH 5/7] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 04c55a6..8ed3306 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ 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 From 9a6655cd2fbacf606726fcaa868ee638a610f992 Mon Sep 17 00:00:00 2001 From: Lucas T Dombroski Date: Thu, 14 Dec 2017 20:48:05 -0500 Subject: [PATCH 6/7] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ed3306..1510f72 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,10 @@ 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') - zlabel('Displacement (micrometer)') + title('Membrane Displacement (10 x 10)') + zlabel('Z Position (micron)') + ylabel('Y Position (micron)') + xlabel('X Position (micron)') % Membrane displacement is shown on chart end ``` From 177eeaf464e13270732700878d659ed451d0da6a Mon Sep 17 00:00:00 2001 From: Matthew Maliniak Date: Thu, 14 Dec 2017 20:51:47 -0500 Subject: [PATCH 7/7] Update README.md --- README.md | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1510f72..b7c42a9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) @@ -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 ``` @@ -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) @@ -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 ``` @@ -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)') @@ -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)); @@ -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|