Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
@WonYYang44분 전(수정됨)%em07e01.mf=@(x,y)0; g=@(x,y)0; % Eq.(E7.1.1) w.r.t. Eq.(7.1.1)% (Rectangular) Domain and BC typesx0=0; xf=pi; y0=0; yf=pi; D=[x0 xf y0 yf];% BCsbx0=@(y)0; bxf=@(y)0; by0=@(x)sin(2*x); byf=@(x)0; % Eq.(E7.1.2a,b,c,d)% Numerical approach% Numbers of grid points along x-/y-axes, Error tolerance, Mx=50; My=50; tol=1e-5; MaxIter=600;[un,xx,yy]=pde_poisson_D(f,g,bx0,bxf,by0,byf,D,Mx,My,tol,MaxIter);% Analytical approachK=10; [ua,A]=pde_Laplace_ana(xf,yf,bx0,bxf,by0,byf,Mx,My,K);A, Discrepancy=norm(un-ua)/norm(ua)mesh(xx,yy,un) % Plot the solution graphxlabel('x'), ylabel('y')function [u,A,xx,yy]=pde_Laplace_ana(xf,yf,bx0,bxf,by0,byf,Mx,My,N)% To solve u_xx +u_yy = 0 % over the region D=[0,xf,0,yf]={(x,y)|0
@WonYYang
44분 전(수정됨)
%em07e01.m
f=@(x,y)0; g=@(x,y)0; % Eq.(E7.1.1) w.r.t. Eq.(7.1.1)
% (Rectangular) Domain and BC types
x0=0; xf=pi; y0=0; yf=pi; D=[x0 xf y0 yf];
% BCs
bx0=@(y)0; bxf=@(y)0; by0=@(x)sin(2*x); byf=@(x)0; % Eq.(E7.1.2a,b,c,d)
% Numerical approach
% Numbers of grid points along x-/y-axes, Error tolerance,
Mx=50; My=50; tol=1e-5; MaxIter=600;
[un,xx,yy]=pde_poisson_D(f,g,bx0,bxf,by0,byf,D,Mx,My,tol,MaxIter);
% Analytical approach
K=10; [ua,A]=pde_Laplace_ana(xf,yf,bx0,bxf,by0,byf,Mx,My,K);
A, Discrepancy=norm(un-ua)/norm(ua)
mesh(xx,yy,un) % Plot the solution graph
xlabel('x'), ylabel('y')
function [u,A,xx,yy]=pde_Laplace_ana(xf,yf,bx0,bxf,by0,byf,Mx,My,N)
% To solve u_xx +u_yy = 0
% over the region D=[0,xf,0,yf]={(x,y)|0