Home > K25104 > PDEs > poisson_9point_script.m

poisson_9point_script

PURPOSE ^

Usage example for poisson_9point

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Usage example for poisson_9point

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Usage example for poisson_9point
0002 
0003 f = @(x,y) 6*x.*y.*(1-y)-2*x.^3;
0004 g = @(x,y) y.*(1-y).*x.^3;
0005 a = 0;
0006 b = 1;
0007 N= 31;
0008 [ soln, timer ] = poisson_9point( f,g,a,b,N );
0009 h=(b-a)/(N+1);
0010 X = 0:h:1;
0011 Y = 0:h:1;
0012 Z = zeros(N+2,N+2);
0013 Z(1,:) = g(X,zeros(1,N+2));
0014 Z(N+2,:) = g(X,ones(1,N+2));
0015 Z(:,1) = g(zeros(1,N+2),Y);
0016 Z(:,N+2) = g(ones(1,N+2),Y);
0017 Z(2:N+1,2:N+1) = soln;
0018 surf(X,Y,Z);

Generated on Mon 18-Jan-2016 10:25:49 by m2html © 2005