Skip to content
Permalink
54a17ceab5
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
106 lines (85 sloc) 1.96 KB

ME3255_FInalProject

I noticed that I was never assigned to a group so I did this project solo

Part A

function [w] = membrane_solution3(T,P)


    od = ones(8,1);
    od(3:3:end) = 0;
    a = -4*diag(ones(9,1))+diag(ones(9-3,1),3)+diag(ones(9-3,1),-3)+diag(od,1)+diag(od,-1);


    y = -(10/4)^2*(P/T)*ones(9,1);
    w = a\y;

grid on
    [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]);
    surf(x,y,z)
    title('Membrane Displacement')
    xlabel('X (\muM)')
    ylabel('Y (\muM)')
    zlabel('Displacement (\muM)')
    colormap jet
    shading interp
    disp(w)

end

Part B

membrane_solution3(0.006,0.001)

Part C

function [w] = membrane_solution3(T,P)


    od = ones(8,1);
    od(3:3:end) = 0;
    a = -4*diag(ones(9,1))+diag(ones(9-3,1),3)+diag(ones(9-3,1),-3)+diag(od,1)+diag(od,-1);


    y = -(10/4)^2*(P/T)*ones(9,1);
    w = a\y;

grid on
    [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]);
    surf(x,y,z)
    title('Membrane Displacement')
    xlabel('X (\muM)')
    ylabel('Y (\muM)')
    zlabel('Displacement (\muM)')
    colormap jet
    shading interp
    disp(w)

end

Part D

membrane_solution(0.006,0.001,10)

Part E

function [pw_se,w]=SE_diff(T,P,n)

E = 1e6;
v = .31;
t = .0003;
h = 10/(n+1);
w = membrane_solution(T,P,n);
z = zeros(n+2);
z(2:end-1,2:end-1) = reshape(w,[n n]);
nt = n + 1;
wn = zeros(nt);
for i = 1:nt
    for j = 1:nt
        wn(i,j) = mean([z(i,j),z(i+1,j),z(i,j+1),z(i+1,j+1)]);
    end
end
pw = sum(sum(wn.*h^2.*P));
dwdx = zeros(nt);
dwdy = zeros(nt);
for i = 1:nt
    for j = 1:nt
        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
se = E*t*h^2/(2*(1-v^2))*sum(sum(0.25.*dwdx.^4+.25.*dwdy.^4+0.5.*(dwdx.*dwdy).^2));
pw_se = pw-se;