e972.m

来自「matlab算法集 matlab算法集」· M 代码 · 共 31 行

M
31
字号
%-----------------------------------------------------------------------
% Example 9.7.2: Plate Deflection
%-----------------------------------------------------------------------

% Initialize 

   clc                    % clear screen
   clear                  % clear variables
   global xg yg V         % used in funq972.m
   m = 15;                % number of x grid points 
   n = 15;                % number or y grid points 
   q   = 500;             % maximum number of iterations 	
   a   = 3;               % plate width (m) 
   b   = 3;               % plate length (m)  
   tol = 1.e-4;           % error tolerance 

% Solve first Poisson system 

   fprintf ('Example 9.7.2: Plate Deflection\n');
   [alpha,r,xg,yg,V] = poisson (a,b,m,n,q,tol,'funp972','');
   show ('Number of iterations',r)
   show ('Relaxation parameter alpha',alpha)

% Solve second Poisson system 

   [alpha,r,xg,yg,U] = poisson (a,b,m,n,q,tol,'funq972','');
   show ('Number of iterations',r)
   show ('Maximum deflection (m)',max(max(U)))
   plotxyz (xg,yg,U,'Plate Deflection','x (m)','y (m)','u (m)')
%-----------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?