//////////////////////////////////////////////////////////////// // // FloatMathieuEigenB2.q // //////////////////////////////////////////////////////////////// (Def (_FloatMathieuEigenB2 q) //////////////////////////////////////////////////////////////// // Output: // answer = Eigenvalue b_2(q) //////////////////////////////////////////////////////////////// (Local old new delta_old delta_new answer) // Initial approximation. (Setq old 4.) (Setq delta_old _Infinity) // Successively better approximations. (While TRUE (Setq new (_FloatMathieuEigenB2Step old q)) (Setq delta_new (Abs (- new old))) (When (>= delta_new delta_old) (Break)) (Setq [delta_old old] [delta_new new])) (Setq answer old) (Return answer) ) (Def (_FloatMathieuEigenB2Step lambda q) //////////////////////////////////////////////////////////////// // RHS of Wang & Guo p621(5) after lambda is isolated on LHS //////////////////////////////////////////////////////////////// (Local qsquare mu p0 q0 p1 q1 p2 q2 old new x answer) (Setq qsquare (^ q 2)) (Setq p0 1.) (Setq q0 0.) (Setq p1 4.) (Setq q1 1.) (Setq old 0.) (Loop (To i 1) (Do (Setq x (- lambda (^ (+ 2 (* 2 i)) 2))) (Cond ((IsOdd i) (Setq x (/ x qsquare))) (TRUE (Setq x (- x)))) (Setq p2 (+ (* x p1) p0)) (Setq q2 (+ (* x q1) q0)) (Setq new (/ p2 q2)) (When (= new old) (Break)) (Setq [old p0 q0 p1 q1] [new p1 q1 p2 q2]))) (Setq answer old) (Return answer) )