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:
581 bytes
|
Line | |
---|
1 | function pass = chebpadetest |
---|
2 | |
---|
3 | % Nick Hale 22/04/2009 |
---|
4 | |
---|
5 | tol = chebfunpref('eps'); |
---|
6 | |
---|
7 | M = 4; |
---|
8 | N = 4; |
---|
9 | d = [-1, 0, 3]; |
---|
10 | P = chebfun(chebpolyval([-0.6817 0.0558 2.1122 -1.3813 0.5045]),d); |
---|
11 | Q = chebfun(chebpolyval([0.5246 -0.2679 -0.8573 0.1155 1]),d); |
---|
12 | R = P./Q; |
---|
13 | [r p q] = chebpade(R,M,N); |
---|
14 | err = norm(chebfun(P.funs(1),d(1:2))-p)+norm(chebfun(Q.funs(1),d(1:2))-q); |
---|
15 | pass1 = err < 100*tol*R.scl; |
---|
16 | |
---|
17 | |
---|
18 | M = 6; |
---|
19 | N = 5; |
---|
20 | [r p q] = chebpade( P./Q,M,N); |
---|
21 | err = norm(chebfun(P.funs(1),d(1:2))-p)+norm(chebfun(Q.funs(1),d(1:2))-q); |
---|
22 | pass2 = err < 100*tol*R.scl; |
---|
23 | |
---|
24 | pass = pass1 && pass2; |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.