Rules and patterns for dummies??




On Mon, 2 Nov 2009, Julien Martin wrote:

< Hello Robert,
< 1. No it was not old news and your reply was very welcome.
< 2. The reason why I posted this question is that I wanted to understand better a post from another user.
< 3. I will most certainly have more questions about rules and patterns and will post them here as they come along.
< Julien.
 
Hi Julien,

Here is an example where I use rules to show that the heat equation is
solved by exp(-x^2/(4*t))/sqrt(2*t). Note that I do not use the exponential
function anywhere.

This is probably not the best way to prove this, but here goes ...

matchdeclare(X,true,MU,true,SIGMA,true,DUMMY,true);
tellsimpafter('diff(cdfn(X,MU,SIGMA),X,1),pdfn(X,MU,SIGMA));
tellsimpafter('diff(pdfn(X,MU,SIGMA),X,1),-(X-MU)/SIGMA^2*pdfn(X,MU,SIGMA));
tellsimpafter('diff(pdfn(X,MU,SIGMA),MU,1),-(X-MU)/SIGMA^2*pdfn(X,MU,SIGMA));
tellsimpafter('diff(pdfn(X,MU,SIGMA),SIGMA,1),(X-MU)^2/SIGMA^3*pdfn(X,MU,SIGMA));
tellsimpafter('diff(pdfn(X,MU,SIGMA),DUMMY,1),'diff(pdfn(X,MU,SIGMA),X,1)*diff(X,DUMMY)+'diff(pdfn(X,MU,SIGMA),MU,1)*diff(MU,DUMMY)+'diff(pdfn(X,MU,SIGMA),SIGMA,1)*diff(SIGM\
A,DUMMY));

u : pdfn(x,0,c)/c;
depends(c,t);
diff(u,t)-diff(u,x,2);
subst(c=sqrt(2*t),%);
ev(%,nouns);

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.