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 | |
---|
1 | function pass = systemexpm |
---|
2 | |
---|
3 | % Exponential test, inspired by Maxwell's equation |
---|
4 | % TAD |
---|
5 | |
---|
6 | d = domain(-1,1); |
---|
7 | dt = 0.6; |
---|
8 | sigma = 0.75; % conductive attenuation |
---|
9 | |
---|
10 | D = diff(d); I = eye(d); Z = zeros(d); |
---|
11 | A = [ -sigma*I D;D Z ]; |
---|
12 | A.lbc = [I Z]; |
---|
13 | A.rbc = [I Z]; |
---|
14 | |
---|
15 | x = d(:); |
---|
16 | f = exp(-20*x.^2) .* sin(30*x); |
---|
17 | EH = [ 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 | |
---|
26 | u = expm(dt*A & A.bc)*EH; |
---|
27 | |
---|
28 | % This is just taken from a stable version of chebops. Verify? |
---|
29 | ucorrect = [ |
---|
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 | |
---|
41 | pass = norm(u(0.1:0.1:0.9,:)-ucorrect,inf) < 1e4*chebfunpref('eps'); |
---|
Note: See
TracBrowser
for help on using the repository browser.