Fri 4.4. 1997
-------------

hints3.m
========

1)

USE OF DEBUGGER FOR STUDYING A MATLAB FUNCTION

%Study the steps of the function  poistiff by debugging commands as follows:
%(see   help debug)

dbstop at 1 in poistiff   % get you in debug mode and stops at line 1
poistiff(3)               % call the function
dbtype                    % display code with linenumbers
dbstep                    % step 1 line at a time
dbstep
dbstep
maind1                    % look at interesting local variables
dbstep
maind1
dbstep
...


%cut and paste:
[sdiag maind1  maindiag maind1 sdiag]
dbstep
full(A)

..
dbclear 1
dbquit

------------------------------------------------------------------------------
2)

Use pdetool, Poisson functions:

Start at GUI, create unit square and homog Dirich bdary (default)

NOTE an easy way is to start with  >>pderect([0 1 0 1])
(compare pdepoly in hints1.m)

DRAW MENU: export (geometry descr. ...)    -> gd
BDARY MENU: export (decom. geom, bdary ..) -> g b


[p,e,t]=poimesh(g,3)   %% 3 subintervals (h=1/3) => 2*2 inner nodes
[K,F,B,ud]=assempde(b,p,e,t,1,0,1);  % assembles PDE probl. by eliminating
                                     % the Dirich bdary conds from the
           % syst. of equ. (Manual p. 5-18)
u1=K\F     % sol at the inner nodes ("Non-Dirichlet-points")
u=B*u1+ud

u=reshape(u,4,4)

mesh(u)

--------------









