1averm.mac is from the book "Perturbation Methods, Bifurcation Theory 2and Computer Algebra" by Rand & Armbruster (Springer 1987) 3 4The routine performs m-th order averaging on an n-dimensional system 5of nonautonomous odes. Averaging is performed by converting trig 6terms to complex exponentials, then killing exponentials. It is noted 7that for most practical problems the routine is proabaly too slow and 8creates intermediate expressions that are too large. 9 10The example is from p 130. maxima-5.9.0 cvs reproduces the 11results from the book. 12 13(C1) load("averm.mac"); 14(D1) averm.mac 15(C2) averm(); 16DO YOU WANT TO ENTER A NEW PROBLEM? (Y/N) 17Y; 18ARE YOU CONSIDERING A WEAKLY NONLINEAR OSCILLATOR OF THE FORM 19Z'' + OMEGA0^2 Z = EPS F(Z,ZDOT,T) ? (Y/N) 20N; 21ENTER NUMBER OF DIFFERENTIAL EQUATIONS 221; 23THE ODE'S ARE OF THE FORM: 24DX/DT = EPS F(X,T) 25WHERE X = [X1] 26SCALE TIME T SUCH THAT AVERAGING OCCURS OVER 2 PI 27ENTER RHS( 1 )=EPS*... 28(X1-X1^2)*SIN(T)^2; 29 2 2 30D X1 /DT = EPS SIN (T) (X1 - X1 ) 31ENTER ORDER OF AVERAGING 323; 33THE TRANSFORMATION: [X1] = 34 2 2 3 35[- ((2 EPS COS(4 T) - 8 EPS COS(2 T)) Y1 36 37 2 2 2 38 + (- 3 EPS COS(4 T) - 16 EPS SIN(2 T) + 12 EPS COS(2 T)) Y1 39 40 2 2 41 + (EPS COS(4 T) + 16 EPS SIN(2 T) - 4 EPS COS(2 T) - 64) Y1)/64] 42 3 4 3 3 3 2 2 43 EPS Y1 EPS Y1 EPS Y1 EPS Y1 EPS Y1 44(D2) [- -------- + -------- - -------- - ------- + ------] 45 64 32 64 2 2 46 47 48Local Variables: *** 49mode: Text *** 50End: ***