You can subscribe to this list here.
2001 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}
(10) 
_{Aug}
(5) 
_{Sep}
(3) 
_{Oct}
(41) 
_{Nov}
(41) 
_{Dec}
(33) 

2002 
_{Jan}
(75) 
_{Feb}
(10) 
_{Mar}
(170) 
_{Apr}
(174) 
_{May}
(66) 
_{Jun}
(11) 
_{Jul}
(10) 
_{Aug}
(44) 
_{Sep}
(73) 
_{Oct}
(28) 
_{Nov}
(139) 
_{Dec}
(52) 
2003 
_{Jan}
(35) 
_{Feb}
(93) 
_{Mar}
(62) 
_{Apr}
(10) 
_{May}
(55) 
_{Jun}
(70) 
_{Jul}
(37) 
_{Aug}
(16) 
_{Sep}
(56) 
_{Oct}
(31) 
_{Nov}
(57) 
_{Dec}
(83) 
2004 
_{Jan}
(85) 
_{Feb}
(67) 
_{Mar}
(27) 
_{Apr}
(37) 
_{May}
(75) 
_{Jun}
(85) 
_{Jul}
(160) 
_{Aug}
(68) 
_{Sep}
(104) 
_{Oct}
(25) 
_{Nov}
(39) 
_{Dec}
(23) 
2005 
_{Jan}
(10) 
_{Feb}
(45) 
_{Mar}
(43) 
_{Apr}
(19) 
_{May}
(108) 
_{Jun}
(31) 
_{Jul}
(41) 
_{Aug}
(23) 
_{Sep}
(65) 
_{Oct}
(58) 
_{Nov}
(44) 
_{Dec}
(54) 
2006 
_{Jan}
(96) 
_{Feb}
(27) 
_{Mar}
(69) 
_{Apr}
(59) 
_{May}
(67) 
_{Jun}
(35) 
_{Jul}
(13) 
_{Aug}
(461) 
_{Sep}
(160) 
_{Oct}
(399) 
_{Nov}
(32) 
_{Dec}
(72) 
2007 
_{Jan}
(316) 
_{Feb}
(305) 
_{Mar}
(318) 
_{Apr}
(54) 
_{May}
(194) 
_{Jun}
(173) 
_{Jul}
(282) 
_{Aug}
(91) 
_{Sep}
(227) 
_{Oct}
(365) 
_{Nov}
(168) 
_{Dec}
(18) 
2008 
_{Jan}
(71) 
_{Feb}
(111) 
_{Mar}
(155) 
_{Apr}
(173) 
_{May}
(70) 
_{Jun}
(67) 
_{Jul}
(55) 
_{Aug}
(83) 
_{Sep}
(32) 
_{Oct}
(68) 
_{Nov}
(80) 
_{Dec}
(29) 
2009 
_{Jan}
(46) 
_{Feb}
(18) 
_{Mar}
(95) 
_{Apr}
(76) 
_{May}
(140) 
_{Jun}
(98) 
_{Jul}
(84) 
_{Aug}
(123) 
_{Sep}
(94) 
_{Oct}
(131) 
_{Nov}
(142) 
_{Dec}
(125) 
2010 
_{Jan}
(128) 
_{Feb}
(158) 
_{Mar}
(172) 
_{Apr}
(134) 
_{May}
(94) 
_{Jun}
(84) 
_{Jul}
(32) 
_{Aug}
(127) 
_{Sep}
(167) 
_{Oct}
(109) 
_{Nov}
(69) 
_{Dec}
(78) 
2011 
_{Jan}
(39) 
_{Feb}
(58) 
_{Mar}
(52) 
_{Apr}
(47) 
_{May}
(56) 
_{Jun}
(76) 
_{Jul}
(55) 
_{Aug}
(54) 
_{Sep}
(165) 
_{Oct}
(255) 
_{Nov}
(328) 
_{Dec}
(263) 
2012 
_{Jan}
(82) 
_{Feb}
(147) 
_{Mar}
(400) 
_{Apr}
(216) 
_{May}
(209) 
_{Jun}
(160) 
_{Jul}
(86) 
_{Aug}
(141) 
_{Sep}
(156) 
_{Oct}
(6) 
_{Nov}

_{Dec}

2015 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}
(1) 
_{Aug}

_{Sep}
(1) 
_{Oct}

_{Nov}
(1) 
_{Dec}
(2) 
2016 
_{Jan}

_{Feb}
(2) 
_{Mar}
(2) 
_{Apr}
(1) 
_{May}
(1) 
_{Jun}
(2) 
_{Jul}
(1) 
_{Aug}
(1) 
_{Sep}

_{Oct}

_{Nov}
(1) 
_{Dec}

S  M  T  W  T  F  S 

1
(11) 
2
(64) 
3
(31) 
4
(20) 
5
(25) 
6
(39) 
7
(17) 
8
(11) 
9
(26) 
10
(8) 
11
(3) 
12
(8) 
13
(4) 
14
(49) 
15
(12) 
16
(23) 
17
(15) 
18
(6) 
19
(6) 
20
(9) 
21

22
(5) 
23

24
(2) 
25
(3) 
26

27

28

29

30
(1) 
31
(1) 




From: David Bateman <adb014@us...>  20061007 20:08:14

Update of /cvsroot/octave/octaveforge/extra/symband/doc In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv8348 Modified Files: .cvsignore Makefile Log Message: cleanup a few more files Index: .cvsignore =================================================================== RCS file: /cvsroot/octave/octaveforge/extra/symband/doc/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  .cvsignore 6 Oct 2006 10:17:41 0000 1.1 +++ .cvsignore 7 Oct 2006 20:07:55 0000 1.2 @@ 6,3 +6,5 @@ html SymBandDoc *.pdf +*.idx +*.toc Index: Makefile =================================================================== RCS file: /cvsroot/octave/octaveforge/extra/symband/doc/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  Makefile 7 Oct 2006 19:02:50 0000 1.2 +++ Makefile 7 Oct 2006 20:07:55 0000 1.3 @@ 25,3 +25,5 @@ rm f $(patsubst %.tex,%.aux,$(TEX)) rm f $(patsubst %.tex,%.out,$(TEX)) rm f $(patsubst %.tex,%.dvi,$(TEX)) + rm f $(patsubst %.tex,%.toc,$(TEX)) + rm f $(patsubst %.tex,%.idx,$(TEX)) 
From: David Bateman <adb014@us...>  20061007 20:06:12

Update of /cvsroot/octave/octaveforge/main In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv7901/main Modified Files: INDEX Log Message: more indexing fixes Index: INDEX =================================================================== RCS file: /cvsroot/octave/octaveforge/main/INDEX,v retrieving revision 1.19 retrieving revision 1.20 diff u d r1.19 r1.20  INDEX 7 Oct 2006 19:34:01 0000 1.19 +++ INDEX 7 Oct 2006 20:06:08 0000 1.20 @@ 1356,3 +1356,44 @@ Colour maps gray ocean + +signal >> Signal processing +Signals + hurst + periodogram + sinc + sinetone + sinewave + stft + synthesis +Filtering + fftfilt + spencer + fractdiff +Filter analysis + freqz freqz_plot +Filter conversion + ss2tf + ss2zp + tf2ss + tf2zp + zp2ss + zp2tf +IIR Filter design + yulewalker +Power spectrum analysis + spectral_adf spectral_xdf +Window functions + bartlett + blackman + hamming + hanning + rectangle_lw + rectangle_sw + triangle_lw + triangle_sw +System identification + durbinlevinson + diffpara + arch_rnd arch_fit arch_test + arma_rnd autoreg_matrix autocor autocov 
From: David Bateman <adb014@us...>  20061007 20:06:11

Update of /cvsroot/octave/octaveforge/main/signal In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv7901/main/signal Modified Files: INDEX Log Message: more indexing fixes Index: INDEX =================================================================== RCS file: /cvsroot/octave/octaveforge/main/signal/INDEX,v retrieving revision 1.11 retrieving revision 1.12 diff u d r1.11 r1.12  INDEX 6 Oct 2006 20:49:48 0000 1.11 +++ INDEX 7 Oct 2006 20:06:08 0000 1.12 @@ 10,29 +10,22 @@ tripuls rectpuls sawtooth  sinc square  sinetone sinewave chirp vco modulate demod= $TFTB strips specgram  periodogram stft synthesis hurst buffer Filtering  fftfilt filtfilt filtic latcfilt sgolayfilt sosfilt medfilt1  spencer  fractdiff Filter analysis freqs freqs_plot freqspace  freqz freqz_plot grpdelay impz zplane @@ 51,15 +44,9 @@ sos2tf sos2zp ss2sos  ss2tf  ss2zp tf2latc tf2sos  tf2ss  tf2zp zp2sos  zp2ss  zp2tf polystab IIR Filter design besself @@ 69,7 +56,6 @@ ellip ncauer maxflat  yulewalker buttord cheb1ord cheb2ord @@ 117,22 +103,14 @@ xcorr xcorr2 xcov  spectral_adf spectral_xdf __power Window functions  bartlett  blackman boxcar chebwin flattopwin  hamming  hanning hann + hann kaiser triang gaussian gausswin  rectangle_lw  rectangle_sw  triangle_lw  triangle_sw System identification arburg arcov= use <code>ar_covar</code> $SPCTOOLS @@ 142,13 +120,10 @@ invfreq invfreqs invfreqz  levinson durbinlevinson + levinson lpc rlevinson stmcb  diffpara  arch_rnd arch_fit arch_test  arma_rnd autoreg_matrix autocor autocov Sample rate change decimate interp 
From: David Bateman <adb014@us...>  20061007 19:34:40

Update of /cvsroot/octave/octaveforge/main/miscellaneous/inst In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv26448/main/miscellaneous/inst Modified Files: grep.m Log Message: more indexing fixes Index: grep.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/miscellaneous/inst/grep.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  grep.m 20 Aug 2006 13:22:26 0000 1.1 +++ grep.m 7 Oct 2006 19:34:01 0000 1.2 @@ 1,5 +1,5 @@ ## y = grep(x) == x(find(x)) ## [y,f] = == [x(find(x)),find(x)] +## y = grep(x) = x(find(x)) +## [y,f] = [x(find(x)),find(x)] ## ## This function is just to save typing and improve readability, as in ## 
From: David Bateman <adb014@us...>  20061007 19:34:40

Update of /cvsroot/octave/octaveforge/main In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv26448/main Modified Files: INDEX Log Message: more indexing fixes Index: INDEX =================================================================== RCS file: /cvsroot/octave/octaveforge/main/INDEX,v retrieving revision 1.18 retrieving revision 1.19 diff u d r1.18 r1.19  INDEX 6 Oct 2006 20:49:47 0000 1.18 +++ INDEX 7 Oct 2006 19:34:01 0000 1.19 @@ 1115,11 +1115,9 @@ qp glpkmex extra >> Extra packages +finance >> Finance Finance fv fvl irr nper npv pmt pv pvl rate vol Server  listen send senderror statistics >> Statistics Depreciated @@ 1338,3 +1336,23 @@ kalman=use <f>lqe</f> kalmd=use <f>dlqe</f> or <f>dkalman</f> +image >> Image processing +Display + image + imagesc + imshow +Read/write + loadimage saveimage +Colour controls + hsv2rgb + ntsc2rgb + rgb2hsv + rgb2ntsc +Representation + gray2ind + ind2gray + ind2rgb + rgb2ind +Colour maps + gray + ocean 
From: David Bateman <adb014@us...>  20061007 19:34:40

Update of /cvsroot/octave/octaveforge/main/image In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv26448/main/image Modified Files: INDEX Log Message: more indexing fixes Index: INDEX =================================================================== RCS file: /cvsroot/octave/octaveforge/main/image/INDEX,v retrieving revision 1.17 retrieving revision 1.18 diff u d r1.17 r1.18  INDEX 6 Oct 2006 20:49:47 0000 1.17 +++ INDEX 7 Oct 2006 19:34:01 0000 1.18 @@ 8,7 +8,7 @@ imwrite imfinfo imginfo  loadimage saveimage bmpwrite jpgread jpgwrite pngread pngwrite + bmpwrite jpgread jpgwrite pngread pngwrite Reshape imcrop imresize @@ 57,10 +57,6 @@ cmpermute cmunique imapprox  hsv2rgb  ntsc2rgb  rgb2hsv  rgb2ntsc rgb2ycbcr ycbcr2rgb Representation @@ 78,8 +74,6 @@ rgb2gray rgb2ind Colour maps  gray  ocean hsv rainbow hot bone 
From: David Bateman <adb014@us...>  20061007 19:02:53

Update of /cvsroot/octave/octaveforge/extra/symband/doc In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv13784/extra/symband/doc Modified Files: Makefile Log Message: Add verbosity=0 to latex2html commands so that the url link to a non existent file is not added Index: Makefile =================================================================== RCS file: /cvsroot/octave/octaveforge/extra/symband/doc/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  Makefile 5 Oct 2006 15:01:13 0000 1.1 +++ Makefile 7 Oct 2006 19:02:50 0000 1.2 @@ 10,8 +10,10 @@ latex $< > /dev/null 2>&1 dvipdf $(@:.pdf=.dvi) +# Note verbosity=0 as well as making latex2html quieter, has the sideeffect +# of not including a url to the raw text, which it'll get wrong html/index.html : $(TEX)  latex2html $< + latex2html verbosity=0 $< if [ e "html" ]; then \ rm fr html; \ fi; \ 
From: David Bateman <adb014@us...>  20061007 19:02:53

Update of /cvsroot/octave/octaveforge/main/optim/doc In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv13784/main/optim/doc Modified Files: Makefile Log Message: Add verbosity=0 to latex2html commands so that the url link to a non existent file is not added Index: Makefile =================================================================== RCS file: /cvsroot/octave/octaveforge/main/optim/doc/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  Makefile 5 Oct 2006 12:32:07 0000 1.2 +++ Makefile 7 Oct 2006 19:02:50 0000 1.3 @@ 18,8 +18,10 @@ latex $< > /dev/null 2>&1 dvipdf $(@:.pdf=.dvi) +# Note verbosity=0 as well as making latex2html quieter, has the sideeffect +# of not including a url to the raw text, which it'll get wrong html/%/index.html : %.tex  latex2html $< + latex2html verbosity=0 $< if [ ! e "html" ]; then \ mkdir html; \ fi; \ 
From: David Bateman <adb014@us...>  20061007 19:02:53

Update of /cvsroot/octave/octaveforge/extra/MacOSX/doc In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv13784/extra/MacOSX/doc Modified Files: Makefile Log Message: Add verbosity=0 to latex2html commands so that the url link to a non existent file is not added Index: Makefile =================================================================== RCS file: /cvsroot/octave/octaveforge/extra/MacOSX/doc/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  Makefile 5 Oct 2006 15:01:13 0000 1.1 +++ Makefile 7 Oct 2006 19:02:49 0000 1.2 @@ 10,8 +10,10 @@ latex $< > /dev/null 2>&1 dvipdf $(@:.pdf=.dvi) +# Note verbosity=0 as well as making latex2html quieter, has the sideeffect +# of not including a url to the raw text, which it'll get wrong html/index.html : $(TEX)  latex2html $< + latex2html verbosity=0 $< if [ e "html" ]; then \ rm fr html; \ fi; \ 
From: David Bateman <adb014@us...>  20061007 19:02:52

Update of /cvsroot/octave/octaveforge/main/vrml/doc In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv13784/main/vrml/doc Modified Files: Makefile Log Message: Add verbosity=0 to latex2html commands so that the url link to a non existent file is not added Index: Makefile =================================================================== RCS file: /cvsroot/octave/octaveforge/main/vrml/doc/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  Makefile 5 Oct 2006 12:53:26 0000 1.2 +++ Makefile 7 Oct 2006 19:02:50 0000 1.3 @@ 10,8 +10,10 @@ latex $< > /dev/null 2>&1 dvipdf $(@:.pdf=.dvi) +# Note verbosity=0 as well as making latex2html quieter, has the sideeffect +# of not including a url to the raw text, which it'll get wrong html/index.html : $(TEX)  latex2html $< + latex2html verbosity=0 $< if [ e "html" ]; then \ rm fr html; \ fi; \ 
From: David Bateman <adb014@us...>  20061007 19:02:05

Update of /cvsroot/octave/octaveforge/main/infotheory/inst In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv13353 Modified Files: arithmetic_decode.m arithmetic_encode.m bscchannel.m conditionalentropy_XY.m conditionalentropy_YX.m entropy.m jointentropy.m laverage.m marginalc.m marginalr.m mutualinformation.m redundancy.m relativeentropy.m tunstallcode.m unarydec.m unaryenc.m Log Message: texinfofy the help of information theory function. Add Copyright so that octave recognizes that first block is a copyright Index: entropy.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/entropy.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  entropy.m 30 Sep 2006 05:26:27 0000 1.1 +++ entropy.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2006, May 31, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2006, May 31, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,16 +15,23 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: entropy(symbol_probabilites,{base}) ## computes the shannon entropy of a discrete source whose ## probabilities are given in first argument, and optionally ## base can be specified. Base of logarithm defaults to 2, ## when the entropy can be thought of as a measure of bits ## needed to represent any message of the source. +## * texinfo * +## @deftypefn {Function File} {} entropy (@var{symbol_probabilites}, @var{base}) ## ## example: entropy([0.25 0.25 0.25 0.25]) ans = 2 ## entropy([0.25 0.25 0.25 0.25],4) ans = 1 +## Computes the Shannon entropy of a discrete source whose +## probabilities are by @var{symbol_probabilities}, and optionally +## @var{base} can be specified. Base of logarithm defaults to 2, +## when the entropy can be thought of as a measure of bits +## needed to represent any message of the source. For example ## +## @example +## @group +## entropy([0.25 0.25 0.25 0.25]) @result{} ans = 2 +## entropy([0.25 0.25 0.25 0.25],4) @result{} ans = 1 +## @end group +## @end example +## @end deftypefn + function val=entropy(symprob,base) if nargin < 1 error("usage: entropy(symbol_probability_list); computes entropy in base2"); @@ 41,4 +48,4 @@ end %! %!assert(entropy([0.25 0.25 0.25 0.25]),2,0) %! \ No newline at end of file +%! Index: marginalr.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/marginalr.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  marginalr.m 30 Sep 2006 05:26:27 0000 1.1 +++ marginalr.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,12 +15,14 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: marginalr(XY) ## computes marginal probabilities along rows. ## ## XY is the transition matrix ## see also: marginalc +## * texinfo * +## @deftypefn {Function File} {} marginalr (@var{xy}) ## +## Computes marginal probabilities along rows. Where @var{xy} is the +## transition matrix +## @end deftypefn +## @seealso{marginalc} + function val=marginalr(XY) val=sum(XY'); return Index: conditionalentropy_XY.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/conditionalentropy_XY.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  conditionalentropy_XY.m 30 Sep 2006 05:26:27 0000 1.1 +++ conditionalentropy_XY.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,16 +15,38 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: conditionalentropy_XY(XY) computes the ## H(X/Y) = SUM( P(Yi)*H(X/Yi) ) , where H(X/Yi) = SUM( P(Xk/Yi)log(P(Xk/Yi)) ) ## , where P(Xk/Yi) = P(Xk,Yi)/P(Yi) ## XY matrix must have, Y along rows ## X along columns +## * texinfo * +## @deftypefn {Function File} {} conditionalentropy_XY (@var{x}, @var{y}) +## +## Computes the +## @iftex +## @tex +## $H(\frac{X}{Y}) = \sum_i{P(Y_i) H(\frac{X}{Y_i})$, where +## $H(\frac{X}{Y_i}) = \sum_k{P(\frac{X_k}{Y_i}) \log(P(\frac{X_k}{Y_i}))$, +## where $P(\frac{X_k}{Y_i} = \frac{P(X_k,Y_i)}{P(Y_i)}$. +## @end tex +## @end iftex +## @ifinfo +## H(X/Y) = SUM( P(Yi)*H(X/Yi) ) , where +## H(X/Yi) = SUM( P(Xk/Yi)log(P(Xk/Yi))), where +## P(Xk/Yi) = P(Xk,Yi)/P(Yi). +## @end ifinfo +## The matrix @var{xy} must have @var{y} along rows and @var{x} along columns. +## @iftex +## @tex +## $X_i = \sum{COL_i} +## $Y_i = \sum{ROW_i} +## $H(XY) = H(X,Y)  H(Y)$ +## @end tex +## @end iftex +## @ifinfo ## Xi = SUM( COLi ) ## Yi = SUM( ROWi ) ## H(XY) = H(X,Y)  H(Y) ## see also: entropy, conditionalentropy ## +## @end ifinfo +## @end deftypefn +## @seealso{entropy, conditionalentropy} + function val=conditionalentropy_XY(XY) val=0.0; for i=1:size(XY)(2) Index: marginalc.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/marginalc.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  marginalc.m 30 Sep 2006 05:26:27 0000 1.1 +++ marginalc.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,12 +15,14 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: marginalc(XY) ## computes marginal probabilities along columns. ## ## XY is the transition matrix ## see also: marginalr +## * texinfo * +## @deftypefn {Function File} {} marginalc (@var{xy}) ## +## Computes marginal probabilities along columns. Where @var{xy} is the +## transition matrix +## @end deftypefn +## @seealso{marginalr} + function val=marginalc(XY) val=sum(XY); return Index: mutualinformation.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/mutualinformation.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  mutualinformation.m 30 Sep 2006 05:26:28 0000 1.1 +++ mutualinformation.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,16 +15,20 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## usage: mutualinformation(XY) computes the ## mutual information of the given channel transition matrix. ## By definition we have I(X,Y) given as ## I(X:Y) = SUM( P(x,y) log2 ( p(x,y) / p(x)p(y) ) ) = relative_entropy(P(X,Y)  P(X),P(Y)) +## * texinfo * +## @deftypefn {Function File} {} mutualinformation (@var{xy}) +## +## Computes the mutual information of the given channel transition matrix. +## By definition we have @code{I(@var{x}, @var{y}) given as +## @code{I(@var{x}:@var{y}) = SUM(P(@var{x},@var{y}) * log2(p(@var{x},@var{y}) +## / p(@var{x})/p(@var{y}))) = relative_entropy(P(@var{x},@var{y})  +## P(@var{x}),P(@var{y}))} ## Mutual Information, is amount of information, one variable ## has, about the other. It is the reduction of uncertainity. ## This is a symmetric function. ## ## see also: entropy, conditionalentropy ## +## @end deftypefn +## @seealso{entropy, conditionalentropy} + function val=mutualinformation(XY) if nargin < 1  ~ismatrix(XY) error('Usage: mutualinformation(XY) where XY is the transition matrix'); Index: tunstallcode.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/tunstallcode.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  tunstallcode.m 30 Sep 2006 05:26:28 0000 1.1 +++ tunstallcode.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) June 2006, Muthiah Annamalai Sat Jun 3 01:44:59 CDT 2006 +## Copyright (C) June 2006, Muthiah Annamalai Sat Jun 3 01:44:59 CDT 2006 ## <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify @@ 15,28 +15,34 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## usage: code_dictionary = tunstallcode(probability_list) ## Implementation of a Abit tunstall coder ## given the source probability of the A symbols ## from the source with 2^A codewords involved. ## The variable probability_list ordering of symbols is ## preserved in the output symbol/code dictionary. +## * texinfo * +## @deftypefn {Function File} {@var{code_dictionary} =} tunstallcode (@var{probability_list}) +## +## Implementation of a @code{A}bit tunstall coder given the source +## probability of the @code{A} symbols from the source with @code{2^A} +## codewords involved. The variable @var{probability_list} ordering of +## symbols is preserved in the output symbol/code dictionary. ## Tunstall code is a variable to fixed source coding scheme, ## and the arrangement of the codeword list order corrseponds to ## to the regular tunstall code ordering of the variable source ## word list, and the codes for each of them are enumerations ## from 1:2^N. Return only the ordering (grouping) of source symbols +## from @code{1:2^N}. Return only the ordering (grouping) of source symbols ## as their index of match is the corresponding code word. The ## probabilites of the various symbols are also stored in here. +## for example ## ## example: [cw_list,prob_list]=tunstallcode([0.6 .3 0.1]) ## essentially you will use the cw_list to parse the input ## and then compute the code as the binary value of their index ## of match, since it is a variable to fixed code. +## @example +## [cw_list, prob_list] = tunstallcode([0.6 .3 0.1]) +## @end example +## +## essentially you will use the cw_list to parse the input +## and then compute the code as the binary value of their index +## of match, since it is a variable to fixed code. ## ## Reference: "Synthesis of noiseless compression codes", Ph.D. Thesis ## of B.P. Tunstall, Georgia Tech, Sept 1967 ## +## @end deftypefn + function [cw_list,prob_list]=tunstallcode(prob_list) if nargin < 1 error('usage: tunstallcode(probability_list)'); Index: laverage.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/laverage.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  laverage.m 30 Sep 2006 05:26:27 0000 1.1 +++ laverage.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) Aug, 2006 Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) Aug, 2006 Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 14,16 +14,22 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## usage: avgbits = laverage(codebook,problist); +## * texinfo * +## @deftypefn {Function File} {@var{avgbits} =} laverage (@var{codebook}, @var{problist}) ## ## Compute the average word length SUM(i=1:N)Li.Pi +## Compute the average word length @code{SUM(@var{i} = 1:@var{N})* Li * Pi} ## where codebook is a struct of strings, where each ## string represents the codeword. Problist is the ## probability values. +## probability values. For example ## ## example: x={"0","111","1110"}; p=[0.1 0.5 0.4]; ## laverage(x,p) #must give ## ans = 3.2000 +## @example +## @group +## x = @{"0","111","1110"@}; p=[0.1 0.5 0.4]; +## laverage(x, p) @result{} ans = 3.2000 +## @end group +## @end example +## @end deftypefn + function Lavg=laverage(codebook,problist) if nargin < 2 error('usage laverage(codebook,problist)'); @@ 39,4 +45,4 @@ %! x={"0","111","1110"}; %! p=[0.1 0.5 0.4]; %! assert(laverage(x,p),3.200,0.001); %! \ No newline at end of file +%! Index: relativeentropy.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/relativeentropy.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  relativeentropy.m 30 Sep 2006 05:26:28 0000 1.1 +++ relativeentropy.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,17 +15,17 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: relativeentropy(p,q) computes the ## relative entropy between the 2 give pdf's. ## ## d(p  q) = ## KullbackLeiber distance between 2 probability, ## distributions, is relative entropy. Not a real measure ## as its not symmetric. wherever infinity is present, we ## reduce it to zeros ## ## see also: entropy, conditionalentropy +## * texinfo * +## @deftypefn {Function File} {} relativeentropy (@var{p}, @var{q}) ## +## Computes the relative entropy between the 2 given pdf's. +## @code{d(@var{p}  @var{q})} is the KullbackLeiber distance +## between 2 probability, distributions, is relative entropy. +## Not a real measure as its not symmetric. wherever infinity is +## present, we reduce it to zeros +## @end deftypefn +## @seealso{entropy, conditionalentropy} + function val=relativeentropy(p,q) if nargin < 2  size(p)~=size(q)  ~isvector(p)  ~isvector(q) error('usage: relativeentropy(p,q) of equal length'); Index: unaryenc.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/unaryenc.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  unaryenc.m 30 Sep 2006 05:26:28 0000 1.1 +++ unaryenc.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 14,27 +14,30 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA  ## usage: unaryenc(value) ## This function encodes the decimal value. ## useful if you are trying to perform golombrice coding ## value needs to be a number or rowvector. value is a nonnegative ## number. ## ## Theory: Unary encoding of a +ve number N is done as follows, ## use Nones followed by one zero. For instance, the ## unary coded value of 5 will be then (111110)base2 ## which is 31x2 = 62. ## From this definition, decoding follows. ## ## example: ## message=[ 5 4 4 1 1 1] ## coded=unaryenc(message); #gives 62 30 30 2 2 2 ## unarydec(coded) #gives message back. +## * texinfo * +## @deftypefn {Function File} {} unaryenc (@var{value}) ## +## This function encodes the decimal value. +## Useful if you are trying to perform golombrice coding +## value needs to be a number or rowvector. @var{value} +## is a nonnegative number. ## ## See also: unarydec +## Unary encoding of a +ve number N is done as follows, +## use Nones followed by one zero. For instance, the +## unary coded value of 5 will be then (111110) in base2 +## which is 31x2 = 62. From this definition, decoding follows. ## +## @example +## @group +## message = [5 4 4 1 1 1] +## coded = unaryenc(message) +## @result{} [62 30 30 2 2 2] +## unarydec(coded) +## @result{} [5 4 4 1 1 1] +## @end group +## @end example +## @end deftypefn +## @seealso{unarydec} ## ## Optimal for exponential sequences Index: unarydec.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/unarydec.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  unarydec.m 30 Sep 2006 05:26:28 0000 1.1 +++ unarydec.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 14,19 +14,25 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## usage: unarydec(value) ## This function decodes the unary encoded value. ## useful if you are trying to perform golombrice coding ## value needs to be a number or rowvector. +## * texinfo * +## @deftypefn {Function File} {} unarydec (@var{value}) ## ## example: ## message=[ 5 4 4 1 1 1] ## coded=unaryenc(message); #gives 62 30 30 2 2 2 ## unarydec(coded) #gives message back. +## This function decodes the unary encoded value. +## Useful if you are trying to perform golombrice coding +## value needs to be a number or rowvector. For example ## +## @example +## @group +## message = [5 4 4 1 1 1] +## coded = unaryenc(message) +## @result{} [62 30 30 2 2 2] +## unarydec(coded) +## @result{} [5 4 4 1 1 1] +## @end group +## @end example +## @end deftypefn +## @seealso{unaryenc} ## See also: unaryenc ## function rval=unarydec(val) rval=log2(val+2)1; end Index: arithmetic_decode.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/arithmetic_decode.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  arithmetic_decode.m 30 Sep 2006 05:26:27 0000 1.1 +++ arithmetic_decode.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 14,18 +14,25 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: arithmetic_decode(tag_message,symbol_probabilites_list) ## computes the message from arithmetic code given with symbol ## probabilities. The arithmetic decoding procedure assumes ## that the message is a list of numbers and the symbol probabilities ## correspond to the index. The message is returned. ## example: symbols=[1,2,3,4]; sym_prob=[0.5 0.25 0.15 0.10]; +## * texinfo * +## @deftypefn {Function File} {} arithmetic_decode (@var{tag_message}, @var{symbol_probabilites_list}) +## +## Computes the message from arithmetic code given with symbol +## probabilities. The arithmetic decoding procedure assumes +## that @var{message} is a list of numbers and the symbol probabilities +## correspond to the index. The message is returned. For example +## +## @example +## @group +## symbols=[1,2,3,4]; sym_prob=[0.5 0.25 0.15 0.10]; ## message=[1, 1, 2, 3, 4]; ## arithmetic_encode(message,sym_prob) ans=0.18078 ## arithmetic_decode(0.18078,sym_prob) ans=[1 1 2 3 4]; ## see also: arithmetic_encode ## +## @end group +## @end example +## @end deftypefn +## @seealso{arithmetic_encode} % FIXME %  Index: arithmetic_encode.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/arithmetic_encode.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  arithmetic_encode.m 30 Sep 2006 05:26:27 0000 1.1 +++ arithmetic_encode.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2006, August, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,18 +15,23 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: arithmetic_encode(message,symbol_probabilites_list) ## computes the arithmetic code for the message with symbol +## * texinfo * +## @deftypefn {Function File} {} arithmetic_encode (@var{message}, @var{symbol_probabilites_list}) +## +## Computes the arithmetic code for the message with symbol ## probabilities are given. The arithmetic coding procedure assumes ## that the message is a list of numbers and the symbol probabilities ## correspond to the index. +## that @var{message} is a list of numbers and the symbol probabilities +## correspond to the index. For example ## ## example: symbols=[1,2,3,4]; sym_prob=[0.5 0.25 0.15 0.10]; +## @example +## @group +## symbols=[1,2,3,4]; sym_prob=[0.5 0.25 0.15 0.10]; ## message=[1, 1, 2, 3, 4]; ## arithmetic_encode(message,sym_prob) ans=0.18078 ## ## see also: arithmetic_decode ## +## @end group +## @end example +## @end deftypefn +## @seealso{arithmetic_decode} % FIXME %  Index: jointentropy.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/jointentropy.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  jointentropy.m 30 Sep 2006 05:26:27 0000 1.1 +++ jointentropy.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 14,13 +14,16 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## usage: jointentropy(XY) computes the ## joint entropy of the given channel transition matrix. ## By definition we have H(X,Y) given as ## H(X:Y) = SUMx( SUMy( P(x,y) log2 ( p(x,y) ) ) ) ## ## see also: entropy, conditionalentropy +## * texinfo * +## @deftypefn {Function File} {} jointentropy (@var{xy}) ## +## Computes the joint entropy of the given channel transition matrix. +## By definition we have @code{H(@var{x}, @var{y})} given as +## @code{H(@var{x}:@var{y}) = SUMx(SUMy(P(@var{x}, @var{y}) * +## log2(p(@var{x}, @var{y}))))} +## @end deftypefn +## @seealso{entropy, conditionalentropy} + function val=jointentropy(XY) if nargin < 1  ~ismatrix(XY) error('Usage: jointentropy(XY) where XY is the transition matrix'); Index: bscchannel.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/bscchannel.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  bscchannel.m 30 Sep 2006 05:26:27 0000 1.1 +++ bscchannel.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,13 +15,14 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: bscchannel(p) +## * texinfo * +## @deftypefn {Function File} {} bscchannel (@var{p}) +## ## Returns the transition matrix for a Binary Symmetric ## Channel with error probability, p. ## +## Channel with error probability, @var{p}. +## @end deftypefn +## @seealso{entropy} ## see also: entropy ## function transmat=bschannel(p) transmat=[ 1p p; p 1p]; return Index: redundancy.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/redundancy.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  redundancy.m 30 Sep 2006 05:26:28 0000 1.1 +++ redundancy.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2006, September 28, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2006, September 28, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,15 +15,22 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: redundancy(code_word_list,symbol_probabilites) ## computes the wasted excessive bits over the entropy ## when using a particular coding scheme. +## * texinfo * +## @deftypefn {Function File} {} redundancy (@var{code_word_list}, @var{symbol_probabilites}) ## ## example: prob_list=[0.5 0.25 0.15 0.1]; ## min_bits=entropy(prob_list); ## cw_list=huffman(prob_list); ## redundancy(cw_list,prob_list) +## Computes the wasted excessive bits over the entropy when using a +## particular coding scheme. For example ## +## @example +## @group +## prob_list = [0.5 0.25 0.15 0.1]; +## min_bits = entropy(prob_list); +## cw_list = huffman(prob_list); +## redundancy(cw_list,prob_list) +## @end group +## @end example +## @end deftypefn + function [val,ent,lavg]=redundancy(code_word_list,symprob) if ( nargin < 2 ) error("usage: redundancy(code_word_list,symbol_probability_list); computes entropy in base2"); Index: conditionalentropy_YX.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/infotheory/inst/conditionalentropy_YX.m,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  conditionalentropy_YX.m 30 Sep 2006 05:26:27 0000 1.1 +++ conditionalentropy_YX.m 7 Oct 2006 19:01:57 0000 1.2 @@ 1,4 +1,4 @@ ## (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> +## Copyright (C) 2005, December, Muthiah Annamalai, <muthiah.annamalai@...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ 15,16 +15,35 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA ## ## usage: conditionalentropy_XY(XY) computes the ## H(Y/X) = SUM( P(Xi)*H(Y/Xi) ), where H(Y/Xi) = SUM( P(Yk/Xi)log(P(Yk/Xi)) ) ## ## XY matrix must have, Y along rows ## X along columns +## * texinfo * +## @deftypefn {Function File} {} conditionalentropy_YX (@var{xy}) +## +## Computes the +## @iftex +## @tex +## $H(\frac{Y}{X}) = \sum_i{P(X_i) H(\frac{Y}{X_i})$, where +## $H(\frac{Y}{X_i}) = \sum_k{P(\frac{Y_k}{X_i}) \log(P(\frac{Y_k}{X_i}))$. +## @end tex +## @end iftex +## @ifinfo +## H(Y/X) = SUM( P(Xi)*H(Y/Xi) ), where H(Y/Xi) = SUM( P(Yk/Xi)log(P(Yk/Xi))) +## @end ifinfo +## The matrix @var{xy} must have @var{y} along rows and @var{x} along columns. +## @iftex +## @tex +## $X_i = \sum{COL_i} +## $Y_i = \sum{ROW_i} +## $H(YX) = H(X,Y)  H(X)$ +## @end tex +## @end iftex +## @ifinfo ## Xi = SUM( COLi ) ## Yi = SUM( ROWi ) ## H(YX) = H(X,Y)  H(X) ## ## See also: conditionalentropy_XY +## @end ifinfo +## @end deftypefn +## @seealso{entropy, conditionalentropy_XY} + function val=conditionalentropy_YX(XY) val=0.0; for i=1:size(XY)(1) 
From: Thomas Treichl <treichl@us...>  20061007 18:03:42

Update of /cvsroot/octave/octaveforge/main/odepkg/inst In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv22374 Added Files: odepkg_equations_roessler.m odepkg_event_handle.m Log Message: Further improved functionality. See main/odepkg/doc/ChangeLog for further details.  NEW FILE: odepkg_equations_roessler.m  %# Copyright (C) 2006, Thomas Treichl <treichl@...> %# OdePkg  Package for solving ordinary differential equations with octave %# %# This program is free software; you can redistribute it and/or modify %# it under the terms of the GNU General Public License as published by %# the Free Software Foundation; either version 2 of the License, or %# (at your option) any later version. %# %# This program is distributed in the hope that it will be useful, %# but WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %# GNU General Public License for more details. %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA %# * texinfo * %# @deftypefn {Function} {@var{[y]} =} odepkg_equations_lorenz (@var{t}, @var{x}) %# TODO %# @end deftypefn %# %# @seealso{odepkg} function y = odepkg_equations_roessler (t, x) y = [ ( x(2) + x(3) ); x(1) + 0.2 * x(2); 0.2 + x(1) * x(3)  5.7 * x(3)]; %!test A = odeset ('MaxStep', 1e1); %! [t, y] = ode78 (@odepkg_equations_roessler, [0 70], [0.1 0.3 0.1], A); %!demo %! %! A = odeset ('MaxStep', 1e1); %! [t, y] = ode78 (@odepkg_equations_roessler, [0 70], [0.1 0.3 0.1], A); %! %! subplot (2, 2, 1); grid ('on'); plot (t, y(:,1), 'b;f_x(t);', ... %! t, y(:,2), 'g;f_y(t);', t, y(:,3), 'r;f_z(t);'); %! subplot (2, 2, 2); grid ('on'); plot (y(:,1), y(:,2), 'b;f_{xyz}(x, y);'); %! subplot (2, 2, 3); grid ('on'); plot (y(:,2), y(:,3), 'b;f_{xyz}(y, z);'); %! subplot (2, 2, 4); grid ('on'); plot3 (y(:,1), y(:,2), y(:,3), ... %! 'b;f_{xyz}(x, y, z);'); %! %! %  %! % TODO %# Local Variables: *** %# mode: octave *** %# End: ***  NEW FILE: odepkg_event_handle.m  %# Copyright (C) 2006, Thomas Treichl <treichl@...> %# OdePkg  Package for solving ordinary differential equations with octave %# %# This program is free software; you can redistribute it and/or modify %# it under the terms of the GNU General Public License as published by %# the Free Software Foundation; either version 2 of the License, or %# (at your option) any later version. %# %# This program is distributed in the hope that it will be useful, %# but WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %# GNU General Public License for more details. %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA %# * texinfo * %# @deftypefn {Function} {@var{[sol]} =} odepkg_event_handle (@var{@@fun, time, y, flag, [P1, P2, @dots{}]}) %# Evaluates the event function of an ode solver call, if before the event option was set with the command odeset. This function is an internal helper function, therefore this function should never be directly called by a user. No error handling has been implemented in this function. %# @end deftypefn %# %# @seealso{odepkg} %# Maintainer: Thomas Treichl %# Created: 20060928 %# ChangeLog: function [vretval] = odepkg_event_handle (vevefun, vt, vy, vflag, varargin) %# vretval{1} is true or false; either to terminate or to continue %# vretval{2} is the index information for which event occured %# vretval{3} is the time information column vector %# vretval{4} is the line by line result information matrix %# These persistent variables are needed to store the results and the %# time value from the processing in the time stamp before, veveold %# are the results from the event function, vtold the time stamp, %# vretcell the return values cell array, vyold the result of the ode %# and vevecnt the counter for how often this event handling %# has been called persistent veveold; persistent vtold; persistent vretcell; persistent vyold; persistent vevecnt; %# Call the event function if an event function has been defined to %# initialize the internal variables of the event function an to get %# a value for veveold if (strcmp (vflag, 'init') == true) if (isempty (varargin) == true) [veveold, vterm, vdir] = feval (vevefun, vt, vy); else [veveold, vterm, vdir] = feval (vevefun, vt, vy, varargin); end %# My first implementation was to return row vectors from the event %# functions but this is faulty if we use LabMat events. So this has %# changed 20060928 and by now these return vectors must be column %# vectors. The not so nice implementation then is: veveold = veveold(:)'; vterm = vterm(:)'; vdir = vdir(:)'; vtold = vt; %# veveold has been set in the code lines before for vcnt = 1:4, vretcell{vcnt} = []; end vyold = vy; vevecnt = 1; %# Process the event, find the zero crossings either for a rising %# or for a falling edge elseif (isempty (vflag) == true) %# Call the event function if an event function has been defined to %# to get the value(s) veve if (isempty (varargin) == true) [veve, vterm, vdir] = feval (vevefun, vt, vy); else [veve, vterm, vdir] = feval (vevefun, vt, vy, varargin); end veve = veve(:)'; vterm = vterm(:)'; vdir = vdir(:)'; %# Check if one or more signs of the event function results changed vsignum = (sign (veveold) ~= sign (veve)); if (any (vsignum) == true) %# One or more values have changed vindex = find (vsignum); %# Get the index of the changed values if (any (vdir(vindex) == 0)) %# Rising or falling (both are possible) %# Don't change anything, keep the index elseif (any (vdir(vindex) == sign (veve(vindex))) == true) %# Detected rising or falling, need a new index vindex = find (vdir == sign (veve)); else %# Found a zero crossing that will not be notified vindex = []; end %# We create a new output values if we found a valid index if (isempty (vindex) == false) %# Change the persistent result cell array vretcell{1} = any (vterm(vindex) == true); %# Stop integration or not vretcell{2}(vevecnt,1) = vindex(1,1); %# Take first event that occurs %# Calculate the time stamp when the event function returned 0 and %# calculate new values for the integration results, we do both by %# a linear interpolation vtnew = vt  veve(1,vindex) * (vt  vtold) / (veve(1,vindex)  veveold(1,vindex)); vynew = (vy  (vt  vtnew) * (vy  vyold) / (vt  vtold)); vretcell{3}(vevecnt,1) = vtnew; vretcell{4}(vevecnt,:) = vynew'; vevecnt = vevecnt + 1; end end %# Check if one or more signs ... veveold = veve; vtold = vt; vretval = vretcell; vyold = vy; %# Reset this event handling function elseif (strcmp (vflag, 'done') == true) clear ('veveold', 'vtold', 'vretcell', 'vyold', 'vevecnt'); for vcnt = 1:4, vretcell{vcnt} = []; end end %# if (strcmp (vflag, ...) == true) %# Local Variables: *** %# mode: octave *** %# End: *** 
From: Thomas Treichl <treichl@us...>  20061007 18:02:08

Update of /cvsroot/octave/octaveforge/main/odepkg In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv21558 Modified Files: COPYING DESCRIPTION Added Files: INDEX Log Message: Updated.  NEW FILE: INDEX  odepkg >> OdePkg Solver ode23 ode45 ode54 ode78 Solver Options odeset = Hallo Wolrd odeget odepkg_structure_check Index: DESCRIPTION =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/DESCRIPTION,v retrieving revision 1.4 retrieving revision 1.5 diff u d r1.4 r1.5  DESCRIPTION 2 Oct 2006 19:47:37 0000 1.4 +++ DESCRIPTION 7 Oct 2006 18:02:00 0000 1.5 @@ 1,5 +1,5 @@ Name: OdePkg Version: 0.0.1 +Version: 0.1.0 Date: 20060912 Author: Thomas Treichl Maintainer: Thomas Treichl Index: COPYING =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/COPYING,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  COPYING 13 Sep 2006 11:21:43 0000 1.1 +++ COPYING 7 Oct 2006 18:02:00 0000 1.2 @@ 1,339 +1,339 @@  GNU GENERAL PUBLIC LICENSE  Version 2, June 1991   Copyright (C) 1989, 1991 Free Software Foundation, Inc.  675 Mass Ave, Cambridge, MA 02139, USA  Everyone is permitted to copy and distribute verbatim copies  of this license document, but changing it is not allowed.   Preamble   The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free softwareto make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.   When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.   To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.   For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.   We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.   Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.   Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.   The precise terms and conditions for copying, distribution and modification follow.   GNU GENERAL PUBLIC LICENSE  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION   0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".  Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.   1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.  You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.   2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:   a) You must cause the modified files to carry prominent notices  stating that you changed the files and the date of any change.   b) You must cause any work that you distribute or publish, that in  whole or in part contains or is derived from the Program or any  part thereof, to be licensed as a whole at no charge to all third  parties under the terms of this License.   c) If the modified program normally reads commands interactively  when run, you must cause it, when started running for such  interactive use in the most ordinary way, to print or display an  announcement including an appropriate copyright notice and a  notice that there is no warranty (or else, saying that you provide  a warranty) and that users may redistribute the program under  these conditions, and telling the user how to view a copy of this  License. (Exception: if the Program itself is interactive but  does not normally print such an announcement, your work based on  the Program is not required to print an announcement.)  These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.  Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.  In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.   3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:   a) Accompany it with the complete corresponding machinereadable  source code, which must be distributed under the terms of Sections  1 and 2 above on a medium customarily used for software interchange; or,   b) Accompany it with a written offer, valid for at least three  years, to give any third party, for a charge no more than your  cost of physically performing source distribution, a complete  machinereadable copy of the corresponding source code, to be  distributed under the terms of Sections 1 and 2 above on a medium  customarily used for software interchange; or,   c) Accompany it with the information you received as to the offer  to distribute corresponding source code. (This alternative is  allowed only for noncommercial distribution and only if you  received the program in object code or executable form with such  an offer, in accord with Subsection b above.)  The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.  If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.   4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.   5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.   6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.   7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royaltyfree redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.  If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.  It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.  This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.   8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.   9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.  Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.   10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.   NO WARRANTY   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.   12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.   END OF TERMS AND CONDITIONS   How to Apply These Terms to Your New Programs   If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.   To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.   <one line to give the program's name and a brief idea of what it does.>  Copyright (C) 19yy <name of author>   This program is free software; you can redistribute it and/or modify  it under the terms of the GNU General Public License as published by  the Free Software Foundation; either version 2 of the License, or  (at your option) any later version.   This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  GNU General Public License for more details.   You should have received a copy of the GNU General Public License  along with this program; if not, write to the Free Software  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  Also add information on how to contact you by electronic and paper mail.  If the program is interactive, make it output a short notice like this when it starts in an interactive mode:   Gnomovision version 69, Copyright (C) 19yy name of author  Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.  This is free software, and you are welcome to redistribute it  under certain conditions; type `show c' for details.  The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouseclicks or menu itemswhatever suits your program.  You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:   Yoyodyne, Inc., hereby disclaims all copyright interest in the program  `Gnomovision' (which makes passes at compilers) written by James Hacker.   <signature of Ty Coon>, 1 April 1989  Ty Coon, President of Vice  This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +softwareto make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machinereadable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machinereadable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royaltyfree redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouseclicks or menu itemswhatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. 
From: Thomas Treichl <treichl@us...>  20061007 18:02:06

Update of /cvsroot/octave/octaveforge/main/odepkg/inst In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv21558/inst Modified Files: ode23.m ode45.m ode54.m ode78.m odephas2.m odephas3.m odepkg.m odeplot.m odeprint.m Log Message: Updated. Index: ode54.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/ode54.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  ode54.m 22 Sep 2006 17:02:14 0000 1.2 +++ ode54.m 7 Oct 2006 18:02:00 0000 1.3 @@ 144,11 +144,9 @@ if (isempty (vodeoptions.MaxStep) == true) vodeoptions.MaxStep = abs (vslot(1,1)  vslot(1,length (vslot))) / 10; end %# I'm implementing this feature at the moment if (isequal (vodeoptions.Events, vodetemp.Events) == false) %# vhaveeventfunction = true; warning ('Not yet implemented option "Events" will be ignored'); %# else, vhaveeventfunction = false;  warning ('Not yet implemented option "Events" will be ignored'); end + vhaveeventfunction = true; %# default value is [] + else, vhaveeventfunction = false; end %# Option Jacobian will be ignored by this solver because when using an %# explicite solver mechanism then no Jacobian Matrix is calculated @@ 215,9 +213,16 @@ vretvalresult = vinit(vodeoptions.OutputSel); else, vretvalresult = vinit; end  if (vhaveoutputfunction == true), %# Initialize OutputFcn  feval (vodeoptions.OutputFcn, vslot, ...  vretvalresult, 'init', vfunarguments{:}); + %# Initialize OutputFcn + if (vhaveoutputfunction == true) + feval (vodeoptions.OutputFcn, vslot', ... + vretvalresult', 'init', vfunarguments{:}); + end + + %# Initialize EventFcn + if (vhaveeventfunction == true) + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult', 'init', vfunarguments{:}); end vpow = 1/6; %# See p.91 in Ascher & Petzold @@ 235,7 +240,7 @@ %# The solver main loop  stop if endpoint has been reached vcntloop = 2; vcntcycles = 1; vu = vinit; vk = vu' * zeros(1,7);  vunhandledtermination = true; + vcntiter = 0; vunhandledtermination = true; while ((vtimestamp < vtimestop && vstepsize >= vminstepsize) == true) %# Hit the endpoint of the time slot exactely @@ 287,8 +292,32 @@ if (vhaveoutputselection == true) vretvalresult(vcntloop,:) = vu(vodeoptions.OutputSel); else, vretvalresult(vcntloop,:) = vu; end  vcntloop = vcntloop + 1;  end + vcntloop = vcntloop + 1; vcntiter = 0; + + %# Call plot only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if plot function + %# returns false + if (vhaveoutputfunction == true) + vpltret = feval (vodeoptions.OutputFcn, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vpltret == false), vunhandledtermination = false; break; end + end + + %# Call event only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if veventbreak is + %# true + if (vhaveeventfunction == true) + vevent = ... + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vevent{1} == true) + vretvaltime(vcntloop1,:) = vevent{3}(end,:); + vretvalresult(vcntloop1,:) = vevent{4}(end,:); + vunhandledtermination = false; break; + end + end + + end %# If the error is acceptable ... %# Update the step size for the next integration step if (vstepsizegiven == false) @@ 300,30 +329,29 @@ end end  %# Update counter that counts the number of cycles  vcntcycles = vcntcycles + 1; %# needed for postprocessing + %# Update counters that count the number of iteration cycles + vcntcycles = vcntcycles + 1; %# Needed for postprocessing + vcntiter = vcntiter + 1; %# Needed to find iteration problems  %# Stop integration if return value of plotting function is false  if (vhaveoutputfunction == true)  vpltret = feval (vodeoptions.OutputFcn, vtimestamp, vretvalresult(vcntloop1,:), [], vfunarguments{:});  if (vpltret == false), vunhandledtermination = false; break; end + %# Stop solving because the last 1000 steps no successful valid + %# value has been found + if (vcntiter >= 1000) + vmsg = sprintf (['Solving has not been successful. The iterative', ... + ' integration loop exited at time t = %f before endpoint at', ... + ' tend = %f was reached. This happened because the iterative', ... + ' integration loop does not find a valid soultion at this time', ... + ' stamp. Try to reduce the value of "InitialStep" and/or', ... + ' "MaxStep" with the command "odeset".\n'], vtimestamp, vtimestop); + error (vmsg); end  %# Handle the event function if an event function was set with odeset %# if (vhaveeventfunction == true)  %# [vreteve, vretter, vretdir] = feval (vodeoptions.Events, vtimestamp, vretvalresult(vcntloop1,:)');  %# Reminder: Event handling should be in an extra function with  %# 'init', [], 'done' like the odeplot functions (using also  %# persistent variables to store needed variables etc. %# end  end %# The main loop %# Check if integration of the ode has been successful if (vtimestamp < vtimestop)  if (vunhandledtermination == false) + if (vunhandledtermination == true) vmsg = sprintf (['Solving has not been successful. The iterative', ...  ' integration loop has been exited at time t = %f', ... + ' integration loop exited at time t = %f', ... ' before endpoint at tend = %f was reached. This may', ... ' happen if the stepsize grows smaller than defined in', ... ' vminstepsize. Try to reduce the value of "InitialStep" and/or', ... @@ 333,15 +361,20 @@ vmsg = sprintf (['Solver has been stopped by a call of "break" in', ... ' the main iteration loop at time t = %f before endpoint at', ... ' tend = %f was reached. This may happen because the @odeplot', ...  ' or the @event function returned zero.'], vtimestamp, vtimestop); + ' function returned zero or the @event function returned one.'], ... + vtimestamp, vtimestop); warning (vmsg); end end %# Postprocessing, do whatever when terminating integration algorithm  if (vhaveoutputfunction == true), %# Cleanup plotter + if (vhaveoutputfunction == true) %# Cleanup plotter feval (vodeoptions.OutputFcn, vtimestamp, ...  vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); + vretvalresult(vcntloop1,:)', 'done', vfunarguments{:}); + end + if (vhaveeventfunction == true) %# Cleanup event function handling + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); end %# Print additional information if option Stats is set @@ 364,9 +397,13 @@ elseif (nargout == 5) varargout{1} = vretvaltime; %# Same as (nargout == 2) varargout{2} = vretvalresult; %# Same as (nargout == 2)  varargout{3} = []; %# Not yet implemented  varargout{4} = []; %# Not yet implemented  varargout{5} = []; %# Not yet implemented + if (vhaveeventfunction == true) + varargout{3} = vevent{3}; %# Time info when an event occured + varargout{4} = vevent{4}; %# Results when an event occured + varargout{5} = vevent{2}; %# Index info which event occured + else + varargout{3} = varargout{4} = varargout{5} = []; + end %# else nothing will be returned, varargout{1} undefined end Index: ode23.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/ode23.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  ode23.m 22 Sep 2006 17:02:14 0000 1.2 +++ ode23.m 7 Oct 2006 18:02:00 0000 1.3 @@ 143,11 +143,9 @@ if (isempty (vodeoptions.MaxStep) == true) vodeoptions.MaxStep = abs (vslot(1,1)  vslot(1,length (vslot))) / 10; end %# I'm implementing this feature at the moment if (isequal (vodeoptions.Events, vodetemp.Events) == false) %# vhaveeventfunction = true; warning ('Not yet implemented option "Events" will be ignored'); %# else, vhaveeventfunction = false;  warning ('Not yet implemented option "Events" will be ignored'); end + vhaveeventfunction = true; %# default value is [] + else, vhaveeventfunction = false; end %# Option Jacobian will be ignored by this solver because when using an %# explicite solver mechanism then no Jacobian Matrix is calculated @@ 214,9 +212,16 @@ vretvalresult = vinit(vodeoptions.OutputSel); else, vretvalresult = vinit; end  if (vhaveoutputfunction == true), %# Initialize OutputFcn  feval (vodeoptions.OutputFcn, vslot, ...  vretvalresult, 'init', vfunarguments{:}); + %# Initialize OutputFcn + if (vhaveoutputfunction == true) + feval (vodeoptions.OutputFcn, vslot', ... + vretvalresult', 'init', vfunarguments{:}); + end + + %# Initialize EventFcn + if (vhaveeventfunction == true) + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult', 'init', vfunarguments{:}); end vpow = 1/4; %# See p.91 in Ascher & Petzold @@ 230,7 +235,7 @@ %# The solver main loop  stop if endpoint has been reached vcntloop = 2; vcntcycles = 1; vu = vinit; vk = vu' * zeros(1,4);  vunhandledtermination = true; + vcntiter = 0; vunhandledtermination = true; while ((vtimestamp < vtimestop && vstepsize >= vminstepsize) == true) %# Hit the endpoint of the time slot exactely @@ 257,15 +262,6 @@ vfunarguments{:}); end  %# This was the old code fragment without mass implementation  %# vk(:,1) = feval (vfun, vtimestamp, vu', vfunarguments{:});  %# for j = 1:12  %# vk(:,j+1) = feval ...  %# (vfun, vtimestamp + vc(j+1,1) * vstepsize, ...  %# vu' + vstepsize * vk(:,1:j) * va(j+1,1:j)', ...  %# vfunarguments{:});  %# end  %# Compute the 2nd and the 3rd order estimation y2 = vu' + vstepsize * (vk * vb2); y3 = vu' + vstepsize * (vk * vb3); @@ 291,8 +287,32 @@ if (vhaveoutputselection == true) vretvalresult(vcntloop,:) = vu(vodeoptions.OutputSel); else, vretvalresult(vcntloop,:) = vu; end  vcntloop = vcntloop + 1;  end + vcntloop = vcntloop + 1; vcntiter = 0; + + %# Call plot only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if plot function + %# returns false + if (vhaveoutputfunction == true) + vpltret = feval (vodeoptions.OutputFcn, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vpltret == false), vunhandledtermination = false; break; end + end + + %# Call event only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if veventbreak is + %# true + if (vhaveeventfunction == true) + vevent = ... + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vevent{1} == true) + vretvaltime(vcntloop1,:) = vevent{3}(end,:); + vretvalresult(vcntloop1,:) = vevent{4}(end,:); + vunhandledtermination = false; break; + end + end + + end %# If the error is acceptable ... %# Update the step size for the next integration step if (vstepsizegiven == false) @@ 304,30 +324,29 @@ end end  %# Update counter that counts the number of cycles  vcntcycles = vcntcycles + 1; %# needed for postprocessing + %# Update counters that count the number of iteration cycles + vcntcycles = vcntcycles + 1; %# Needed for postprocessing + vcntiter = vcntiter + 1; %# Needed to find iteration problems  %# Stop integration if return value of plotting function is false  if (vhaveoutputfunction == true)  vpltret = feval (vodeoptions.OutputFcn, vtimestamp, vretvalresult(vcntloop1,:), [], vfunarguments{:});  if (vpltret == false), vunhandledtermination = false; break; end + %# Stop solving because the last 1000 steps no successful valid + %# value has been found + if (vcntiter >= 1000) + vmsg = sprintf (['Solving has not been successful. The iterative', ... + ' integration loop exited at time t = %f before endpoint at', ... + ' tend = %f was reached. This happened because the iterative', ... + ' integration loop does not find a valid soultion at this time', ... + ' stamp. Try to reduce the value of "InitialStep" and/or', ... + ' "MaxStep" with the command "odeset".\n'], vtimestamp, vtimestop); + error (vmsg); end  %# Handle the event function if an event function was set with odeset %# if (vhaveeventfunction == true)  %# [vreteve, vretter, vretdir] = feval (vodeoptions.Events, vtimestamp, vretvalresult(vcntloop1,:)');  %# Reminder: Event handling should be in an extra function with  %# 'init', [], 'done' like the odeplot functions (using also  %# persistent variables to store needed variables etc. %# end  end %# The main loop %# Check if integration of the ode has been successful if (vtimestamp < vtimestop)  if (vunhandledtermination == false) + if (vunhandledtermination == true) vmsg = sprintf (['Solving has not been successful. The iterative', ...  ' integration loop has been exited at time t = %f', ... + ' integration loop exited at time t = %f', ... ' before endpoint at tend = %f was reached. This may', ... ' happen if the stepsize grows smaller than defined in', ... ' vminstepsize. Try to reduce the value of "InitialStep" and/or', ... @@ 337,15 +356,20 @@ vmsg = sprintf (['Solver has been stopped by a call of "break" in', ... ' the main iteration loop at time t = %f before endpoint at', ... ' tend = %f was reached. This may happen because the @odeplot', ...  ' or the @event function returned zero.'], vtimestamp, vtimestop); + ' function returned zero or the @event function returned one.'], ... + vtimestamp, vtimestop); warning (vmsg); end end %# Postprocessing, do whatever when terminating integration algorithm  if (vhaveoutputfunction == true), %# Cleanup plotter + if (vhaveoutputfunction == true) %# Cleanup plotter feval (vodeoptions.OutputFcn, vtimestamp, ...  vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); + vretvalresult(vcntloop1,:)', 'done', vfunarguments{:}); + end + if (vhaveeventfunction == true) %# Cleanup event function handling + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); end %# Print additional information if option Stats is set @@ 368,9 +392,13 @@ elseif (nargout == 5) varargout{1} = vretvaltime; %# Same as (nargout == 2) varargout{2} = vretvalresult; %# Same as (nargout == 2)  varargout{3} = []; %# Not yet implemented  varargout{4} = []; %# Not yet implemented  varargout{5} = []; %# Not yet implemented + if (vhaveeventfunction == true) + varargout{3} = vevent{3}; %# Time info when an event occured + varargout{4} = vevent{4}; %# Results when an event occured + varargout{5} = vevent{2}; %# Index info which event occured + else + varargout{3} = varargout{4} = varargout{5} = []; + end %# else nothing will be returned, varargout{1} undefined end Index: odephas2.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/odephas2.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  odephas2.m 22 Sep 2006 17:02:14 0000 1.2 +++ odephas2.m 7 Oct 2006 18:02:00 0000 1.3 @@ 30,35 +30,37 @@ %# Maintainer: Thomas Treichl %# Created: 20060906 %# ChangeLog: +%# ChangeLog: 20060929, Thomas Treichl +%# As in the definitions of initial value problems as functions and +%# if somebody uses event functions all input and output vectors +%# must be column vectors by now. function [varargout] = odephas2 (vt, vy, vflag)  %# vt and vy are always row vectors for all OutputFcns in odepkg  persistent vfigure;  persistent vyold;  persistent vcounter; + + %# No input argument check is done for a higher processing speed + persistent vfigure; persistent vyold; persistent vcounter; if (strcmp (vflag, 'init') == true)  %# nothing to return, vt is either the time slot [tstart tstop] or  %# [t0, t1, ..., tn], vy is the inital value vector vinit  vfigure = figure; vyold = vy(1,:); vcounter = 1; + %# Nothing to return, vt is either the time slot [tstart tstop] + %# or [t0, t1, ..., tn], vy is the inital value vector 'vinit' + vfigure = figure; vyold = vy(:,1); vcounter = 1; elseif (isempty (vflag) == true)  %# Return something in varargout{1} + %# Return something in varargout{1}, either true for 'not stopping + %# the integration' or false for 'stopping the integration' vcounter = vcounter + 1; figure (vfigure);  vyold(vcounter,:) = vy(1,:);  plot (vyold(:,1), vyold(:,2), 'o'); + vyold(:,vcounter) = vy(:,1); + plot (vyold(1,:), vyold(2,:), 'o'); varargout{1} = true; %# Do not stop the integration algorithm if varargout{1} = true; %# stop the integration algorithm if varargout{1} = false; elseif (strcmp (vflag, 'done') == true)  %# Cleanup will be done but nothing to do in this function + %# Cleanup has to be done, clear the persistent variables because + %# we don't need them anymore + clear ('vfigure', 'vyold', 'vcounter')  else  %# Not necessary  cf. source code of function odeprint  %# vmsg = sprintf ('Check number and types of input arguments'); end %!demo Index: odepkg.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/odepkg.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  odepkg.m 22 Sep 2006 17:02:14 0000 1.2 +++ odepkg.m 7 Oct 2006 18:02:00 0000 1.3 @@ 20,18 +20,19 @@ %# A more detailed help for the odepkg implementation will be added here soon. %# @end deftypefn %# Some tests from mine %# @unnumberedsubsec ode2f %# @command{ode2f} integrates a system of ordinary differential equations using a 2nd order RungeKutta formulae called Ralston's method. This choice of 2nd order coefficients provides a minimum bound on truncation error. For more information see Ralston & Rabinowitz (1978) or Numerical Methods for Engineers, 2nd Ed., Chappra & Cannle, McGrawHill, 1985. 2ndorder accurate RK methods have a local error estimate of O(h^3). @command{ode2f} requires two function evaluations per integration step.  %# Maintainer: Thomas Treichl %# Created: 20060912 %# ChangeLog: %# File will be cleaned up in the future function [] = odepkg (varargin) %# File will be cleaned up in the future  if (ischar (varargin{1}) == true) + + %# Check number and types of all input arguments + if (nargin == 0  nargin >= 2) + help ('odepkg'); + error ('Number of input arguments must be exactly one'); + + elseif (ischar (varargin{1}) == true) %# Hidden developer functions are called if any valid string is %# given as an input argument. @@ 46,19 +47,19 @@ odepkg_outputselection_check; end  else %# if (ischar (varargin{1}) ~= true)  help ('odepkg');  return;  end + else + error ('The one and only input argument must be a valid string'); + + end %# Check number and types of all input arguments %# The call of this function may take a while and will open a lot of %# figures that have to be checked. function [] = odepkg_package_check ()  test ('ode23', 'verbose'); clear ('all');  test ('ode45', 'verbose'); clear ('all');  test ('ode54', 'verbose'); clear ('all'); test ('ode78', 'verbose'); clear ('all'); + test ('ode54', 'verbose'); clear ('all'); + test ('ode45', 'verbose'); clear ('all'); + test ('ode23', 'verbose'); clear ('all'); test ('odeget.m', 'verbose'); clear ('all'); test ('odeset.m', 'verbose'); clear ('all'); @@ 138,14 +139,15 @@ A = odeset ('InitialStep', 1e3, 'MaxStep', 1e1, 'OutputSel', [1 2 3]); [x, y] = ode78 (@odepkg_equations_lorenz, [0 25], [3 15 1], A); subplot(2, 2, 4); plot (x, y); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 26), [0 0]); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 25), [0 0]); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 22), [0 0]); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 26), [0 0]); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 30), [0 0]); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 13), [0 0]); %[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, logspace (1, 0, 13), [0 0]); %[vx, vy, va, vb, vc] = ode23 (@odepkg_equations_secondorderlag, logspace (1, 0, 31), [0 0]); + +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 26), [0 0]); +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 25), [0 0]); +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 22), [0 0]); +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 26), [0 0]); +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 30), [0 0]); +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, linspace (0, 2.5, 13), [0 0]); +%#[vx, vy, va, vb, vc] = ode78 (@odepkg_equations_secondorderlag, logspace (1, 0, 13), [0 0]); +%#[vx, vy, va, vb, vc] = ode23 (@odepkg_equations_secondorderlag, logspace (1, 0, 31), [0 0]); %# File will be cleaned up in the future function [] = odepkg_versus_lsode () @@ 208,6 +210,33 @@ xdot = ((1  x) * t  t^2) / epsilon; endfunction +%!function y = f(x) +%! y = 3 * x; +%!test +%! d = f(3) * 3 + +%% test/octave.test/error/error2.m +%!function g () +%! error ("foo\n"); +%!function f () +%! g +%!error <foo> f (); + +%!shared A +%!demo A +%! function y=f(x) +%! y=x; +%! endfunction +%! f(3) +%!demo A + +%# Diese demo kann dann mit dem Befehl +%# [A, B] = example ('odepkg', 1); +%# extrahiert werden und mit dem Aufruf +%# eval (A); +%# ausgeführt werden +%# Baue eventuell eine neue demo.m function + %# Local Variables: *** %# mode: octave *** %# End: *** \ No newline at end of file Index: odephas3.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/odephas3.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  odephas3.m 22 Sep 2006 17:02:14 0000 1.2 +++ odephas3.m 7 Oct 2006 18:02:00 0000 1.3 @@ 30,41 +30,40 @@ %# Maintainer: Thomas Treichl %# Created: 20060912 %# ChangeLog: +%# ChangeLog: 20060929, Thomas Treichl +%# As in the definitions of initial value problems as functions +%# and if somebody uses event functions all input and output +%# vectors must be column vectors by now. function [varargout] = odephas3 (vt, vy, vflag)  %# vt and vy are always row vectors, vflag can be either 'init' or []  %# or 'done'. If 'init' then varargout{1} = [], if [] the + + %# vt and vy are always column vectors, vflag can be either 'init' + %# or [] or 'done'. If 'init' then varargout{1} = [], if [] the %# varargout{1} either true or false, if 'done' then varargout{1} = [].  persistent vfigure;  persistent vyold;  persistent vcounter; + persistent vfigure; persistent vyold; persistent vcounter; if (strcmp (vflag, 'init') == true) %# vt is either the time slot [tstart tstop] or [t0, t1, ..., tn] %# vy is the inital value vector vinit from the caller function vfigure = figure;  vyold = vy(1,:); + vyold = vy(:,1); vcounter = 1; elseif (isempty (vflag) == true)  %# Return something in varargout{1} = true or false + %# Return something in varargout{1}, either true for 'not stopping + %# the integration' or false for 'stopping the integration' vcounter = vcounter + 1; figure (vfigure);  vyold(vcounter,:) = vy(1,:);  plot3 (vyold(:,1), vyold(:,2), vyold (:,3), 'o'); + vyold(:,vcounter) = vy(:,1); + plot3 (vyold(1,:), vyold(2,:), vyold (3,:), 'o'); varargout{1} = true;  %# Do not stop the integration algorithm if varargout{1} = true;  %# if varargout{1} = false; stop the integration algorithm elseif (strcmp (vflag, 'done') == true)  %# Cleanup will be done, but nothing to do in this function   else  vmsg = sprintf ('Check number and types of input arguments');  error (vmsg); + %# Cleanup has to be done, clear the persistent variables because + %# we don't need them anymore + clear ('vfigure', 'vyold', 'vcounter')  end %# if (strcmp (vflag, 'init') == true) + end %!demo %! Index: odeprint.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/odeprint.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  odeprint.m 22 Sep 2006 17:02:14 0000 1.2 +++ odeprint.m 7 Oct 2006 18:02:00 0000 1.3 @@ 33,10 +33,11 @@ %# ChangeLog: function [varargout] = odeprint (vt, vy, vflag, varargin) + %# No input argument check is done for a higher processing speed  %# vt and vy are always row vectors, see also function odeplot,  %# odephas2 and odephas3 for another implementation. vflag is either  %# "init", [] or "done". + %# vt and vy are always column vectors, see also function odeplot, + %# odephas2 and odephas3 for another implementation. vflag either + %# is "init", [] or "done". if (strcmp (vflag, 'init') == true) fprintf (1, '%f%s\n', vt (1,1), sprintf (' %f', vy) ); @@ 48,7 +49,7 @@ %# if varargout{1} = false; stop the integration algorithm elseif (strcmp (vflag, 'done') == true)  %# Cleanup will be done, but nothing to do in this function + %# Cleanup could be done, but nothing to do in this function end Index: ode78.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/ode78.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  ode78.m 22 Sep 2006 17:02:14 0000 1.2 +++ ode78.m 7 Oct 2006 18:02:00 0000 1.3 @@ 144,11 +144,11 @@ if (isempty (vodeoptions.MaxStep) == true) vodeoptions.MaxStep = abs (vslot(1,1)  vslot(1,length (vslot))) / 10; end %# I'm implementing this feature at the moment + %# Implementation of the option Events has been finished. This option + %# can be set by the user to another value than default value. if (isequal (vodeoptions.Events, vodetemp.Events) == false) %# vhaveeventfunction = true; warning ('Not yet implemented option "Events" will be ignored'); %# else, vhaveeventfunction = false;  warning ('Not yet implemented option "Events" will be ignored'); end + vhaveeventfunction = true; %# default value is [] + else, vhaveeventfunction = false; end %# Option Jacobian will be ignored by this solver because when using an %# explicite solver mechanism then no Jacobian Matrix is calculated @@ 215,9 +215,16 @@ vretvalresult = vinit(vodeoptions.OutputSel); else, vretvalresult = vinit; end  if (vhaveoutputfunction == true), %# Initialize OutputFcn  feval (vodeoptions.OutputFcn, vslot, ...  vretvalresult, 'init', vfunarguments{:}); + %# Initialize OutputFcn + if (vhaveoutputfunction == true) + feval (vodeoptions.OutputFcn, vslot', ... + vretvalresult', 'init', vfunarguments{:}); + end + + %# Initialize EventFcn + if (vhaveeventfunction == true) + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult', 'init', vfunarguments{:}); end vpow = 1/8; %# MC2001: see p.91 in Ascher & Petzold @@ 255,7 +262,7 @@ %# The solver main loop  stop if endpoint has been reached vcntloop = 2; vcntcycles = 1; vu = vinit; vk = vu' * zeros(1,13);  vunhandledtermination = true; + vcntiter = 0; vunhandledtermination = true; while ((vtimestamp < vtimestop && vstepsize >= vminstepsize) == true) %# Hit the endpoint of the time slot exactely @@ 282,15 +289,6 @@ vfunarguments{:}); end  %# This was the old code fragment without mass implementation  %# vk(:,1) = feval (vfun, vtimestamp, vu', vfunarguments{:});  %# for j = 1:12  %# vk(:,j+1) = feval ...  %# (vfun, vtimestamp + vc(j+1,1) * vstepsize, ...  %# vu' + vstepsize * vk(:,1:j) * va(j+1,1:j)', ...  %# vfunarguments{:});  %# end  %# Compute the 7th and the 8th order estimation y7 = vu' + vstepsize * (vk * vb7); y8 = vu' + vstepsize * (vk * vb8); @@ 316,8 +314,32 @@ if (vhaveoutputselection == true) vretvalresult(vcntloop,:) = vu(vodeoptions.OutputSel); else, vretvalresult(vcntloop,:) = vu; end  vcntloop = vcntloop + 1;  end + vcntloop = vcntloop + 1; vcntiter = 0; + + %# Call plot only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if plot function + %# returns false + if (vhaveoutputfunction == true) + vpltret = feval (vodeoptions.OutputFcn, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vpltret == false), vunhandledtermination = false; break; end + end + + %# Call event only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if veventbreak is + %# true + if (vhaveeventfunction == true) + vevent = ... + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vevent{1} == true) + vretvaltime(vcntloop1,:) = vevent{3}(end,:); + vretvalresult(vcntloop1,:) = vevent{4}(end,:); + vunhandledtermination = false; break; + end + end + + end %# If the error is acceptable ... %# Update the step size for the next integration step if (vstepsizegiven == false) @@ 329,30 +351,29 @@ end end  %# Update counter that counts the number of cycles  vcntcycles = vcntcycles + 1; %# needed for postprocessing + %# Update counters that count the number of iteration cycles + vcntcycles = vcntcycles + 1; %# Needed for postprocessing + vcntiter = vcntiter + 1; %# Needed to find iteration problems  %# Stop integration if return value of plotting function is false  if (vhaveoutputfunction == true)  vpltret = feval (vodeoptions.OutputFcn, vtimestamp, vretvalresult(vcntloop1,:), [], vfunarguments{:});  if (vpltret == false), vunhandledtermination = false; break; end + %# Stop solving because the last 1000 steps no successful valid + %# value has been found + if (vcntiter >= 1000) + vmsg = sprintf (['Solving has not been successful. The iterative', ... + ' integration loop exited at time t = %f before endpoint at', ... + ' tend = %f was reached. This happened because the iterative', ... + ' integration loop does not find a valid soultion at this time', ... + ' stamp. Try to reduce the value of "InitialStep" and/or', ... + ' "MaxStep" with the command "odeset".\n'], vtimestamp, vtimestop); + error (vmsg); end  %# Handle the event function if an event function was set with odeset %# if (vhaveeventfunction == true)  %# [vreteve, vretter, vretdir] = feval (vodeoptions.Events, vtimestamp, vretvalresult(vcntloop1,:)');  %# Reminder: Event handling should be in an extra function with  %# 'init', [], 'done' like the odeplot functions (using also  %# persistent variables to store needed variables etc. %# end  end %# The main loop %# Check if integration of the ode has been successful if (vtimestamp < vtimestop)  if (vunhandledtermination == false) + if (vunhandledtermination == true) vmsg = sprintf (['Solving has not been successful. The iterative', ...  ' integration loop has been exited at time t = %f', ... + ' integration loop exited at time t = %f', ... ' before endpoint at tend = %f was reached. This may', ... ' happen if the stepsize grows smaller than defined in', ... ' vminstepsize. Try to reduce the value of "InitialStep" and/or', ... @@ 362,15 +383,20 @@ vmsg = sprintf (['Solver has been stopped by a call of "break" in', ... ' the main iteration loop at time t = %f before endpoint at', ... ' tend = %f was reached. This may happen because the @odeplot', ...  ' or the @event function returned zero.'], vtimestamp, vtimestop); + ' function returned zero or the @event function returned one.'], ... + vtimestamp, vtimestop); warning (vmsg); end end %# Postprocessing, do whatever when terminating integration algorithm  if (vhaveoutputfunction == true), %# Cleanup plotter + if (vhaveoutputfunction == true) %# Cleanup plotter feval (vodeoptions.OutputFcn, vtimestamp, ...  vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); + vretvalresult(vcntloop1,:)', 'done', vfunarguments{:}); + end + if (vhaveeventfunction == true) %# Cleanup event function handling + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); end %# Print additional information if option Stats is set @@ 393,9 +419,13 @@ elseif (nargout == 5) varargout{1} = vretvaltime; %# Same as (nargout == 2) varargout{2} = vretvalresult; %# Same as (nargout == 2)  varargout{3} = []; %# Not yet implemented  varargout{4} = []; %# Not yet implemented  varargout{5} = []; %# Not yet implemented + if (vhaveeventfunction == true) + varargout{3} = vevent{3}; %# Time info when an event occured + varargout{4} = vevent{4}; %# Results when an event occured + varargout{5} = vevent{2}; %# Index info which event occured + else + varargout{3} = varargout{4} = varargout{5} = []; + end %# else nothing will be returned, varargout{1} undefined end Index: ode45.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/ode45.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  ode45.m 22 Sep 2006 17:02:14 0000 1.2 +++ ode45.m 7 Oct 2006 18:02:00 0000 1.3 @@ 143,11 +143,9 @@ if (isempty (vodeoptions.MaxStep) == true) vodeoptions.MaxStep = abs (vslot(1,1)  vslot(1,length (vslot))) / 10; end %# I'm implementing this feature at the moment if (isequal (vodeoptions.Events, vodetemp.Events) == false) %# vhaveeventfunction = true; warning ('Not yet implemented option "Events" will be ignored'); %# else, vhaveeventfunction = false;  warning ('Not yet implemented option "Events" will be ignored'); end + vhaveeventfunction = true; %# default value is [] + else, vhaveeventfunction = false; end %# Option Jacobian will be ignored by this solver because when using an %# explicite solver mechanism then no Jacobian Matrix is calculated @@ 214,9 +212,16 @@ vretvalresult = vinit(vodeoptions.OutputSel); else, vretvalresult = vinit; end  if (vhaveoutputfunction == true), %# Initialize OutputFcn  feval (vodeoptions.OutputFcn, vslot, ...  vretvalresult, 'init', vfunarguments{:}); + %# Initialize OutputFcn + if (vhaveoutputfunction == true) + feval (vodeoptions.OutputFcn, vslot', ... + vretvalresult', 'init', vfunarguments{:}); + end + + %# Initialize EventFcn + if (vhaveeventfunction == true) + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult', 'init', vfunarguments{:}); end vpow = 1/6; %# See p.91 in Ascher & Petzold @@ 233,7 +238,7 @@ %# The solver main loop  stop if endpoint has been reached vcntloop = 2; vcntcycles = 1; vu = vinit; vk = vu' * zeros(1,6);  vunhandledtermination = true; + vcntiter = 0; vunhandledtermination = true; while ((vtimestamp < vtimestop && vstepsize >= vminstepsize) == true) %# Hit the endpoint of the time slot exactely @@ 270,8 +275,8 @@ vdelta = y5  y4; vtau = max (vodeoptions.RelTol * vu', vodeoptions.AbsTol); else  vdelta = norm (y5  y4, Inf);  vtau = max (vodeoptions.RelTol * max (norm (vu', Inf), 1.0), vodeoptions.AbsTol); + vdelta = norm (y5  y4, Inf); + vtau = max (vodeoptions.RelTol * max (norm (vu', Inf), 1.0), vodeoptions.AbsTol); end else %# if (vstepsizegiven == true) vdelta = 1; vtau = 2; @@ 285,8 +290,32 @@ if (vhaveoutputselection == true) vretvalresult(vcntloop,:) = vu(vodeoptions.OutputSel); else, vretvalresult(vcntloop,:) = vu; end  vcntloop = vcntloop + 1;  end + vcntloop = vcntloop + 1; vcntiter = 0; + + %# Call plot only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if plot function + %# returns false + if (vhaveoutputfunction == true) + vpltret = feval (vodeoptions.OutputFcn, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vpltret == false), vunhandledtermination = false; break; end + end + + %# Call event only if a valid result has been found, therefore this + %# code fragment has moved here. Stop integration if veventbreak is + %# true + if (vhaveeventfunction == true) + vevent = ... + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:)', [], vfunarguments{:}); + if (vevent{1} == true) + vretvaltime(vcntloop1,:) = vevent{3}(end,:); + vretvalresult(vcntloop1,:) = vevent{4}(end,:); + vunhandledtermination = false; break; + end + end + + end %# If the error is acceptable ... %# Update the step size for the next integration step if (vstepsizegiven == false) @@ 298,13 +327,20 @@ end end  %# Update counter that counts the number of cycles  vcntcycles = vcntcycles + 1; %# needed for postprocessing + %# Update counters that count the number of iteration cycles + vcntcycles = vcntcycles + 1; %# Needed for postprocessing + vcntiter = vcntiter + 1; %# Needed to find iteration problems  %# Stop integration if return value of plotting function is false  if (vhaveoutputfunction == true)  vpltret = feval (vodeoptions.OutputFcn, vtimestamp, vretvalresult(vcntloop1,:), [], vfunarguments{:});  if (vpltret == false), vunhandledtermination = false; break; end + %# Stop solving because the last 1000 steps no successful valid + %# value has been found + if (vcntiter >= 1000) + vmsg = sprintf (['Solving has not been successful. The iterative', ... + ' integration loop exited at time t = %f before endpoint at', ... + ' tend = %f was reached. This happened because the iterative', ... + ' integration loop does not find a valid soultion at this time', ... + ' stamp. Try to reduce the value of "InitialStep" and/or', ... + ' "MaxStep" with the command "odeset".\n'], vtimestamp, vtimestop); + error (vmsg); end %# Handle the event function if an event function was set with odeset @@ 319,9 +355,9 @@ %# Check if integration of the ode has been successful if (vtimestamp < vtimestop)  if (vunhandledtermination == false) + if (vunhandledtermination == true) vmsg = sprintf (['Solving has not been successful. The iterative', ...  ' integration loop has been exited at time t = %f', ... + ' integration loop exited at time t = %f', ... ' before endpoint at tend = %f was reached. This may', ... ' happen if the stepsize grows smaller than defined in', ... ' vminstepsize. Try to reduce the value of "InitialStep" and/or', ... @@ 331,15 +367,20 @@ vmsg = sprintf (['Solver has been stopped by a call of "break" in', ... ' the main iteration loop at time t = %f before endpoint at', ... ' tend = %f was reached. This may happen because the @odeplot', ...  ' or the @event function returned zero.'], vtimestamp, vtimestop); + ' function returned zero or the @event function returned one.'], ... + vtimestamp, vtimestop); warning (vmsg); end end %# Postprocessing, do whatever when terminating integration algorithm  if (vhaveoutputfunction == true), %# Cleanup plotter + if (vhaveoutputfunction == true) %# Cleanup plotter feval (vodeoptions.OutputFcn, vtimestamp, ...  vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); + vretvalresult(vcntloop1,:)', 'done', vfunarguments{:}); + end + if (vhaveeventfunction == true) %# Cleanup event function handling + odepkg_event_handle (vodeoptions.Events, vtimestamp, ... + vretvalresult(vcntloop1,:), 'done', vfunarguments{:}); end %# Print additional information if option Stats is set @@ 362,9 +403,13 @@ elseif (nargout == 5) varargout{1} = vretvaltime; %# Same as (nargout == 2) varargout{2} = vretvalresult; %# Same as (nargout == 2)  varargout{3} = []; %# Not yet implemented  varargout{4} = []; %# Not yet implemented  varargout{5} = []; %# Not yet implemented + if (vhaveeventfunction == true) + varargout{3} = vevent{3}; %# Time info when an event occured + varargout{4} = vevent{4}; %# Results when an event occured + varargout{5} = vevent{2}; %# Index info which event occured + else + varargout{3} = varargout{4} = varargout{5} = []; + end %# else nothing will be returned, varargout{1} undefined end Index: odeplot.m =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/inst/odeplot.m,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  odeplot.m 22 Sep 2006 17:02:14 0000 1.2 +++ odeplot.m 7 Oct 2006 18:02:00 0000 1.3 @@ 30,41 +30,40 @@ %# Maintainer: Thomas Treichl %# Created: 20060809 %# ChangeLog: +%# ChangeLog: 20060929, Thomas Treichl +%# As in the definitions of initial value problems as functions +%# and if somebody uses event functions all input and output +%# vectors must be column vectors by now. function [varargout] = odeplot (vt, vy, vflag) + %# No input argument check is done for a higher processing speed  %# vt and vy are row vectors  persistent vfigure;  persistent vtold;  persistent vyold;  persistent vcounter; + persistent vfigure; persistent vtold; + persistent vyold; persistent vcounter; if (strcmp (vflag, 'init') == true)  %# Nothing to return, vt is either the time slot [tstart tstop] or  %# [t0, t1, ..., tn], vy is the inital value vector vinit + %# Nothing to return, vt is either the time slot [tstart tstop] + %# or [t0, t1, ..., tn], vy is the inital value vector 'vinit' vfigure = figure;  % axis ([vt(1,1), vt(1,length(vt))]); +%# axis ([vt(1,1), vt(1,length(vt))]); vtold = vt(1,1);  vyold = vy(1,:); + vyold = vy(:,1); vcounter = 1; elseif (isempty (vflag) == true)  %# Return something in varargout{1} + %# Return something in varargout{1}, either true for 'not stopping + %# the integration' or false for 'stopping the integration' vcounter = vcounter + 1; figure (vfigure); vtold(vcounter,1) = vt(1,1);  vyold(vcounter,:) = vy(1,:); + vyold(:,vcounter) = vy(:,1); plot (vtold, vyold, 'o'); varargout{1} = true;  %# Do not stop the integration algorithm, if varargout{1} = false;  %# stop the integration algorithm elseif (strcmp (vflag, 'done') == true)  %# Cleanup will be done, but nothing to be done in this function   else  %# Maybe somewhen in the future + %# Cleanup has to be done, clear the persistent variables because + %# we don't need them anymore + clear ('vfigure', 'vtold', 'vyold', 'vcounter') end 
From: Thomas Treichl <treichl@us...>  20061007 18:02:04

Update of /cvsroot/octave/octaveforge/main/odepkg/doc In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv21558/doc Modified Files: ChangeLog Log Message: Updated. Index: ChangeLog =================================================================== RCS file: /cvsroot/octave/octaveforge/main/odepkg/doc/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff u d r1.1 r1.2  ChangeLog 13 Sep 2006 11:22:31 0000 1.1 +++ ChangeLog 7 Oct 2006 18:02:00 0000 1.2 @@ 1,8 +1,27 @@  * File: ChangeLog  * Created: 2006.08.16  * Author: Thomas Treichl  * Description: OdePkg ChangeLog File +File: ChangeLog +Created: 2006.08.16 +Author: Thomas Treichl <treichl@...> +Description: OdePkg ChangeLog File +2006.10.06 Thomas Treichl <treichl@...> + * ChangeLog: changed appearence for next entries + * ode23.m, ode45.m, ode54.m, ode78.m: Further improved + functionality. Added event handling and other functions + to handle other options. + * INDEX: file has been created for pkg management. + * TODO: check the whole package and release first stable + version 0.1.0. + +2006.09.28 + * All input output vectors of the initial value problems + the OutputFcns and the EventFcns are column vectors + +2006.09.27 + * TODO: Input vectors of event functions and plot functions + must be column vectors + * TODO: Add/change examples of initial value problems resp. + the number of sets of ordinary differential equations + 2006.09.13 * Removed temporary files * Added a DESCRIPTION and COPYING file 
From: David Bateman <adb014@us...>  20061007 17:59:50

Update of /cvsroot/octave/octaveforge/main/gsl/src In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv20735 Modified Files: legendre_sphPlm_array.cc Log Message: trivial doc fix Index: legendre_sphPlm_array.cc =================================================================== RCS file: /cvsroot/octave/octaveforge/main/gsl/src/legendre_sphPlm_array.cc,v retrieving revision 1.2 retrieving revision 1.3 diff u d r1.2 r1.3  legendre_sphPlm_array.cc 6 Oct 2006 22:52:42 0000 1.2 +++ legendre_sphPlm_array.cc 7 Oct 2006 17:59:45 0000 1.3 @@ 39,7 +39,7 @@ @end tex\n\ @end iftex\n\ @ifinfo sqrt((2l+1)/(4\\pi)) * sqrt((lm)!/(l+m)!) Plm (x)\n\ +sqrt((2l+1)/(4*pi)) * sqrt((lm)!/(l+m)!) Plm (x)\n\ for m >= 0, l = m, ..., lmax, x <= 1.0\n\ @end ifinfo\n\ \n\ 
From: David Bateman <adb014@us...>  20061007 17:59:10

Update of /cvsroot/octave/octaveforge/admin In directory sc8prcvs3.sourceforge.net:/tmp/cvsserv20614 Modified Files: make_index Log Message: Fix the octaveforge CVS address so the checkout link actually works Index: make_index =================================================================== RCS file: /cvsroot/octave/octaveforge/admin/make_index,v retrieving revision 1.47 retrieving revision 1.48 diff u d r1.47 r1.48  make_index 6 Oct 2006 13:29:15 0000 1.47 +++ make_index 7 Oct 2006 17:59:05 0000 1.48 @@ 30,7 +30,7 @@ # Links to octave/octaveforge web CVS my $OCTAVECVS = "http://www.octave.org/cgibin/viewcvs.cgi/~checkout~/octave";; my $FORGECVS = "http://octave.cvs.sourceforge.net/cgibin/octave/octaveforge/";; +my $FORGECVS = "http://octave.cvs.sourceforge.net/octave/octaveforge/";; #my $script = basename($0); 