form_boundary.m
来自「快速泊松方程求解--MATLAB Fast Poisson Solver in」· M 代码 · 共 21 行
M
21 行
% Boundary conditions for poisson.m
%
% Form the boundaries of the Dirichlet problem in a box.
% Here gb = bottom condition, gl = left cond., gr = right, gt = top.
% Used in poisson.m. BOUNDARY CONDITIONS MUST BE CONTINUOUS
% make sure that if any of them are zero, that they are the length of x.
function [gb,gt,gl,gr] = Form_Boundary(x,y)
% gb is for u(x,0)
% gt is for u(x,endpoint)
% gl is for u(0,y)
% gr is for u(endpoint,y)
gb = (1/2).*sin(6*pi.*x);
gt = sin(pi*2.*x);
gl = 5.*y.*(y-1);
gr = -y.*((y-1).^4);
%
% Written by M. Harper Langston - 5/10/00
% harper@cims.nyu.edu
%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?