1 /* Filename transfor.mac
3 ***************************************************************
6 * <functionality description> *
8 * from: Perturbation Methods, Bifurcation *
9 * Theory and Computer Algebra. *
10 * by Rand & Armbruster (Springer 1987) *
11 * Programmed by Richard Rand *
12 * These files are released to the public domain *
14 ***************************************************************
16 /*PROGRAM NUMBER 4: TRANSFORM(), THIS PROGRAM ALLOWS TO PERFORM ARBITRARY
17 COORDINATE TRANSFORMATIONS. SEE PAGE 44 IN "PERTURBATION METHODS,
18 BIFURCATION THEORY AND COMPUTER ALGEBRA". */
24 n:read("enter number of equations"),
26 x[i]:read("enter symbol for original variable",i),
28 y[i]:read("enter symbol for transformed variable",i),
29 print("the rhs's of the d.e.'s are functions of the original variables:"),
31 print("enter rhs of",x[i],"d.e."),
32 print("d",x[i],"/dt ="),
34 print("d",x[i],"/dt =",f[i])),
35 print("the transformation is entered next:"),
37 print("enter",x[i],"as a function of the new variables"),
40 print(x[i],"=",g[i])),
43 for i:1 thru n do depends([x[i],y[i]],t),
44 for i:1 thru n do eq[i]:diff(x[i],t)=f[i],
45 trans:makelist(x[i]=g[i],i,1,n),
46 for i:1 thru n do treq[i]:ev(eq[i],trans,diff),
47 treqs:makelist(treq[i],i,1,n),
48 derivs:makelist(diff(y[i],t),i,1,n),
49 neweqs:solve(treqs,derivs))$