source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/systemexpm.m @ 17

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: 993 bytes
Line 
1function pass = systemexpm
2
3% Exponential test, inspired by Maxwell's equation
4% TAD
5
6d = domain(-1,1);
7dt = 0.6;
8sigma = 0.75;  % conductive attenuation
9
10D = diff(d); I = eye(d); Z = zeros(d);
11A = [ -sigma*I D;D Z ];
12A.lbc = [I Z];
13A.rbc = [I Z];
14
15x = d(:);
16f = exp(-20*x.^2) .* sin(30*x);
17EH = [ f -f ];
18
19% for n = 0:5
20%   subplot(2,3,n+1)
21%   plot( expm(n*dt*A & A.bc)*EH ),
22%   axis([-1 1 -1.25 1.25])
23%   title(['t = ' num2str(n*dt)])
24% end
25
26u = expm(dt*A & A.bc)*EH;
27
28% This is just taken from a stable version of chebops. Verify?
29ucorrect = [
30  -0.003493712804296   0.003507424266860
31   0.017400438776808  -0.017569666673771
32  -0.053993725617065   0.055047201484183
33   0.098797781796113  -0.102583796707936
34  -0.089121824015245   0.097254823360030
35  -0.004069253343800  -0.006433053771176
36   0.095392325253247  -0.087321637402261
37  -0.101288249878077   0.098387426546698
38   0.051307419712737  -0.057244515064558
39];
40
41pass = norm(u(0.1:0.1:0.9,:)-ucorrect,inf) < 1e4*chebfunpref('eps');
Note: See TracBrowser for help on using the repository browser.