Last change
on this file since 17 was
17,
checked in by zhangj, 10 years ago
|
To have a stable version on the server.
|
-
Property svn:executable set to
*
|
File size:
736 bytes
|
Line | |
---|
1 | function pass = mathieu |
---|
2 | |
---|
3 | % Periodic Mathieu functions |
---|
4 | % Finds eigenvalues and the periodic eigenfunctions for |
---|
5 | % |
---|
6 | % u'' = (2q cos(2x) + lambda)*u |
---|
7 | |
---|
8 | q = 25; |
---|
9 | d = domain(-pi,pi); |
---|
10 | c = chebfun('cos(2*x)',d); |
---|
11 | A = diff(d,2) - 2*q*diag(c); |
---|
12 | A.bc = 'periodic'; |
---|
13 | |
---|
14 | lam = eigs(A,30); |
---|
15 | |
---|
16 | % From MMA |
---|
17 | exactA25 = [ -40.256779546566787276, -21.314899690665726935, -3.5221647271582959443, ... |
---|
18 | 12.964079444326467300, 27.805240580928440859, 40.050190985807711970, ... |
---|
19 | 48.975786716161850782, 57.534689001082872507, 69.524065165941372023, ... |
---|
20 | 85.076999881816530410, 103.23020480449483818, 123.64301237608357484,... |
---|
21 | 146.20769064280234639, 170.87371080831606219, 197.61116494244372124 ]'; |
---|
22 | |
---|
23 | pass = norm( -lam(1:2:end) - exactA25, Inf) < 1e-10*chebfunpref('eps')/eps; |
---|
Note: See
TracBrowser
for help on using the repository browser.