source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/ivp_ty_test.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: 922 bytes
Line 
1function pass = ivp_ty_test
2
3% Rodrigo Platte Jan 2009, modified by Asgeir Birkisson
4% This routine tests IVP solver: ode45, ode113, ode15s
5
6% Test ode15s Using default tolerances (RelTol = 1e-3)
7[t,y] = ode15s(@vdp1,domain(0,20),[2;0]); % chebfun solution
8[tm,ym] = ode15s(@vdp1,[0,20],[2;0]); % Matlab's solution
9
10pass1 = max(max(abs(ym - feval(y,tm)))) < 2e-2;
11
12% Test ode45 Using default tolerances (RelTol = 1e-3)
13[t,y] = ode45(@vdp1,domain(0,20),[2;0]); % chebfun solution
14[tm,ym] = ode45(@vdp1,[0,20],[2;0]); % Matlab's solution
15
16pass2 = max(max(abs(ym - feval(y,tm)))) < 1e-2;
17
18% Test with different tolerance
19%opts = odeset('RelTol', 1e-6);
20
21% Test ode113
22%[t,y] = ode113(@vdp1,domain(0,20),[2;0],opts); % chebfun solution
23%[tm,ym] = ode113(@vdp1,[0,20],[2;0],opts); % Matlab's solution
24%
25%pass3 = max(max(abs(ym - feval(y,tm)))) < 1e-5;
26pass3 = 1; % commented out to save time
27
28pass = pass1 && pass2 && pass3;
29
30
Note: See TracBrowser for help on using the repository browser.