Advanced Mathematics and Mechanics Applications Using

Solutions to such problems are seldom obtainable in a closed finite form. Even when ... struct a solution for boundary values represented by piecewise linear interpolation. Surface ...... beamresp converts material property data to dimension4.
2MB taille 34 téléchargements 358 vues
Chapter 9 Boundary Value Problems for Partial Differential Equations

9.1 Several Important Partial Differential Equations Many physical phenomena are characterized by linear partial differential equations. Such equations are attractive to study because (a) principles of superposition apply in the sense that linear combinations of component solutions can often be used to build more general solutions and (b) Þnite difference or Þnite element approximations lead to systems of linear equations amenable to solution by matrix methods. The accompanying table lists several frequently encountered equations and some applications. We only show one- or two-dimensional forms, although some of these equations have relevant applications in three dimensions. In most practical applications the differential equations must be solved within a Þnite region of space while simultaneously prescribing boundary conditions on the function and its derivatives. Furthermore, initial conditions may exist. In dealing with the initial value problem, we are trying to predict future system behavior when initial conditions, boundary conditions, and a governing physical process are known. Solutions to such problems are seldom obtainable in a closed Þnite form. Even when series solutions are developed, an inÞnite number of terms may be needed to provide generality. For example, the problem of transient heat conduction in a circular cylinder leads to an inÞnite series of Bessel functions employing characteristic values which can only be computed approximately. Hence, the notion of an “exact” solution expressed as an inÞnite series of transcendental functions is deceiving. At best, we can hope to produce results containing insigniÞcantly small computation errors. The present chapter applies eigenfunction series to solve nine problems. Examples involving the Laplace, wave, beam, and heat equations are given. Nonhomogeneous boundary conditions are dealt with in several instances. Animation is also provided whenever it is helpful to illustrate the nature of the solutions.

© 2003 by CRC Press LLC

Equation

Applications

uxx + uyy = αut

Equation Name Heat

uxx + uyy = αutt

Wave

Transverse vibrations of membranes and other wave type phenomena

uxx + uyy = 0

Laplace

Steady-state heat conduction and electrostatics

uxx + uyy = f (x, y)

Poisson

Stress analysis of linearly elastic bodies

uxx + uyy + ω 2 u = 0

Helmholtz Steady-state problems

EIyxxxx = −Aρytt + f (x, t) Beam

Transient heat conduction

harmonic

vibration

Transverse ßexural vibrations of elastic beams

9.2 Solving the Laplace Equation inside a Rectangular Region Functions which satisfy Laplace’s equation are encountered often in practice. Such functions are called harmonic; and the problem of determining a harmonic function subject to given boundary values is known as the Dirichlet problem [119]. In a few cases with simple geometries, the Dirichlet problem can be solved explicitly. One instance is a rectangular region with the boundary values of the function being expandable in a Fourier sine series. The following program employs the FFT to construct a solution for boundary values represented by piecewise linear interpolation. Surface and contour plots of the resulting Þeld values are also presented. The problem of interest satisÞes the differential equation ∂2u ∂2u + 2 =0 , ∂x2 ∂y

0 ? 1.5,.5 Enter the wave speed > ? 1 The first forty-two natural frequencies are: 3.5124 4.4429 5.6636 6.4766 7.0248 7.8540 8.4590 8.8858 9.5548 9.9346 10.0580 10.5372 11.3272 11.3272 11.4356 12.6642 12.6642 12.9531 12.9531 13.3286 14.0496 14.0496 14.4820 14.4820 14.8189 15.7080 15.7080 15.7863 16.0190 16.0190 16.6978 16.9180 16.9180 16.9908 17.5620

7.0248 9.9346 12.2683 13.4209 15.4705 16.3996 17.5620

Input the frequency of the forcing function ? 17.5 Input the maximum solution evaluation time. > ? 5 Press return for animation or enter 0 to stop > ? Press return for animation or enter 0 to stop > ? 0 All done >> membwave; WAVE MOTION IN A RECTANGULAR OR CIRCULAR MEMBRANE HAVING AN OSCILLATING LOAD Select the geoemtry type: Enter 1 for a rectangle, 2 for a circle > ? 2 The circle radius equals one. Give the radial distance r0 from the circle center to the force > ? .5 Enter the wave speed > ? 1 The first forty-two natural frequencies are: 2.4048 3.8317 5.1356 5.5201 6.3801 7.5883 8.4173 8.6537 8.7715 9.7611 10.1735 11.0647 11.0864 11.6199 11.7916 12.3385 13.0152 13.3237 13.3543 13.5893

© 2003 by CRC Press LLC

7.0156 9.9362 12.2251 14.3726

14.4755 16.0378 17.6159

14.7960 16.2234 17.8014

14.8213 16.4707 17.9599

14.9309 16.6983 18.0711

15.5898 17.0037 18.2876

15.7002 17.2412 18.4335

Input the frequency of the forcing function ? 17.5 Input the maximum solution evaluation time. > ? 5 Press return for animation or enter 0 to stop > ? Press return for animation or enter 0 to stop > ? 0 All done >>

MEMBRANE POSITION AT T= 0.94

0.8 0.6 0.4

u axis

0.2 0 −0.2 −0.4 −0.6 −0.8 1.5

2

1

1.5 0.5

1 0.5

0 y axis

0

x axis

Figure 9.10: Wave Propagation in a Rectangular Membrane

© 2003 by CRC Press LLC

MEMBRANE POSITION AT T= 0.96

1

u axis

0.5

0

−0.5

−1 1 1

0.5 0.5

0 0

−0.5 y axis

−0.5 −1

−1

x axis

Figure 9.11: Wave Propagation in a Circular Membrane

© 2003 by CRC Press LLC

Program membwave

1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36:

function [u,x,y,t]= membwave(type,dims,alp,w,tmax) % % [u,x,y,t]=membwave(type,dims,alp,w,tmax) % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ % This program illustrates waves propagating in % a membrane of rectangular or circular shape % with an oscillatory concentrated load acting at % an arbitrary interior point. The membrane has % fixed edges and is initially undeflected and % at rest. The response u(x,y,t) is computed and % animated plots depicting the motion are shown. % % type - 1 for rectangle, 2 for circle % dims - vector giving problem dimensions. For % type=1, dims=[a,b,x0,y0] where a and % b are rectangle dimensions along the % x and y axes. Also the oscillating % force acts at (x0,y0). For type=2, % a circular membrane of unit radius is % analyzed with the concentrated force % acting at (r0,0) where r0=dims(1); % alp - wave propagation velocity in the % membrane % w - frequency of the applied force. This % can be zero if the force is constant. % x0,y0 - coordinates of the point where % the force acts % x,y,t - vectors of position and time values % for evaluation of the solution % u - an array of size [length(x),... % length(y),length(t)] % in which u(i,j,k) contains the % normalized displacement at % y(i),x(j),t(k). The displacement is % normalized by dividing by % max(abs(u(:)))

37: 38: 39: 40:

disp(’ ’) disp(’WAVE MOTION IN A RECTANGULAR OR CIRCULAR’) disp(’ MEMBRANE HAVING AN OSCILLATING LOAD’)

41:

© 2003 by CRC Press LLC

42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52:

if nargin > 0 % Data passed through the call list % must specify: type, dims, alp, w, tmax % Typical values are: a=2; b=1; alp=1; % w=18.4; x0=1; y0=0.5; tmax=5; if type==1 a=dims(1); b=dims(2); x0=dims(3); y0=dims(4); [u,x,y,t]=memrecwv(a,b,alp,w,x0,y0,tmax); else r0=dims(1); end else % Interactive data input

53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66:

disp(’ ’), disp(’Select the geometry type:’) type=input([’Enter 1 for a rectangle, ’,... ’2 for a circle > ? ’]); if type ==1 disp(’ ’) disp(’Specify the rectangle dimensions:’) s=input(’Give values for a,b > ? ’,’s’); s=eval([’[’,s,’]’]); a=s(1); b=s(2); disp(’ ’) disp(’Give coordinates (x0,y0) where the’) s=input(’force acts. Enter x0,y0 > ? ’,’s’); s=eval([’[’,s,’]’]); x0=s(1); y0=s(2); disp(’ ’), alp=input(’Enter the wave speed > ? ’);

67: 68: 69: 70: 71: 72: 73: 74: 75: 76:

N=40; M=40; pan=pi/a*(1:N)’; pbm=pi/b*(1:M); W=alp*sqrt(repmat(pan.^2,1,M)+repmat(pbm.^2,N,1)); wsort=sort(W(:)); wsort=reshape(wsort(1:42),6,7)’; disp(’ ’) disp([’The first forty-two natural ’,... ’frequencies are:’]) disp(wsort) w=input(... ’Input the frequency of the forcing function ? ’);

77: 78: 79: 80: 81: 82: 83:

else disp(’ ’), disp(... ’The circle radius equals one. Give the radial’) disp(... ’distance r0 from the circle center to the’) r0=input(’force > ? ’);

84: 85:

disp(’ ’), alp=input(’Enter the wave speed > ? ’);

86:

© 2003 by CRC Press LLC

87: 88: 89: 90: 91: 92: 93: 94: 95:

% First 42 Bessel function roots wsort=alp*[... 2.4048 3.8317 5.1356 5.5201 7.5883 8.4173 8.6537 8.7715 10.1735 11.0647 11.0864 11.6199 12.3385 13.0152 13.3237 13.3543 14.4755 14.7960 14.8213 14.9309 16.0378 16.2234 16.4707 16.6983 17.6159 17.8014 17.9599 18.0711

6.3801 9.7611 11.7916 13.5893 15.5898 17.0037 18.2876

7.0156 9.9362 12.2251 14.3726 15.7002 17.2412 18.4335];

96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106:

disp(’ ’), disp([’The first forty-two ’,... ’natural frequencies are:’]) disp(wsort) w=input(... ’Input the frequency of the forcing function ? ’); end disp(’ ’) disp(’Input the maximum solution evaluation time.’) tmax=input(’ > ? ’); end

107: 108: 109: 110: 111: 112: 113:

if type==1 [u,x,y,t]=memrecwv(a,b,alp,w,x0,y0,tmax); else th=linspace(0,2*pi,81); r=linspace(0,1,20); [u,x,y,t]=memcirwv(r,th,r0,alp,w,tmax); end

114: 115: 116:

% Animate the solution membanim(u,x,y,t);

117: 118:

%================================================

119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131:

function [u,x,y,t]= memrecwv(a,b,alp,w,x0,y0,tmax) % % [u,x,y,t]=memrecwv(a,b,alp,w,x0,y0,tmax) % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ % This function illustrates wave motion in a % rectangular membrane subjected to a concentrated % oscillatory force applied at an arbitrary % interior point. The membrane has fixed edges % and is initially at rest in an undeflected % position. The resulting response u(x,y,t)is % computed and a plot of the motion is shown. % a,b - side dimensions of the rectangle

© 2003 by CRC Press LLC

132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156:

% % % % % % % % % % % % % % % % % % % % % % % % %

alp

-

w

-

x0,y0

-

x,y,t

-

u

-

wave propagation velocity in the membrane frequency of the applied force. This can be zero if the force is constant. coordinates of the point where the force acts vectors of position and time values for evaluation of the solution an array of size [length(y),... length(x),length(t)] in which u(i,j,k) contains the normalized displacement corresponding to y(i), x(j), t(k). The displacement is normalized by dividing by max(abs(u(:))).

The solution is a double Fourier series of form u(x,y,t)=Sum(A(n,m,x,y,t), n=1..N, m=1..M) where A(n,m,x,y,t)=sin(n*pi*x0/a)*sin(n*pi*x/a)*... sin(m*pi*y0/b)*sin(m*pi*y/b)*... (cos(w*t)-cos(W(n,m)*t))/... ( w^2-W(n,m)^2) and the membrane natural frequencies are W(n,m)=pi*alp*sqrt((n/a)^2+(m/b)^2)

157: 158: 159: 160: 161: 162: 163: 164: 165: 166:

if nargin==0 a=2; b=1; alp=1; tmax=3; w=13; x0=1.5; y0=0.5; end if a ? ’);

39: 40: 41: 42:

% Define a grid for evaluation of stresses. % Include the middle of each side. nx=41; ny=fix(b/a*nx); ny=ny+1-rem(ny,2);

43: 44: 45: 46: 47: 48: 49: 50: 51: 52:

[c,phi,stres,z] = ... recstrs(a,nsega,b,nsegb,ntrms,nx,ny); [smax,k]=max(abs(stres(:))); zmax=z(:); zmax=zmax(k); xmax=abs(real(zmax)); ymax=abs(imag(zmax)); disp(’ ’), disp([’The Maximum Shear ’,... ’Stress is ’,num2str(smax)]); disp([’at x = ’,num2str(xmax),’ and y = ’,... num2str(ymax)]);

© 2003 by CRC Press LLC

53:

disp(’ ’); disp(’All Done’);

54: 55:

%=============================================

56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97:

function [c,phi,stres,z]=... recstrs(a,nsega,b,nsegb,ntrms,nxout,nyout) % % [c,phi,stres,z]=... % recstrs(a,nsega,b,nsegb,ntrms,nxout,nyout) % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ % This function uses least square fitting to % obtain an approximate solution for torsional % stresses in a Saint Venant beam having a % rectangular cross section. The complex stress % function is analytic inside the rectangle % and has its real part equal to abs(z*z)/2 on % the boundary. The problem is solved % approximately using a polynomial stress % function which fits the boundary condition % in the least square sense. The beam is 2*a % wide parallel to the x axis and 2*b deep % parallel to the y axis. The shear stresses % in the beam are given by the stress formula: % % (tauzx-i*tauzy)/(mu*alpha) = -i*conj(z)+f’(z) % % where % % f(z)=i*sum( c(j)*z^(2*j-2), j=1:ntrms ) % % and c(j) are real. % % a,b - half the side lengths of the % horizontal and vertical sides % nsega, - numbers of subintervals used to % nsegb form the least square equations % ntrms - number of terms used in the % polynomial stress function % nxout, - number of grid points used to % nyout evaluate output % c - coefficients defining the stress % function % phi - values of the membrane function % stres - array of complex stress values % z - complex point array at which

© 2003 by CRC Press LLC

98: 99: 100: 101:

% stresses are found % % User m functions called: none %----------------------------------------------

102: 103: 104: 105: 106:

% Generate vector zbdry of boundary points % for point matching. zbdry=[a+i*b/nsega*(0:nsega-1)’; i*b+a/nsegb*(nsegb:-1:0)’];

107: 108: 109: 110: 111:

% Determine a scaling parameter used to % prevent occurrence of large numbers when % high powers of z are used s=max(a,b);

112: 113: 114: 115: 116: 117: 118: 119:

% Form the least square equations to impose % the boundary conditions. neq=length(zbdry); amat=ones(neq,ntrms); ztmp=(zbdry/s).^2; bvec=.5*abs(zbdry).^2; for j=2:ntrms amat(:,j)=amat(:,j-1).*ztmp; end

120: 121: 122:

% Solve the least square equations. amat=real(amat); c=pinv(amat)*bvec;

123: 124: 125: 126: 127: 128: 129:

% Generate grid points to evaluate % the solution. xsid=linspace(-a,a,nxout); ysid=linspace(-b,b,nyout); [xg,yg]=meshgrid(xsid,ysid); z=xg+i*yg; zz=(z/s).^2;

130: 131: 132:

% Evaluate the warping function phi=-imag(polyval(flipud(c),zz));

133: 134: 135: 136: 137: 138: 139:

% Evaluate stresses and plot results cc=(2*(1:ntrms)-2)’.*c; stres=-i*conj(z)+i* ... polyval(flipud(cc),zz)./(z+eps*(z==0)); am=num2str(-a);ap=num2str(a); bm=num2str(-b);bp=num2str(b);

140: 141: 142:

% Plot results disp(’ ’), disp(’Press [Enter] to plot’)

© 2003 by CRC Press LLC

143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154:

disp(’the warping surface’), pause [pa,k]=max(abs(phi(:))); Phi=a/4*sign(phi(k))/phi(k)*phi; close, colormap(’default’) surfc(xg,yg,Phi) title(’Warping of the Cross Section’) xlabel(’x axis’), ylabel(’y axis’) zlabel(’transverse warping’); axis(’equal’) shg, disp(’ ’) disp(’Press [[Enter]] to plot the’) disp(’total stress surface’), pause % print -deps warpsurf

155: 156: 157: 158: 159: 160: 161: 162:

surfc(xg,yg,abs(stres)); title(’Total Shear Stress Surface’) xlabel(’x axis’); ylabel(’y axis’) zlabel(’total stress’), axis(’equal’), shg disp(’ ’), disp(’Press [Enter] to plot the’) disp(’stress contours’), pause % print -deps rectorst

163: 164: 165: 166: 167: 168: 169: 170:

contour(xg,yg,abs(stres),20); colorbar title(’Total Stress Contours’); xlabel(’x axis’); ylabel(’y axis’) shg, disp(’ ’) disp(’Press [Enter] to plot the maximum’) disp(’stress on a rectangle side’), pause % print -deps torcontu

171: 172: 173: 174: 175: 176:

plot(xsid,abs(stres(1,:)),’k’); grid; ylabel(’tangential stress’); xlabel(’position on a horizontal side’); title(’Stress for y = b/2’); shg % print -deps torstsid

© 2003 by CRC Press LLC