% exampleADI.m % Shows how to use linADI.m. See text for example problem. % (Ed Bueler; 4/1/02) K=.2; alpha=0; beta=0; cfun=inline('0','x','y'); dfun=inline('0','x','y'); % K=.2 and no u_x, u_y, u, source terms % that is, solve the heat equation u_t = .2(u_xx+u_yy) rect=[0 1 0 1.5]; % rectangular domain: 0 to 1 in x; 0 to 1.5 in y N=40; % divide x interval [0,1] into N subintervals M=60; % divide y interval [0,1.5] into M subintervals T=1; L=100; % compute L steps from t=0 to t=T displaynum=5; % display every 5 steps icfun = inline('x.*sin((2/3)*pi*y)','x','y'); % initial condition is a function of x and y: % f(x,y) = x sin(2/3 pi y) bdryfun = inline('[0, 1, x, 1]','x','y'); % boundary functions are listed in counterclockwise order: % lower, right, upper, left % that is: % g1(x)=0, g2(y)=1, g3(x)=x, g4(y)=1 linADI(K,alpha,beta,cfun,dfun,icfun,bdryfun,rect,N,M,T,L,displaynum);