Move some ODE package functions from Octave-Forge to core

From Octave
Jump to: navigation, search


Parts of the ODE package have recently been incorporated into core. However, there are several more functions which should be shifted from the ODE. The core is much stricter about coding conventions which requires rigorous cleaning of the files before they are introduced to the core.

Conversion Tasks[edit]

  1. Copy over GNU public license statement from any existing core m-file to start of file.
  2. Update Copyright statement at head of file.
  3. Replace all single quotes (') with double quotes (").
  4. Replace logical not operator (~) with the not operator (!).
  5. Replace '%' comment character with '#'. Use '##' to precede comments which stand alone on a line. Use '#" for comments on the same line as code.
  6. Make sure all uses of "end" are keyword specific such as endif, endfor, endwhile, etc.
  7. Use 2 spaces for each indent level. Replace all tabs with spaces.
  8. Delete 'v' used as first character for all variables. For example, a variable "vtmp" should just be written as "tmp"
  9. Try to lowercase or rename any CamelCase variables.
  10. Replace "OdePkg:" error ID with "Octave:".
  11. Preface error messages with "FUNCTION_NAME:". For example, the following is in ode45.m: error ("Octave:invalid-input-arg", "ode45: TRANGE must be a numeric vector");
  12. Match variable names described in documentation to those used in the function header. For example, in ode45.m the documentation is "## @deftypefn {Function File} {[@var{t}, @var{y}] =} ode45 (@var{fun}, @var{trange}, @var{init})" and the function prototype is "function varargout = ode45 (fun, trange, init, varargin)"
  13. Potentially update @seealso links in other m-files to link to the new file.
  14. Add %!demo or BIST %!test blocks below "endfunction" keyword. There should be two newlines between "endfunction" and the start of any '%!' blocks.
  15. Potentially remove the newly implemented function from scripts/help/__unimplemented__.m.
  16. Add new m-file to appropriate location in scripts/ode/
  17. Consider adding a @DOCSTRING(FUNCTION_NAME) entry in the appropriate location in doc/interpreter/diffeq.txi.

The list of files to move from the ODE package is shown in the Files section of this page. To avoid duplication, sign up for a particular file by editing the Files section of this wiki page and adding your name next to the file. When you have finished converting a file, let a Maintainer know so that we can check in the changes. Also, add the wiki tags
<strike> ... </strike>
to the Files section to cross the file off the list.


  • odeplot.m (Stefan Miereis) (Patch submitted) (Patch pushed) (Removed from odepkg)
  • ode23.m (Stefan Miereis) (Patch submitted) (Patch pushed)
  • runge_kutta_23.m (Stefan Miereis) (Patch submitted) (Patch pushed)

Changes to odepkg to maintain compatibility with new release[edit]

As part of the inclusion in core of ODE solvers, some private functions or other sorts of utility functions are being moved to core as well.

Some changes made in order to adapt these functions to the coding style in core may break compatibility with solvers that will remain in odepkg, so the latter need to be adapted as well.

  • remove prefix 'v' from field names in options structs
  • input and output arguments of the steppers should be made compliant to the call in integrate_adaptive.m. The main example in core is runge_kutta_45_dorpri.m