No BSD License  

Highlights from
Advanced Mathematics and Mechanics Applications Using MATLAB, 3rd Edition

image thumbnail

Advanced Mathematics and Mechanics Applications Using MATLAB, 3rd Edition



14 Oct 2002 (Updated )

Companion Software (amamhlib)

function [dfl,cof]=membran(h,np,ns,nx,ny)
% [dfl,cof]=membran(h,np,ns,nx,ny)
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% This function computes the transverse 
% deflection of a uniformly tensioned membrane 
% which is subjected to uniform pressure. The 
% membrane shape is a rectangle of width h and 
% height two joined with a semicircle of 
% diameter two.
% Example use:  membran(0.75,100,50,40,40);
% h       - the width of the rectangular part
% np      - the number of least square points 
%           used to match the boundary 
%           conditions in the least square 
%           sense is about 3.5*np
% ns      - the number of terms used in the 
%           approximating series to evaluate 
%           deflections. The series has the
%           form
%           dfl = abs(z)^2/4 + 
%                 sum({j=1:ns},cof(j)*
%                 real(z^(j-1)))
% nx,ny   - the number of x points and y points 
%           used to compute deflection values 
%           on a rectangular grid
% dfl     - computed array of deflection values
% cof     - coefficients in the series 
%           approximation
% User m functions called:  none

if nargin==0
  h=.75; np=100; ns=50; nx=40; ny=40;

% Generate boundary points for least square 
% approximation
z=z(:); xb=real(z); xb=[xb;xb(end:-1:1)];
yb=imag(z); yb=[yb;-yb(end:-1:1)]; nb=length(xb);

% Form the least square equations and solve 
% for series coefficients
for j=2:ns, a(:,j)=a(:,j-1).*z; end

% Generate a rectangular grid for evaluation 
% of deflections
xv=linspace(-h,1,nx); yv=linspace(-1,1,ny); 
[x,y]=meshgrid(xv,yv); z=x+i*y;

% Evaluate the deflection series on the grid 
dfl=-z.*conj(z)/4+ ...

% Set values outside the physical region of 
% interest to zero

% Make surface and contour plots
hold off; close; surf(x,y,dfl);  
xlabel('x axis'); ylabel('y axis');
zlabel('deflection'); view(-10,30);
title('Membrane Deflection'); colormap([1 1 1]);
shg, disp(...
'Press [Enter] to show a contour plot'), pause
% print -deps membdefl;
contour(x,y,dfl,15,'k'); hold on
plot(xb,yb,'k-'); axis('equal'), hold off
xlabel('x axis'); ylabel('y axis');
title('Membrane Surface Contour Lines'), shg
% print -deps membcntr

Contact us