~ubuntu-branches/ubuntu/natty/octave-odepkg/natty

« back to all changes in this revision

Viewing changes to inst/ode78.m

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Weber
  • Date: 2010-05-16 20:37:31 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100516203731-a9rey8g4kfkbt3jc
Tags: 0.6.10-1
* New upstream release
* debian/control:
  - Remove Rafael Laboissiere from Uploaders (Closes: #571858)
  - Remove Ólafur Jens Sigurðsson <ojsbug@gmail.com> from Uploaders
* Bump Standards-Version to 3.8.4, no changes needed
* Switch to dpkg-source 3.0 (quilt) format
* Dropped patch fix-test (applied upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%# Copyright (C) 2006-2008, Thomas Treichl <treichl@users.sourceforge.net>
 
1
%# Copyright (C) 2006-2009, Thomas Treichl <treichl@users.sourceforge.net>
2
2
%# OdePkg - A package for solving ordinary differential equations and more
3
3
%#
4
4
%# This program is free software; you can redistribute it and/or modify
212
212
    warning ('OdePkg:InvalidArgument', ...
213
213
      'Option "Vectorized" will be ignored by this solver');
214
214
  end
 
215
  if (~isequal (vodeoptions.NewtonTol, vodetemp.NewtonTol))
 
216
    warning ('OdePkg:InvalidArgument', ...
 
217
      'Option "NewtonTol" will be ignored by this solver');
 
218
  end
 
219
  if (~isequal (vodeoptions.MaxNewtonIterations,...
 
220
                vodetemp.MaxNewtonIterations))
 
221
    warning ('OdePkg:InvalidArgument', ...
 
222
      'Option "MaxNewtonIterations" will be ignored by this solver');
 
223
  end
215
224
 
216
225
  %# Implementation of the option Mass has been finished. This option
217
226
  %# can be set by the user to another value than default value.
269
278
  end
270
279
 
271
280
  vretvaltime = vtimestamp; %# first timestamp output
272
 
  if (vhaveoutputselection) %# first solution output
273
 
    vretvalresult = vinit(vodeoptions.OutputSel);
274
 
  else vretvalresult = vinit;
275
 
  end
 
281
  vretvalresult = vinit;    %# first solution output
276
282
 
277
283
  %# Initialize the OutputFcn
278
284
  if (vhaveoutputfunction)
 
285
    if (vhaveoutputselection) vretout = vretvalresult(vodeoptions.OutputSel);
 
286
    else vretout = vretvalresult; end     
279
287
    feval (vodeoptions.OutputFcn, vslot.', ...
280
 
      vretvalresult.', 'init', vfunarguments{:});
 
288
      vretout.', 'init', vfunarguments{:});
281
289
  end
282
290
 
283
291
  %# Initialize the EventFcn
382
390
      vu = y8.'; %# MC2001: the higher order estimation as "local extrapolation"
383
391
      %# Save the solution every vodeoptions.OutputSave steps             
384
392
      if (mod (vcntloop-1,vodeoptions.OutputSave) == 0)             
385
 
        if (vhaveoutputselection)
386
 
          vretvaltime(vcntsave,:) = vtimestamp;
387
 
          vretvalresult(vcntsave,:) = vu(vodeoptions.OutputSel);
388
 
        else
389
 
          vretvaltime(vcntsave,:) = vtimestamp;
390
 
          vretvalresult(vcntsave,:) = vu;
391
 
        end
 
393
        vretvaltime(vcntsave,:) = vtimestamp;
 
394
        vretvalresult(vcntsave,:) = vu;
392
395
        vcntsave = vcntsave + 1;    
393
396
      end     
394
397
      vcntloop = vcntloop + 1; vcntiter = 0;
717
720
%!
718
721
%! %# test for JPattern option is missing
719
722
%! %# test for Vectorized option is missing
 
723
%! %# test for NewtonTol option is missing
 
724
%! %# test for MaxNewtonIterations option is missing
720
725
%!
721
726
%!test %# Mass option as function
722
727
%!  vopt = odeset ('Mass', @fmas);
738
743
%!  vopt = odeset ('Mass', @fmas, 'MStateDependence', 'strong');
739
744
%!  vsol = ode78 (@fpol, [0 2], [2 0], vopt);
740
745
%!  assert ([vsol.x(end), vsol.y(end,:)], [2, fref], 1e-3);
 
746
%!test %# Set BDF option to something else than default
 
747
%!  vopt = odeset ('BDF', 'on');
 
748
%!  [vt, vy] = ode78 (@fpol, [0 2], [2 0], vopt);
 
749
%!  assert ([vt(end), vy(end,:)], [2, fref], 1e-3);
741
750
%!
742
751
%! %# test for MvPattern option is missing
743
752
%! %# test for InitialSlope option is missing
744
753
%! %# test for MaxOrder option is missing
745
 
%! %# test for BDF option is missing
746
754
%!
747
755
%!  warning ('on', 'OdePkg:InvalidArgument');
748
756