Last change
on this file since 4 was
4,
checked in by zhangj, 10 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
390 bytes
|
Line | |
---|
1 | function pass = ivptestcomplex |
---|
2 | |
---|
3 | % Nick Trefethen March 2009 |
---|
4 | % This routine testss ode45, ode113, ode15s on a complex ode to |
---|
5 | % make sure we get the signs right |
---|
6 | |
---|
7 | f = @(x,u) 1i*u; |
---|
8 | d = domain(0,1); |
---|
9 | |
---|
10 | y = ode113(f,d,1); |
---|
11 | pass1 = abs(y(1)-exp(1i)) < 2e-2; |
---|
12 | |
---|
13 | y = ode45(f,d,1); |
---|
14 | pass2 = abs(y(1)-exp(1i)) < 2e-2; |
---|
15 | |
---|
16 | y = ode15s(f,d,1); |
---|
17 | pass3 = abs(y(1)-exp(1i)) < 2e-2; |
---|
18 | |
---|
19 | pass = pass1 && pass2 && pass3; |
---|
20 | |
---|
21 | |
---|
Note: See
TracBrowser
for help on using the repository browser.