1 twovar.mac is from the book "Perturbation Methods, Bifurcation Theory
2 and Computer Algebra" by Rand & Armbruster (Springer 1987)
4 This maxima routine applies the two variable expansion method to a
5 non-autonomous (forced) system of n differential equations. This
6 sample run from p 93 applies the method to the van der Pol equation.
8 The routine is case sensitive. When I enter the inputs in lower case
9 I get different (wrong) answers.
11 (C1) load("./twovar.mac");
12 Warning - you are redefining the MACSYMA function SETIFY
15 DO YOU WANT TO ENTER NEW DATA (Y/N)
19 THE 1 D.E.'S WILL BE IN THE FORM:
20 X[I]'' + W[I]^2 X[I] = E F[I](X[1],...,X[ 1 ],T)
21 ENTER SYMBOL FOR X[ 1 ]
27 THE D.E.'S ARE ENTERED AS:
29 X '' + X = E (1 - X ) --
31 THE METHOD ASSUMES A SOLUTION IN THE FORM:
32 X[I] = X0[I] + E X1[I]
33 WHERE X0[I] = A[I](ETA) COS W[I] XI + B[I](ETA) SIN W[I] XI
34 WHERE XI = T AND ETA = E T
35 REMOVAL OF SECULAR TERMS IN THE X1[I] EQS. GIVES:
39 2 (---- (A )) + ----- + -- - A = 0
44 - 2 (---- (B )) - -- - ----- + B = 0
46 DO YOU WANT TO TRANSFORM TO POLAR COORDINATES (Y/N)
51 [[---- (R ) = -- - --, ---- (THETA ) = 0]]
53 DO YOU WANT TO SEARCH FOR RESONANT PARAMETER VALUES (Y/N)
57 The second example is from pp 100-103. The system of equations is
59 x'' + (1+e*delx) x + e nu x^3 = e k y
61 y'' + (1+e*dely) y + e mu cos(w*t) = 0
63 First we use the two variable method to find a list of resonant
64 frequencies w, then we set W to one of the frequencies and determine
65 the slow flow equations for W:2.
68 DO YOU WANT TO ENTER NEW DATA (Y/N)
72 THE 2 D.E.'S WILL BE IN THE FORM:
73 X[I]'' + W[I]^2 X[I] = E F[I](X[1],...,X[ 2 ],T)
74 ENTER SYMBOL FOR X[ 1 ]
76 ENTER SYMBOL FOR X[ 2 ]
85 -DELY*Y-MU*Y*COS(W*T);
86 THE D.E.'S ARE ENTERED AS:
88 X '' + X = E (K Y - NU X - DELX X)
89 Y '' + Y = E (- MU COS(T W) Y - DELY Y)
90 THE METHOD ASSUMES A SOLUTION IN THE FORM:
91 X[I] = X0[I] + E X1[I]
92 WHERE X0[I] = A[I](ETA) COS W[I] XI + B[I](ETA) SIN W[I] XI
93 WHERE XI = T AND ETA = E T
94 REMOVAL OF SECULAR TERMS IN THE X1[I] EQS. GIVES:
98 - ------- - ---------- + B K - B DELX + 2 (---- (A )) = 0
103 - ---------- - ------- + A K - A DELX - 2 (---- (B )) = 0
106 2 (---- (A )) - B DELY = 0
109 - A DELY - 2 (---- (B )) = 0
111 DO YOU WANT TO TRANSFORM TO POLAR COORDINATES (Y/N)
113 DO YOU WANT TO SEARCH FOR RESONANT PARAMETER VALUES (Y/N)
115 X EQ'S RESONANT FREQ = 1
116 FREQS ON RHS = [1, 3]
117 Y EQ'S RESONANT FREQ = 1
118 FREQS ON RHS = [1, W - 1, W + 1]
119 WHICH PARAMETER TO SEARCH FOR ?
121 [W = - 2, W = 0, W = 2]
122 DO YOU WANT TO SEARCH FOR ANOTHER PARAMETER (Y/N) ?
128 DO YOU WANT TO ENTER NEW DATA (Y/N)
130 THE D.E.'S ARE ENTERED AS:
132 X '' + X = E (K Y - NU X - DELX X)
133 Y '' + Y = E (- MU COS(2 T) Y - DELY Y)
134 THE METHOD ASSUMES A SOLUTION IN THE FORM:
135 X[I] = X0[I] + E X1[I]
136 WHERE X0[I] = A[I](ETA) COS W[I] XI + B[I](ETA) SIN W[I] XI
137 WHERE XI = T AND ETA = E T
138 REMOVAL OF SECULAR TERMS IN THE X1[I] EQS. GIVES:
142 - ------- - ---------- + B K - B DELX + 2 (---- (A )) = 0
147 - ---------- - ------- + A K - A DELX - 2 (---- (B )) = 0
151 ----- - B DELY + 2 (---- (A )) = 0
155 - ----- - A DELY - 2 (---- (B )) = 0
157 DO YOU WANT TO TRANSFORM TO POLAR COORDINATES (Y/N)
159 R SIN(THETA - THETA ) K R SIN(2 THETA ) MU
161 [[---- (R ) = - -------------------------, ---- (R ) = - -------------------,
165 3 R NU R COS(THETA - THETA ) K
167 ---- (THETA ) = - ------- + ------------------------- - ----,
173 ---- (THETA ) = - ---------------- - ----]]
175 DO YOU WANT TO SEARCH FOR RESONANT PARAMETER VALUES (Y/N)