# HG changeset patch # User Markus Mützel # Date 1604669901 -3600 # Node ID bf62eeabf6d16dff24189932c6f672c8852d608c # Parent 495af806442857771f2f57d4bb203e6fe9d57594 ode15s.m: Adjust BISTs for transposed fields "x" and "y" (bug #59416). * scripts/ode/ode15s.m: Adjust BISTs for transposed fields "x" and "y" to match results after 7f103819617d. diff -r 495af8064428 -r bf62eeabf6d1 scripts/ode/ode15s.m --- a/scripts/ode/ode15s.m Fri Nov 06 14:30:07 2020 +0100 +++ b/scripts/ode/ode15s.m Fri Nov 06 14:38:21 2020 +0100 @@ -619,77 +619,77 @@ ## Solve in backward direction starting at t=0 %!testif HAVE_SUNDIALS -%! ref = [-1.205364552835178, 0.951542399860817]; +%! ref = [-1.205364552835178; 0.951542399860817]; %! sol = ode15s (@fpol, [0 -2], [2, 0]); -%! assert ([sol.x(end), sol.y(end,:)], [-2, ref], 5e-3); +%! assert ([sol.x(end); sol.y(:,end)], [-2; ref], 5e-3); ## Solve in backward direction starting at t=2 %!testif HAVE_SUNDIALS -%! ref = [-1.205364552835178, 0.951542399860817]; +%! ref = [-1.205364552835178; 0.951542399860817]; %! sol = ode15s (@fpol, [2, 0 -2], fref); -%! assert ([sol.x(end), sol.y(end,:)], [-2, ref], 3e-2); +%! assert ([sol.x(end); sol.y(:,end)], [-2; ref], 3e-2); ## Solve another anonymous function in backward direction %!testif HAVE_SUNDIALS -%! ref = [-1, 0.367879437558975]; +%! ref = [-1; 0.367879437558975]; %! sol = ode15s (@(t,y) y, [0 -1], 1); -%! assert ([sol.x(end), sol.y(end,:)], ref, 1e-2); +%! assert ([sol.x(end); sol.y(:,end)], ref, 1e-2); ## Solve another anonymous function below zero %!testif HAVE_SUNDIALS -%! ref = [0, 14.77810590694212]; +%! ref = [0; 14.77810590694212]; %! sol = ode15s (@(t,y) y, [-2, 0], 2); -%! assert ([sol.x(end), sol.y(end,:)], ref, 5e-2); +%! assert ([sol.x(end); sol.y(:,end)], ref, 5e-2); ## Solve in backward direction starting at t=0 with MaxStep option %!testif HAVE_SUNDIALS -%! ref = [-1.205364552835178, 0.951542399860817]; +%! ref = [-1.205364552835178; 0.951542399860817]; %! opt = odeset ("MaxStep", 1e-3); %! sol = ode15s (@fpol, [0 -2], [2, 0], opt); %! assert (abs (sol.x(8)-sol.x(7)), 1e-3, 1e-3); -%! assert ([sol.x(end), sol.y(end,:)], [-2, ref], 1e-3); +%! assert ([sol.x(end); sol.y(:,end)], [-2; ref], 1e-3); ## AbsTol option %!testif HAVE_SUNDIALS %! opt = odeset ("AbsTol", 1e-5); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 4e-3); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 4e-3); ## AbsTol and RelTol option %!testif HAVE_SUNDIALS %! opt = odeset ("AbsTol", 1e-8, "RelTol", 1e-8); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 1e-3); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 1e-3); ## RelTol option -- higher accuracy %!testif HAVE_SUNDIALS %! opt = odeset ("RelTol", 1e-8); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 1e-4); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 1e-4); ## Mass option as function %!testif HAVE_SUNDIALS %! opt = odeset ("Mass", @fmas, "MStateDependence", "none"); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 3e-3); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 3e-3); ## Mass option as matrix %!testif HAVE_SUNDIALS %! opt = odeset ("Mass", eye (2,2), "MStateDependence", "none"); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 3e-3); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 3e-3); ## Mass option as sparse matrix %!testif HAVE_SUNDIALS %! opt = odeset ("Mass", speye (2), "MStateDependence", "none"); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 3e-3); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 3e-3); ## Mass option as function and sparse matrix %!testif HAVE_SUNDIALS %! opt = odeset ("Mass", "fmsa", "MStateDependence", "none"); %! sol = ode15s (@fpol, [0, 2], [2, 0], opt); -%! assert ([sol.x(end), sol.y(end,:)], [2, fref], 3e-3); +%! assert ([sol.x(end); sol.y(:,end)], [2, fref].', 3e-3); ## Refine %!testif HAVE_SUNDIALS