⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a1101.m

📁 matlab算法集 matlab算法集
💻 M
字号:
       %-------------------------------------------------------------------
       % Example a1.10.1: Partial Differential Equations
       %-------------------------------------------------------------------

       % Initialize

       clc                 % clear command window 
       clear               % clear variables
       a = 2;              % maximum x
       b = 2;              % maximum y
       tol = 1.e-4;        % error tolerance
       m = 20;             % x precision
       n = 20;             % y precision
       q = 250;            % maximum SOR iterations 
       g = inline ('cos(pi*(x+y))','x','y');

       % Compute solution

       fprintf ('Example a1.10.1: Partial Differential Equations\n');
       [alpha,r,x,y,U] = poisson (a,b,m,n,q,tol,'',g);

       % Display results

       show ('Optimal relaxation parameter',alpha)
       show ('Number of SOR iterations',r)
       plotxyz (x,y,U,'Steady-State Temperature','x (m)','y (m)','u (^oC)')
       %-------------------------------------------------------------------

⌨️ 快捷键说明

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