source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/mathieu.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 736 bytes
Line 
1function pass = mathieu
2
3% Periodic Mathieu functions
4% Finds eigenvalues and the periodic eigenfunctions for
5%
6%   u'' = (2q cos(2x) + lambda)*u
7
8q = 25;
9d = domain(-pi,pi);
10c = chebfun('cos(2*x)',d);
11A = diff(d,2) - 2*q*diag(c);
12A.bc = 'periodic';
13
14lam = eigs(A,30);
15
16% From MMA
17exactA25 = [ -40.256779546566787276, -21.314899690665726935, -3.5221647271582959443, ...
1812.964079444326467300, 27.805240580928440859, 40.050190985807711970, ...
1948.975786716161850782, 57.534689001082872507, 69.524065165941372023, ...
2085.076999881816530410, 103.23020480449483818, 123.64301237608357484,...
21146.20769064280234639, 170.87371080831606219, 197.61116494244372124 ]';
22
23pass = norm( -lam(1:2:end) - exactA25, Inf) < 1e-10*chebfunpref('eps')/eps;
Note: See TracBrowser for help on using the repository browser.