1 /* Original version of this file copyright 1999 by Michael Wester,
2 * and retrieved from http://www.math.unm.edu/~wester/demos/PDEs/heat.macsyma
5 * Released under the terms of the GNU General Public License, version 2,
6 * per message dated 2007-06-03 from Michael Wester to Robert Dodier
7 * (contained in the file wester-gpl-permission-message.txt).
9 * See: "A Critique of the Mathematical Abilities of CA Systems"
10 * by Michael Wester, pp 25--60 in
11 * "Computer Algebra Systems: A Practical Guide", edited by Michael J. Wester
12 * and published by John Wiley and Sons, Chichester, United Kingdom, 1999.
14 /* ----------[ M a c s y m a ]---------- */
15 /* ---------- Initialization ---------- */
19 /* ---------- Partial Differential Equations ---------- */
20 /* This is the heat equation */
21 heat: 'diff(u, t) - 'diff(u, x, 2) = 0;
22 /* This is the similarity form of the proposed solution */
23 s: f(x/sqrt(t))/sqrt(t);
24 /* Substitute s into the heat equation */
27 /* Change to the similarity variable z = x/sqrt(t) */
28 subst(x = z*sqrt(t), %);
29 /* Combine over a common denominator */
31 /* Eliminate the denominator */
33 /* Rewrite the differential equation in MACSYMA's normal notation */
35 /* Now, solve the ordinary differential equation */
37 /* Finally, transform back to the original variables */
38 's = subst(x/sqrt(t), z, rhs(%))/sqrt(t);
39 /* If we set %k1 = 0 and %k2 = 1/(2 sqrt(pi)) in the previous expression,
40 we will obtain the usual fundamental solution of the heat equation */
41 subst([%k1 = 0, %k2 = 1/(2*sqrt(%pi))], %);