## octave-cvsupdate

 [Octave-cvsupdate] SF.net SVN: octave:[5179] trunk/octave-forge/extra/nlwing2 From: - 2008-07-18 06:44:49 ```Revision: 5179 http://octave.svn.sourceforge.net/octave/?rev=5179&view=rev Author: highegg Date: 2008-07-18 06:44:57 +0000 (Fri, 18 Jul 2008) Log Message: ----------- update GPL2 files to GPL3 Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/README trunk/octave-forge/extra/nlwing2/src/Makefile trunk/octave-forge/extra/nlwing2/src/vitens.f trunk/octave-forge/extra/nlwing2/src/vitensor.cc Modified: trunk/octave-forge/extra/nlwing2/README =================================================================== --- trunk/octave-forge/extra/nlwing2/README 2008-07-17 11:59:38 UTC (rev 5178) +++ trunk/octave-forge/extra/nlwing2/README 2008-07-18 06:44:57 UTC (rev 5179) @@ -23,7 +23,7 @@ x-y is the wing symmetry plane, while the wing lies along z axis. The origin is the center of the wing. -Physics +Maths & Physics -------------------------------------------------------------------------------- The method is based on approximation the flowfield around the wing by the potential flow induced by an ensemble of horseshoe vortices, with bound @@ -74,5 +74,10 @@ equations. This parametric system is solved by starting at a low angle of attack and tracking the nonlinear solution to higher angles while possible, using a predictor-corrector strategy. +The 2D section lifts are interpolated in two dimensions: by spanwise coordinate +(combining different datasets) and by angle of attack. Instead of a naive +interpolation, a "feature" interpolation is done: at first, each lifting line is +analyzed for a zero-lift and maximum-lift angle. The lifting line is then scaled +to 0,1, and these three features (zero-lift angle, max-lift angle, and scaled +lifting line) are interpolated spanwise by linear interpolation. - Modified: trunk/octave-forge/extra/nlwing2/src/Makefile =================================================================== --- trunk/octave-forge/extra/nlwing2/src/Makefile 2008-07-17 11:59:38 UTC (rev 5178) +++ trunk/octave-forge/extra/nlwing2/src/Makefile 2008-07-18 06:44:57 UTC (rev 5179) @@ -6,7 +6,7 @@ # # NLWing2 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 +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, Modified: trunk/octave-forge/extra/nlwing2/src/vitens.f =================================================================== --- trunk/octave-forge/extra/nlwing2/src/vitens.f 2008-07-17 11:59:38 UTC (rev 5178) +++ trunk/octave-forge/extra/nlwing2/src/vitens.f 2008-07-18 06:44:57 UTC (rev 5179) @@ -6,7 +6,7 @@ c c NLWing2 is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by -c the Free Software Foundation; either version 2 of the License, or +c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, Modified: trunk/octave-forge/extra/nlwing2/src/vitensor.cc =================================================================== --- trunk/octave-forge/extra/nlwing2/src/vitensor.cc 2008-07-17 11:59:38 UTC (rev 5178) +++ trunk/octave-forge/extra/nlwing2/src/vitensor.cc 2008-07-18 06:44:57 UTC (rev 5179) @@ -6,7 +6,7 @@ * * NLWing2 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 + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5299] trunk/octave-forge/extra/nlwing2 From: - 2008-09-12 09:58:55 ```Revision: 5299 http://octave.svn.sourceforge.net/octave/?rev=5299&view=rev Author: highegg Date: 2008-09-12 09:59:06 +0000 (Fri, 12 Sep 2008) Log Message: ----------- start 1.0.2 Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/DESCRIPTION trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/loadwing.m trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-09-08 09:41:54 UTC (rev 5298) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-09-12 09:59:06 UTC (rev 5299) @@ -1,3 +1,9 @@ +2008-09-12 Jaroslav Hajek + + * inst/loadwing.m: fix camber -> chord + * inst/makewing.m: calculate mcenter and mchord if not supplied + * inst/calcwing.m: calculate integral moment + 2008-06-24 Jaroslav Hajek * inst/qcalc.m: Remove cdi. @@ -2,2 +8,2 @@ * inst/makewing.m: Automatic span and sym properties. - * inst/calcwing: Revamp cdi calculation. + * inst/calcwing.m: Revamp cdi calculation. Modified: trunk/octave-forge/extra/nlwing2/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/nlwing2/DESCRIPTION 2008-09-08 09:41:54 UTC (rev 5298) +++ trunk/octave-forge/extra/nlwing2/DESCRIPTION 2008-09-12 09:59:06 UTC (rev 5299) @@ -1,5 +1,5 @@ Name: NLWing2 -Version: 1.0.1 +Version: 1.0.2 Date: 2008-06-18 Author: Jaroslav Hajek Title: Nonlinear Lifting Line for Wings Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-09-08 09:41:54 UTC (rev 5298) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-09-12 09:59:06 UTC (rev 5299) @@ -142,15 +142,18 @@ area /= 2; endif cad = cos (clq.ad); sad = sin (clq.ad); - clq.clw = (dS.*wing.lcd).' * (clq.cl .* cad) / area; - clq.cdiw = -(dS.*wing.lcd).' * (clq.cl .* sad) / area; - clq.cdw = (dS.*wing.lcd).' * (clq.cd .* cad)/ area; + clq.clw = (dS .* wing.lcd).' * (clq.cl .* cad) / area; + clq.cdiw = -(dS .* wing.lcd).' * (clq.cl .* sad) / area; + clq.cdw = (dS .* wing.lcd).' * (clq.cd .* cad)/ area; if (wing.sym) - clq.bmw = (dS .* wing.zc).' * (clq.cl .* cad); + clq.bmw = (dS .* wing.zc).' * (clq.cl .* cad) / area; endif + # integral moment - local moment contributions + clq.cmw = (dS .* wing.ch).' * clq.cm / area; + # local lift contributions + adm = repmat (wing.amac, 1, ns) + clq.al; + clq.cmw += (dS .* wing.rmac).' * (clq.cl .* cos (adm)) / area; - # TODO: moment calculation - endfunction function printf_flush (varargin) Modified: trunk/octave-forge/extra/nlwing2/inst/loadwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/loadwing.m 2008-09-08 09:41:54 UTC (rev 5298) +++ trunk/octave-forge/extra/nlwing2/inst/loadwing.m 2008-09-12 09:59:06 UTC (rev 5299) @@ -24,7 +24,7 @@ % Loads the basic wing geometry from file @var{filename}. % The geometry should be described in the file as follows: % @verbatim -% mcamber +% mchord % area % mcenter % Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-09-08 09:41:54 UTC (rev 5298) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-09-12 09:59:06 UTC (rev 5299) @@ -91,19 +91,31 @@ for [val,key] = ref wing.(key) = val; endfor + dS = wing.ch .* diff (wing.zac); if (! isfield (wing, 'sym')) wing.sym = true; endif if (! isfield (wing, 'area')) - wing.area = sum (wing.ch .* diff (wing.zac)); + wing.area = sum (dS); if (wing.sym) wing.area *= 2; endif endif + if (! isfield (wing, 'cmac')) + wing.cmac = sum (dS .* wing.ch) / wing.area; + endif if (! isfield (wing, 'span')) wing.span = wing.zac(end) - wing.zac(1); if (wing.sym) wing.span *= 2; endif endif + if (! isfield (wing, 'xmac')) + wing.xmac = dot (dS, wing.xac) / wing.area; + wing.ymac = dot (dS, wing.yac) / wing.area; + endif + dxmac = wing.xac - wing.xmac; + dymac = wing.yac - wing.ymac; + wing.rmac = hypot (dymac, dxmac); + wing.amac = atan2 (dymac, dxmac); endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5330] trunk/octave-forge/extra/nlwing2 From: - 2008-10-02 13:43:12 ```Revision: 5330 http://octave.svn.sourceforge.net/octave/?rev=5330&view=rev Author: highegg Date: 2008-10-02 13:38:50 +0000 (Thu, 02 Oct 2008) Log Message: ----------- moment calculation fixes Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-10-02 08:36:09 UTC (rev 5329) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-10-02 13:38:50 UTC (rev 5330) @@ -1,3 +1,8 @@ +2008-10-02 Jaroslav Hajek + + * inst/makewing.m: Fix xac&yac calculation + * inst/calcwing.m: Fix moment calculation + 2008-09-12 Jaroslav Hajek * inst/loadwing.m: fix camber -> chord Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-10-02 08:36:09 UTC (rev 5329) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-10-02 13:38:50 UTC (rev 5330) @@ -149,10 +149,11 @@ clq.bmw = (dS .* wing.zc).' * (clq.cl .* cad) / area; endif # integral moment - local moment contributions - clq.cmw = (dS .* wing.ch).' * clq.cm / area; + clq.cmw = (dS .* wing.ch).' * clq.cm; # local lift contributions - adm = repmat (wing.amac, 1, ns) + clq.al; - clq.cmw += (dS .* wing.rmac).' * (clq.cl .* cos (adm)) / area; + adm = repmat (wing.amac, 1, ns) + repmat (clq.al, length (dS), 1) + clq.ad; + clq.cmw += (dS .* wing.rmac).' * (clq.cl .* cos (adm)); + clq.cmw /= (area * wing.cmac); endfunction Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-10-02 08:36:09 UTC (rev 5329) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-10-02 13:38:50 UTC (rev 5330) @@ -110,12 +110,14 @@ wing.span *= 2; endif endif + xac = wing.xac; xac = (xac(1:end-1) + xac(2:end))/2; + yac = wing.yac; yac = (yac(1:end-1) + yac(2:end))/2; if (! isfield (wing, 'xmac')) - wing.xmac = dot (dS, wing.xac) / wing.area; - wing.ymac = dot (dS, wing.yac) / wing.area; + wing.xmac = dot (dS, xac) / wing.area; + wing.ymac = dot (dS, yac) / wing.area; endif - dxmac = wing.xac - wing.xmac; - dymac = wing.yac - wing.ymac; + dxmac = xac - wing.xmac; + dymac = yac - wing.ymac; wing.rmac = hypot (dymac, dxmac); wing.amac = atan2 (dymac, dxmac); endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5389] trunk/octave-forge/extra/nlwing2 From: - 2008-10-29 06:30:46 ```Revision: 5389 http://octave.svn.sourceforge.net/octave/?rev=5389&view=rev Author: highegg Date: 2008-10-29 06:30:41 +0000 (Wed, 29 Oct 2008) Log Message: ----------- change wrong keyword Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/loadwing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-10-28 10:20:21 UTC (rev 5388) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-10-29 06:30:41 UTC (rev 5389) @@ -1,3 +1,7 @@ +2008-10-29 Jaroslav Hajek + + * inst/loadwing.m: keyword change: mcamber->mchord + 2008-10-02 Jaroslav Hajek * inst/makewing.m: Fix xac&yac calculation Modified: trunk/octave-forge/extra/nlwing2/inst/loadwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/loadwing.m 2008-10-28 10:20:21 UTC (rev 5388) +++ trunk/octave-forge/extra/nlwing2/inst/loadwing.m 2008-10-29 06:30:41 UTC (rev 5389) @@ -73,7 +73,7 @@ elseif (strmatch ('area', line)) mode = 0; ref.area = sscanf (line(5:end), ' %f', 'C'); - elseif (strmatch ('mcamber', line)) + elseif (strmatch ('mchord', line)) mode = 0; ref.cmac = sscanf (line(8:end), ' %f', 'C'); elseif (strmatch ('mcenter', line)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5390] trunk/octave-forge/extra/nlwing2 From: - 2008-10-29 10:05:25 ```Revision: 5390 http://octave.svn.sourceforge.net/octave/?rev=5390&view=rev Author: highegg Date: 2008-10-29 10:05:11 +0000 (Wed, 29 Oct 2008) Log Message: ----------- a number of fixes, prepare for 1.0.3 Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m trunk/octave-forge/extra/nlwing2/inst/loadpolars.m trunk/octave-forge/extra/nlwing2/inst/loadwing.m trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-10-29 06:30:41 UTC (rev 5389) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-10-29 10:05:11 UTC (rev 5390) @@ -1,6 +1,12 @@ 2008-10-29 Jaroslav Hajek * inst/loadwing.m: keyword change: mcamber->mchord + * inst/loadwing.m: Fix invalid expression, initialize pol properly. + * inst/loadpolars.m: Add error message for invalid input. + * inst/makewing.m: Implement simple unsymmetric case panelization, + improve docs. + * inst/liftanalyze.m: Warn if maximum lift occurs at the end of a + polar. 2008-10-02 Jaroslav Hajek Modified: trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2008-10-29 06:30:41 UTC (rev 5389) +++ trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2008-10-29 10:05:11 UTC (rev 5390) @@ -34,6 +34,9 @@ if (any (cl(imin+1:imax) < cl(imin:imax-1))) warning ("liftanalyze: multimodal lift curve"); endif + if (imax == length (cl)) + warning ("liftanalyze: maximum lift at end of lift curve"); + endif a0 = interp1 (cl(imin:imax), al(imin:imax), 0, "extrap"); amax = al(imax); endfunction Modified: trunk/octave-forge/extra/nlwing2/inst/loadpolars.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/loadpolars.m 2008-10-29 06:30:41 UTC (rev 5389) +++ trunk/octave-forge/extra/nlwing2/inst/loadpolars.m 2008-10-29 10:05:11 UTC (rev 5390) @@ -55,6 +55,8 @@ elseif (isstruct (pn)) pol = loadpolars ({pn.names}); [pol.z] = pn.z; + else + error ("loadpolars: invalid input"); endif endfunction Modified: trunk/octave-forge/extra/nlwing2/inst/loadwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/loadwing.m 2008-10-29 06:30:41 UTC (rev 5389) +++ trunk/octave-forge/extra/nlwing2/inst/loadwing.m 2008-10-29 10:05:11 UTC (rev 5390) @@ -53,7 +53,7 @@ unwind_protect ac = []; - pol.z = []; + pol = []; ref.sym = true; mode = 0; @@ -92,7 +92,7 @@ endif ac(end+1,:) = [z,x,y,c,a]; elseif (mode == 2) - i = length (pol.z) + 1; + i = length (pol) + 1; [pol(i).z, pol(i).names] = sscanf (line, '%f %s', 'C'); endif endwhile Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-10-29 06:30:41 UTC (rev 5389) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-10-29 10:05:11 UTC (rev 5390) @@ -20,7 +20,7 @@ % % -*- texinfo -*- -% @deftypefn{Function File} {wing =} makewing (acs, pols, ref, np, tfunc) +% @deftypefn{Function File} {wing =} makewing (acs, pols, ref, panels) % Creates the wing structure necessary for further computations. % @var{acs} is an N-by-5 array specifying the spanwise geometry description. % each row contains @code{[zac xac yac chord twist]} @@ -28,8 +28,10 @@ % distribution. @code{pols(i).z} is the spanwise coordinate, @code{pols(i).cl} % is the lift coefficient on local angle of attack dependence, etc. % @var{ref} contains the reference quantities. -% @var{np} specifies an approximate number of panels. -% @var{tfunc} is a handle to a function mapping +% @var{panels} specifies either an approximate number of panels, +% or directly the z-coordinates of panel vertices. In the latter case, +% @var{panels}(1) and @var{panels}(end) should match @var{acs}(1,1) and +% @var{acs}(end,1), respectively. % @end deftypefn function wing = makewing (ac, pols, ref, np = 80, zac = []) @@ -42,7 +44,9 @@ fi = linspace (0, pi/2, np+1).'; zac = zmx * sin (fi); else - error ("panelize: unsymmetric case not implemented") + zmxl = ozac(1); zmxu = ozac(end); + fi = linspace (0, pi/2, np/2+1)'; + zac = [zmxl * sin(fi(end:-1:2)); zmxu * sin(fi)]; endif endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5396] trunk/octave-forge/extra/nlwing2 From: - 2008-11-03 12:15:08 ```Revision: 5396 http://octave.svn.sourceforge.net/octave/?rev=5396&view=rev Author: highegg Date: 2008-11-03 12:15:05 +0000 (Mon, 03 Nov 2008) Log Message: ----------- version 1.0.3 Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/DESCRIPTION trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m trunk/octave-forge/extra/nlwing2/inst/loadpolars.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-11-01 15:58:47 UTC (rev 5395) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-11-03 12:15:05 UTC (rev 5396) @@ -1,3 +1,9 @@ +2008-11-03 Jaroslav Hajek + + * inst/liftanalyze.m: Include polar name in warning. + * inst/loadpolars.m: Pass polar name to liftanalyze. + * DESCRIPTION: Tagged version 1.0.3. + 2008-10-29 Jaroslav Hajek * inst/loadwing.m: keyword change: mcamber->mchord Modified: trunk/octave-forge/extra/nlwing2/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/nlwing2/DESCRIPTION 2008-11-01 15:58:47 UTC (rev 5395) +++ trunk/octave-forge/extra/nlwing2/DESCRIPTION 2008-11-03 12:15:05 UTC (rev 5396) @@ -1,5 +1,5 @@ Name: NLWing2 -Version: 1.0.2 +Version: 1.0.3 Date: 2008-06-18 Author: Jaroslav Hajek Title: Nonlinear Lifting Line for Wings Modified: trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2008-11-01 15:58:47 UTC (rev 5395) +++ trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2008-11-03 12:15:05 UTC (rev 5396) @@ -25,17 +25,25 @@ % angle. % @end deftypefn -function [a0, amax, clmax] = liftanalyze (al, cl) +function [a0, amax, clmax] = liftanalyze (al, cl, pn = '') + if (pn) + wpref = strcat ("liftanalyze (", pn, "): "); + else + wpref = "liftanalyze: "; + endif if (cl(1) > 0) - warning ("liftanalyze: polar starts at positive lift"); + warning ([wpref, "polar starts at positive lift"]); + warned = true; endif [clmin, imin] = min (cl); [clmax, imax] = max (cl); if (any (cl(imin+1:imax) < cl(imin:imax-1))) - warning ("liftanalyze: multimodal lift curve"); + warning ([wpref, "multimodal lift curve"]); + warned = true; endif if (imax == length (cl)) - warning ("liftanalyze: maximum lift at end of lift curve"); + warning ([wpref, "maximum lift at end of lift curve"]); + warned = true; endif a0 = interp1 (cl(imin:imax), al(imin:imax), 0, "extrap"); amax = al(imax); Modified: trunk/octave-forge/extra/nlwing2/inst/loadpolars.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/loadpolars.m 2008-11-01 15:58:47 UTC (rev 5395) +++ trunk/octave-forge/extra/nlwing2/inst/loadpolars.m 2008-11-03 12:15:05 UTC (rev 5396) @@ -40,7 +40,7 @@ if (ischar (pn)) dat = load ('-ascii', pn); alpha = dat(:,1) * pi/180; - [a0, amax, pol.clmax] = liftanalyze (alpha, dat(:,2)); + [a0, amax, pol.clmax] = liftanalyze (alpha, dat(:,2), pn); pol.a0 = a0; pol.amax = amax; alpha = (alpha - a0) ./ (amax - a0); pol.cl = pchip (alpha, dat(:,2)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5464] trunk/octave-forge/extra/nlwing2 From: - 2008-11-25 10:09:43 ```Revision: 5464 http://octave.svn.sourceforge.net/octave/?rev=5464&view=rev Author: highegg Date: 2008-11-25 10:09:38 +0000 (Tue, 25 Nov 2008) Log Message: ----------- fix clw, extend combinepolars Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/combinepolars.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-11-24 20:28:59 UTC (rev 5463) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-11-25 10:09:38 UTC (rev 5464) @@ -1,3 +1,8 @@ +2008-11-25 Jaroslav Hajek + + * inst/calcwing.m: Fix clw calculation. + * inst/combinepolars: Allow specifying chord lengths directly. + 2008-11-03 Jaroslav Hajek * inst/liftanalyze.m: Include polar name in warning. Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-11-24 20:28:59 UTC (rev 5463) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-11-25 10:09:38 UTC (rev 5464) @@ -142,7 +142,8 @@ area /= 2; endif cad = cos (clq.ad); sad = sin (clq.ad); - clq.clw = (dS .* wing.lcd).' * (clq.cl .* cad) / area; + pc = cos (diff (wing.zac)); + clq.clw = (dS .* wing.lcd).' * (clq.cl .* cad .* pc) / area; clq.cdiw = -(dS .* wing.lcd).' * (clq.cl .* sad) / area; clq.cdw = (dS .* wing.lcd).' * (clq.cd .* cad)/ area; if (wing.sym) Modified: trunk/octave-forge/extra/nlwing2/inst/combinepolars.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/combinepolars.m 2008-11-24 20:28:59 UTC (rev 5463) +++ trunk/octave-forge/extra/nlwing2/inst/combinepolars.m 2008-11-25 10:09:38 UTC (rev 5464) @@ -20,15 +20,27 @@ % % -*- texinfo -*- -% @deftypefn{Function File} {pol =} combinepolars (pol1, pol2) +% @deftypefn{Function File} {pol =} combinepolars (pol1, pol2, coef) +% @deftypefnx{Function File} {pol =} combinepolars (pol1, pol2, c1, c2, c) % Combines two polars to get a specific interpolation. Useful when % you repeatedly change the chord length at a particular section, % and you don't want to recalculate each time using different local % Reynolds number. A good streategy here is evaluate the boundary values % or a few more and then interpolate. +% You can either directly specify an interpolation coefficient (pol1 is 1, pol2 is 0), +% or a pair of chord lengths and a requested chord length. % @end deftypefn -function pol = combinepolars (pol1, pol2, c) +function pol = combinepolars (pol1, pol2, varargin) + if (nargin == 3) + c = varargin{1}; + elseif (nargin == 5) + [c1, c2, c] = deal (varargin{1:3}); + # interpolate according to log(Re). + c = (log (c) - log (c2)) / (log (c1) - log (c2)); + else + print_usage (); + endif d = 1-c; pol.a0 = c*pol1.a0 + d*pol2.a0; pol.amax = c*pol1.amax + d*pol2.amax; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5465] trunk/octave-forge/extra/nlwing2 From: - 2008-11-25 12:22:10 ```Revision: 5465 http://octave.svn.sourceforge.net/octave/?rev=5465&view=rev Author: highegg Date: 2008-11-25 12:22:03 +0000 (Tue, 25 Nov 2008) Log Message: ----------- more integral qts fixes Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-11-25 10:09:38 UTC (rev 5464) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-11-25 12:22:03 UTC (rev 5465) @@ -2,6 +2,7 @@ * inst/calcwing.m: Fix clw calculation. * inst/combinepolars: Allow specifying chord lengths directly. + * inst/makewing.m: Remove wing.lcd. 2008-11-03 Jaroslav Hajek Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-11-25 10:09:38 UTC (rev 5464) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2008-11-25 12:22:03 UTC (rev 5465) @@ -137,17 +137,17 @@ # integral quantities dS = wing.ch .* diff (wing.zac); + dSp = wing.ch .* hypot (diff (wing.zac), diff (wing.yac)); area = wing.area; if (wing.sym) area /= 2; endif cad = cos (clq.ad); sad = sin (clq.ad); - pc = cos (diff (wing.zac)); - clq.clw = (dS .* wing.lcd).' * (clq.cl .* cad .* pc) / area; - clq.cdiw = -(dS .* wing.lcd).' * (clq.cl .* sad) / area; - clq.cdw = (dS .* wing.lcd).' * (clq.cd .* cad)/ area; + clq.clw = dS.' * (clq.cl .* cad) / area; + clq.cdiw = -dSp.' * (clq.cl .* sad) / area; + clq.cdw = dSp.' * (clq.cd .* cad)/ area; if (wing.sym) - clq.bmw = (dS .* wing.zc).' * (clq.cl .* cad) / area; + clq.bmw = dSp.' * (clq.cl .* cad) / area; endif # integral moment - local moment contributions clq.cmw = (dS .* wing.ch).' * clq.cm; Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-11-25 10:09:38 UTC (rev 5464) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-11-25 12:22:03 UTC (rev 5465) @@ -59,7 +59,6 @@ wing.zc = zc = m2 (zac); wing.ch = m2 (aci(:,3)); wing.twc = pi/180 * m2 (aci(:,4)); - wing.lcd = cos (diff (wing.yac) ./ diff (zac)); zpol = [pols.z]; if (any (diff (zpol) < 0)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5486] trunk/octave-forge/extra/nlwing2 From: - 2008-12-10 11:15:55 ```Revision: 5486 http://octave.svn.sourceforge.net/octave/?rev=5486&view=rev Author: highegg Date: 2008-12-10 11:15:50 +0000 (Wed, 10 Dec 2008) Log Message: ----------- correct cmac, xmac & ymac calculation Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2008-12-09 19:58:20 UTC (rev 5485) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2008-12-10 11:15:50 UTC (rev 5486) @@ -1,3 +1,8 @@ +2008-12-10 Jaroslav Hajek + + * inst/makewing.m: Correct xmac, ymac & cmac calculation for symmetric + wings. + 2008-11-25 Jaroslav Hajek * inst/calcwing.m: Fix clw calculation. Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-12-09 19:58:20 UTC (rev 5485) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2008-12-10 11:15:50 UTC (rev 5486) @@ -99,13 +99,13 @@ wing.sym = true; endif if (! isfield (wing, 'area')) - wing.area = sum (dS); + area = wing.area = sum (dS); if (wing.sym) wing.area *= 2; endif endif if (! isfield (wing, 'cmac')) - wing.cmac = sum (dS .* wing.ch) / wing.area; + wing.cmac = sum (dS .* wing.ch) / area; endif if (! isfield (wing, 'span')) wing.span = wing.zac(end) - wing.zac(1); @@ -116,8 +116,8 @@ xac = wing.xac; xac = (xac(1:end-1) + xac(2:end))/2; yac = wing.yac; yac = (yac(1:end-1) + yac(2:end))/2; if (! isfield (wing, 'xmac')) - wing.xmac = dot (dS, xac) / wing.area; - wing.ymac = dot (dS, yac) / wing.area; + wing.xmac = dot (dS, xac) / area; + wing.ymac = dot (dS, yac) / area; endif dxmac = xac - wing.xmac; dymac = yac - wing.ymac; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5522] trunk/octave-forge/extra/nlwing2 From: - 2009-01-12 14:55:01 ```Revision: 5522 http://octave.svn.sourceforge.net/octave/?rev=5522&view=rev Author: highegg Date: 2009-01-12 14:54:54 +0000 (Mon, 12 Jan 2009) Log Message: ----------- fix missing variable Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-12 05:00:42 UTC (rev 5521) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-12 14:54:54 UTC (rev 5522) @@ -1,3 +1,7 @@ +2009-01-12 Jaroslav Hajek + + * inst/makewing.m: Also assign half area if provided by user. + 2008-12-10 Jaroslav Hajek * inst/makewing.m: Correct xmac, ymac & cmac calculation for symmetric Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2009-01-12 05:00:42 UTC (rev 5521) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2009-01-12 14:54:54 UTC (rev 5522) @@ -103,6 +103,8 @@ if (wing.sym) wing.area *= 2; endif + else + area = wing.area / 2; endif if (! isfield (wing, 'cmac')) wing.cmac = sum (dS .* wing.ch) / area; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5546] trunk/octave-forge/extra/nlwing2 From: - 2009-01-28 11:08:17 ```Revision: 5546 http://octave.svn.sourceforge.net/octave/?rev=5546&view=rev Author: highegg Date: 2009-01-28 11:08:12 +0000 (Wed, 28 Jan 2009) Log Message: ----------- support experimental use of fsolve as a corrector Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/DESCRIPTION trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/corrector.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-27 16:15:37 UTC (rev 5545) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-28 11:08:12 UTC (rev 5546) @@ -1,3 +1,8 @@ +2009-01-28 Jaroslav Hajek + + * inst/corrector.m: Optionally use fsolve as a corrector. + * inst/calcwing.m: Support the option. + 2009-01-12 Jaroslav Hajek * inst/makewing.m: Also assign half area if provided by user. Modified: trunk/octave-forge/extra/nlwing2/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/nlwing2/DESCRIPTION 2009-01-27 16:15:37 UTC (rev 5545) +++ trunk/octave-forge/extra/nlwing2/DESCRIPTION 2009-01-28 11:08:12 UTC (rev 5546) @@ -1,6 +1,6 @@ Name: NLWing2 -Version: 1.0.4 -Date: 2008-01-12 +Version: 1.1.0 +Date: 2008-01-28 Author: Jaroslav Hajek Title: Nonlinear Lifting Line for Wings Maintainer: Jaroslav Hajek Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-01-27 16:15:37 UTC (rev 5545) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-01-28 11:08:12 UTC (rev 5546) @@ -26,14 +26,15 @@ % from makewing), and any following arguments must be in % @code{"option name", option_value} pairs. Valid options are: % @itemize -% @item "start" Initial angle of attack (0) -% @item "limit" Maximum angle of attack (22) -% @item "psep" The minimum past-separation local angle to terminate (0) -% @item "sstep" Initial angle step (0.5) -% @item "mstep" Minimum angle step (1e-2) -% @item "maxit" Maximum number of corrector iterations (250) -% @item "minit" Minimum number of corrector iterations (4) -% @item "tol" Minimum tolerance to achieve in corrector. +% @item "start" Initial angle of attack (0) +% @item "limit" Maximum angle of attack (22) +% @item "psep" The minimum past-separation local angle to terminate (0) +% @item "sstep" Initial angle step (0.5) +% @item "mstep" Minimum angle step (1e-2) +% @item "maxit" Maximum number of corrector iterations (250) +% @item "minit" Minimum number of corrector iterations (4) +% @item "tol" Minimum tolerance to achieve in corrector. +% @item "use_fsolve" Use fsolve as a corrector (false) (experimental). % @end itemize % @end deftypefn function clq = calcwing (wing, varargin) @@ -48,7 +49,8 @@ opts.mstep = 1e-2; opts.maxit = 250; opts.minit = 4; - opts.tol = 1e-4; + opts.tol = []; + opts.use_fsolve = false; wassep = false; ns = 0; @@ -56,6 +58,15 @@ for i = 1:2:length (varargin)-1 opts.(varargin{i}) = varargin{i+1}; endfor + ## FIXME: the following duality stems from the fact that + ## fsolve uses relative tolerance. Need a better solution here. + if (isempty (opts.tol)) + if (opts.use_fsolve) + opts.tol = 1e-12; + else + opts.tol = 1e-4; + endif + endif flw.wing = wing; @@ -65,13 +76,19 @@ flw1 = flw; + first_iter = true; while (flw.alfad < opts.limit && step >= opts.mstep) % corrector printf_flush ("corrector loop: "); - nmaxit = max (opts.minit, floor (opts.maxit * opts.mstep / step)); + if (opts.use_fsolve) + nmaxit = opts.maxit; + else + nmaxit = max (opts.minit, floor (opts.maxit * opts.mstep / step)); + endif tol1 = min (1e4*flw.res, opts.tol); - flw1 = corrector (flw1, tol1, opts.minit, nmaxit); + flw1 = corrector (flw1, tol1, opts.minit, nmaxit, ... + opts.use_fsolve * (1 + first_iter)); if (isempty (flw1)) printf_flush (" bad.\n"); @@ -83,6 +100,7 @@ endif else printf_flush (" good.\n"); + first_iter = false; flw = flw1; ns++; alfas{ns} = flw.alfad; Modified: trunk/octave-forge/extra/nlwing2/inst/corrector.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/corrector.m 2009-01-27 16:15:37 UTC (rev 5545) +++ trunk/octave-forge/extra/nlwing2/inst/corrector.m 2009-01-28 11:08:12 UTC (rev 5546) @@ -27,52 +27,108 @@ % iterations, respectively. Returns empty matrix if not successful. % @end deftypefn -function flow = corrector (flow, tol, nitmin, nitmax) +function flow = corrector (flow, tol, nitmin, nitmax, use_fsolve) + if (use_fsolve) - np = length (flow.g); - eqj = flow.eqj; - eq = flow.eq; - g = flow.g; - res = norm (eq) / sqrt(np); - printf ("%5.2e ", res); + global current_corrector_flow; + current_corrector_flow = flow; - lam0 = sqrt (1e-1*eps) * norm (eqj, 1); - lambda = lam0; - - it = 1; - do - if (lambda <= lam0) - % newton step - g1 = g - eqj \ eq; + if (use_fsolve == 2) + ## turn off Broyden updates in the first iteration. This wouldn't be + ## necessary if fsolve was more intelligent about them. + updating = "off"; else - % levenberg-marquardt step (ridge regression) - g1 = g - [eqj; lambda*eye(np)] \ [eq; zeros(np, 1)]; + updating = "on"; endif - eq1 = floweq (g1, flow); - res1 = norm (eq1) / sqrt (np); - if (res1 < res) - % successful step - lambda = max (lam0, lambda/1.4); - g = g1; - eq = eq1; - res = res1; - eqj = floweqj (g, flow); - printf ("%5.2e ", res); + np = length (flow.g); + [g, eq, info, out, eqj] = fsolve (@corrector_fcn, flow.g, ... + optimset ("MaxIter", nitmax, + "TolFun", tol, + "Jacobian", "on", + "Updating", updating, + "OutputFcn", @corrector_output_fcn)); + printf ("i: %d ", info); + if (info > 0) + res = norm (eq) / sqrt(np); + flow.g = g; + flow.eq = eq; + flow.res = res; + flow.eqj = eqj; else - lambda *= 2; - printf ("+ "); + flow = []; endif - until ((res < tol && it >= nitmin) || it++ == nitmax ) + else + np = length (flow.g); + eqj = flow.eqj; + eq = flow.eq; + g = flow.g; + res = norm (eq) / sqrt(np); + printf ("%5.2e ", res); - % check if failed - if (it > nitmax) - flow = []; - else - flow.g = g1; - flow.eq = eq1; - flow.res = res1; - flow.eqj = eqj; + lam0 = sqrt (1e-1*eps) * norm (eqj, 1); + lambda = lam0; + + it = 1; + do + if (lambda <= lam0) + % newton step + g1 = g - eqj \ eq; + else + % levenberg-marquardt step (ridge regression) + g1 = g - [eqj; lambda*eye(np)] \ [eq; zeros(np, 1)]; + endif + eq1 = floweq (g1, flow); + res1 = norm (eq1) / sqrt (np); + if (res1 < res) + % successful step + lambda = max (lam0, lambda/1.4); + g = g1; + eq = eq1; + res = res1; + eqj = floweqj (g, flow); + printf ("%5.2e ", res); + else + lambda *= 2; + printf ("+ "); + endif + until ((res < tol && it >= nitmin) || it++ == nitmax ) + + % check if failed + if (it > nitmax) + flow = []; + else + flow.g = g1; + flow.eq = eq1; + flow.res = res1; + flow.eqj = eqj; + endif endif endfunction + +function [eq, eqj] = corrector_fcn (g) + global current_corrector_flow; + eq = floweq (g, current_corrector_flow); + ## FIXME: worksharing possible amongst floweq/floweqj ! + if (nargout > 1) + eqj = floweqj (g, current_corrector_flow); + endif +endfunction + +function stop = corrector_output_fcn (g, opt, state) + persistent lastiter = 0; + iter = opt.iter; + if (iter < lastiter) + lastiter = 0; + endif + if (iter > lastiter) + printf ("%5.2e ", opt.fval / sqrt (length (g))); + lastiter = iter; + else + printf ("+ "); + endif + stop = false; + +endfunction + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5547] trunk/octave-forge/extra/nlwing2 From: - 2009-01-28 12:29:15 ```Revision: 5547 http://octave.svn.sourceforge.net/octave/?rev=5547&view=rev Author: highegg Date: 2009-01-28 12:29:10 +0000 (Wed, 28 Jan 2009) Log Message: ----------- fix docstring Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/qcalc.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-28 11:08:12 UTC (rev 5546) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-28 12:29:10 UTC (rev 5547) @@ -2,6 +2,7 @@ * inst/corrector.m: Optionally use fsolve as a corrector. * inst/calcwing.m: Support the option. + * inst/qcalc.m: Fix docstring. 2009-01-12 Jaroslav Hajek Modified: trunk/octave-forge/extra/nlwing2/inst/qcalc.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/qcalc.m 2009-01-28 11:08:12 UTC (rev 5546) +++ trunk/octave-forge/extra/nlwing2/inst/qcalc.m 2009-01-28 12:29:10 UTC (rev 5547) @@ -32,6 +32,7 @@ % @item cm % local flow twist (difference of local induced angle of attack and global angle of attack) % @item alc +% @end table % @end deftypefn function [cl, cd, cm, ad] = qcalc (flow) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5548] trunk/octave-forge/extra/nlwing2 From: - 2009-01-28 12:35:00 ```Revision: 5548 http://octave.svn.sourceforge.net/octave/?rev=5548&view=rev Author: highegg Date: 2009-01-28 12:34:56 +0000 (Wed, 28 Jan 2009) Log Message: ----------- another doc fix Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/predictor.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-28 12:29:10 UTC (rev 5547) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-01-28 12:34:56 UTC (rev 5548) @@ -3,6 +3,7 @@ * inst/corrector.m: Optionally use fsolve as a corrector. * inst/calcwing.m: Support the option. * inst/qcalc.m: Fix docstring. + * inst/predictor.m: Dtto. 2009-01-12 Jaroslav Hajek Modified: trunk/octave-forge/extra/nlwing2/inst/predictor.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/predictor.m 2009-01-28 12:29:10 UTC (rev 5547) +++ trunk/octave-forge/extra/nlwing2/inst/predictor.m 2009-01-28 12:34:56 UTC (rev 5548) @@ -24,6 +24,7 @@ % Predicts a flow change when the global angle of attack is increased, % using a Euler finite-difference method. @var{dalfad} specifies the angle % step in degrees. Returns empty matrix if not successful. +% @end deftypefn function flow1 = predictor (flow, dalfad) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5572] trunk/octave-forge/extra/nlwing2 From: - 2009-03-02 14:34:41 ```Revision: 5572 http://octave.svn.sourceforge.net/octave/?rev=5572&view=rev Author: highegg Date: 2009-03-02 14:34:31 +0000 (Mon, 02 Mar 2009) Log Message: ----------- allow optional suppressing of output Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/DESCRIPTION trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/corrector.m Modified: trunk/octave-forge/extra/nlwing2/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/nlwing2/DESCRIPTION 2009-02-27 12:19:46 UTC (rev 5571) +++ trunk/octave-forge/extra/nlwing2/DESCRIPTION 2009-03-02 14:34:31 UTC (rev 5572) @@ -1,6 +1,6 @@ Name: NLWing2 -Version: 1.1.0 -Date: 2008-01-28 +Version: 1.1.1 +Date: 2009-03-02 Author: Jaroslav Hajek Title: Nonlinear Lifting Line for Wings Maintainer: Jaroslav Hajek Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-02-27 12:19:46 UTC (rev 5571) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-03-02 14:34:31 UTC (rev 5572) @@ -34,13 +34,12 @@ % @item "maxit" Maximum number of corrector iterations (250) % @item "minit" Minimum number of corrector iterations (4) % @item "tol" Minimum tolerance to achieve in corrector. +% @item "silent" Suppress verbose output (false) % @item "use_fsolve" Use fsolve as a corrector (false) (experimental). % @end itemize % @end deftypefn function clq = calcwing (wing, varargin) - page_screen_output (0); - % set default options opts.start = 0; opts.limit = 22; @@ -50,6 +49,7 @@ opts.maxit = 250; opts.minit = 4; opts.tol = []; + opts.silent = false; opts.use_fsolve = false; wassep = false; @@ -68,6 +68,11 @@ endif endif + if (opts.silent) + % supply a dummy output function + printf_flush = @() []; + endif + flw.wing = wing; step = opts.sstep; @@ -177,7 +182,7 @@ endfunction function printf_flush (varargin) - printf (varargin{:}); - fflush (stdout); + fprintf (stderr, varargin{:}); + fflush (stderr); endfunction Modified: trunk/octave-forge/extra/nlwing2/inst/corrector.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/corrector.m 2009-02-27 12:19:46 UTC (rev 5571) +++ trunk/octave-forge/extra/nlwing2/inst/corrector.m 2009-03-02 14:34:31 UTC (rev 5572) @@ -20,20 +20,21 @@ % % -*- texinfo -*- -% @deftypefn{Function File} {flow =} corrector (flow, tol, nitmin, nitmax) +% @deftypefn{Function File} {flow =} corrector (flow, opts, init) % applies a newton/levenberg-marquardt corrector to a flow state, in order -% to reach local lift/circulation balance. @var{tol} specifies the tolerance, -% @var{nitmin} and @var{nitmax} are the minimum and maximum numbers of -% iterations, respectively. Returns empty matrix if not successful. +% to reach local lift/circulation balance. Reads the options tol, nitmin, +% nitmax, use_fsolve and silent from opts. +% Returns empty matrix if not successful. % @end deftypefn -function flow = corrector (flow, tol, nitmin, nitmax, use_fsolve) - if (use_fsolve) +function flow = corrector (flow, opts, init) + verbose = ! opts.silent; + if (opts.use_fsolve) global current_corrector_flow; current_corrector_flow = flow; - if (use_fsolve == 2) + if (init) ## turn off Broyden updates in the first iteration. This wouldn't be ## necessary if fsolve was more intelligent about them. updating = "off"; @@ -41,13 +42,17 @@ updating = "on"; endif np = length (flow.g); - [g, eq, info, out, eqj] = fsolve (@corrector_fcn, flow.g, ... - optimset ("MaxIter", nitmax, - "TolFun", tol, - "Jacobian", "on", - "Updating", updating, - "OutputFcn", @corrector_output_fcn)); - printf ("i: %d ", info); + opts = optimset ("MaxIter", nitmax, + "TolFun", tol, + "Jacobian", "on", + "Updating", updating); + if (verbose) + opts = optimset (opts, "OutputFcn", @corrector_output_fcn)); + endif + [g, eq, info, out, eqj] = fsolve (@corrector_fcn, flow.g, opts); + if (verbose) + printf ("i: %d ", info); + endif if (info > 0) res = norm (eq) / sqrt(np); flow.g = g; @@ -63,7 +68,9 @@ eq = flow.eq; g = flow.g; res = norm (eq) / sqrt(np); - printf ("%5.2e ", res); + if (verbose) + printf ("%5.2e ", res); + endif lam0 = sqrt (1e-1*eps) * norm (eqj, 1); lambda = lam0; @@ -86,10 +93,14 @@ eq = eq1; res = res1; eqj = floweqj (g, flow); - printf ("%5.2e ", res); + if (verbose) + printf ("%5.2e ", res); + endif else lambda *= 2; - printf ("+ "); + if (verbose) + printf ("+ "); + endif endif until ((res < tol && it >= nitmin) || it++ == nitmax ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[5734] trunk/octave-forge/extra/nlwing2 From: - 2009-04-28 08:05:21 ```Revision: 5734 http://octave.svn.sourceforge.net/octave/?rev=5734&view=rev Author: highegg Date: 2009-04-28 08:05:15 +0000 (Tue, 28 Apr 2009) Log Message: ----------- missing semicolon Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/calcwing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-04-27 14:24:07 UTC (rev 5733) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-04-28 08:05:15 UTC (rev 5734) @@ -1,3 +1,15 @@ +2009-04-28 Jaroslav Hajek + + * inst/calcwing.m: Add missing semicolon. + +2009-03-02 Jaroslav Hajek + + * inst/calcwing.m: Make verbose output optional. + * inst/corrector.m: Ditto. + * inst/floweqj.m: Replace dmult. + * inst/makeflow.m: Ditto. + * inst/polppder.m: Ditto. + 2009-01-28 Jaroslav Hajek * inst/corrector.m: Optionally use fsolve as a corrector. Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-04-27 14:24:07 UTC (rev 5733) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-04-28 08:05:15 UTC (rev 5734) @@ -139,7 +139,7 @@ endwhile if (step <= opts.mstep) - printf_flush ("unpredicted.\n") + printf_flush ("unpredicted.\n"); step = opts.mstep; flw1 = setalfa (flw, flw.alfad + step); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[6581] trunk/octave-forge/extra/nlwing2 From: - 2009-12-03 11:22:40 ```Revision: 6581 http://octave.svn.sourceforge.net/octave/?rev=6581&view=rev Author: highegg Date: 2009-12-03 11:22:32 +0000 (Thu, 03 Dec 2009) Log Message: ----------- store cac in wing structure Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/makewing.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-12-03 11:18:35 UTC (rev 6580) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-12-03 11:22:32 UTC (rev 6581) @@ -1,3 +1,9 @@ +2009-10-15 Jaroslav Hajek + + * inst/makewing.m: Also store wing.cac. + * inst/plotplanform: Preliminary function for plotting the planform + shape. + 2009-04-28 Jaroslav Hajek * inst/calcwing.m: Add missing semicolon. Modified: trunk/octave-forge/extra/nlwing2/inst/makewing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/makewing.m 2009-12-03 11:18:35 UTC (rev 6580) +++ trunk/octave-forge/extra/nlwing2/inst/makewing.m 2009-12-03 11:22:32 UTC (rev 6581) @@ -54,6 +54,7 @@ aci = interp1 (ozac, ac(:,2:5), zac, "pchip"); wing.xac = aci(:,1); wing.yac = aci(:,2); + wing.cac = aci(:,3); m2 = @(v) (v(1:end-1)+v(2:end))/2; wing.zc = zc = m2 (zac); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[6583] trunk/octave-forge/extra/nlwing2 From: - 2009-12-03 11:30:39 ```Revision: 6583 http://octave.svn.sourceforge.net/octave/?rev=6583&view=rev Author: highegg Date: 2009-12-03 11:30:26 +0000 (Thu, 03 Dec 2009) Log Message: ----------- NLWing2 1.2.0 Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/DESCRIPTION trunk/octave-forge/extra/nlwing2/INDEX trunk/octave-forge/extra/nlwing2/src/Makefile trunk/octave-forge/extra/nlwing2/src/biotsavart.cc Added Paths: ----------- trunk/octave-forge/extra/nlwing2/inst/plotplanform.m Modified: trunk/octave-forge/extra/nlwing2/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/nlwing2/DESCRIPTION 2009-12-03 11:23:22 UTC (rev 6582) +++ trunk/octave-forge/extra/nlwing2/DESCRIPTION 2009-12-03 11:30:26 UTC (rev 6583) @@ -1,5 +1,5 @@ Name: NLWing2 -Version: 1.1.1 +Version: 1.2.0 Date: 2009-03-02 Author: Jaroslav Hajek Title: Nonlinear Lifting Line for Wings Modified: trunk/octave-forge/extra/nlwing2/INDEX =================================================================== --- trunk/octave-forge/extra/nlwing2/INDEX 2009-12-03 11:23:22 UTC (rev 6582) +++ trunk/octave-forge/extra/nlwing2/INDEX 2009-12-03 11:30:26 UTC (rev 6583) @@ -1,5 +1,6 @@ nlwing2 >> NLWing2 NLWing2 + biotsavart calcwing combinepolars corrector @@ -10,6 +11,7 @@ loadwing makeflow makewing + plotplanform polppder predictor qcalc Added: trunk/octave-forge/extra/nlwing2/inst/plotplanform.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/plotplanform.m (rev 0) +++ trunk/octave-forge/extra/nlwing2/inst/plotplanform.m 2009-12-03 11:30:26 UTC (rev 6583) @@ -0,0 +1,48 @@ +% Copyright (C) 2009 VZLU Prague, a.s., Czech Republic +% +% Author: Jaroslav Hajek +% +% This file is part of NLWing2. +% +% NLWing2 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 3 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 software; see the file COPYING. If not, see +% ;. +% + +% -*- texinfo -*- +% @deftypefn{Function File} plotplanform (ac, npan = 80) +% @end deftypefn + +function plotplanform (wing) + zac = wing.zac; + xac = wing.xac; + cac = wing.cac; + + x = [zac; flipud(zac)]; + y = [xac - 1/4*cac; flipud(xac + 3/4*cac)]; + + if (wing.sym) + x = [x; -x]; + y = [y; y]; + else + x(end+1,:) = x(1,:); + y(end+1,:) = y(1,:); + endif + + plot (x, y); + r = 0.05 * max(abs (x)); + lims = [min(x) - r, max(x) + r]; + set (gca, "xlim", lims); + set (gca, "ylim", lims); + +endfunction Modified: trunk/octave-forge/extra/nlwing2/src/Makefile =================================================================== --- trunk/octave-forge/extra/nlwing2/src/Makefile 2009-12-03 11:23:22 UTC (rev 6582) +++ trunk/octave-forge/extra/nlwing2/src/Makefile 2009-12-03 11:30:26 UTC (rev 6583) @@ -21,7 +21,7 @@ MKOCTFILE=mkoctfile -all: vitensor.oct +all: vitensor.oct biotsavart.oct vitensor.oct: vitensor.cc vitens.f \$(MKOCTFILE) -o \$@ \$^ Modified: trunk/octave-forge/extra/nlwing2/src/biotsavart.cc =================================================================== --- trunk/octave-forge/extra/nlwing2/src/biotsavart.cc 2009-12-03 11:23:22 UTC (rev 6582) +++ trunk/octave-forge/extra/nlwing2/src/biotsavart.cc 2009-12-03 11:30:26 UTC (rev 6583) @@ -73,21 +73,21 @@ by a vortex ray starting in @code{@var{x}(j,1:3)} and going in the direction @var{dir(1:3)}.\n\ @deftypefnx{Loadable Function} {vn} = biotsavart (@var{cp}, @var{cn}, @var{x}, @var{dir}, \"fn\")\n\ @code{@var{vi}(i,j,1:3)} is the velocity induced in @code{@var{cp}(i,1:3)}\n\ -in the direction @code{@var{cn}(i,1:3)\n\ +in the direction @code{@var{cn}(i,1:3)}\n\ by a vortex ray starting in @code{@var{x}(j,1:3)} and going in the direction @var{dir(1:3)}.\n\ @deftypefnx{Loadable Function} {vi} = biotsavart (@var{cp}, @var{x}, @var{y}, \"b\")\n\ @code{@var{vi}(i,j,1:3)} is the velocity induced in @code{@var{cp}(i,1:3)}\n\ by a vortex segment joining @code{@var{x}(j,1:3)} and @code{@var{y}(j,1:3)}.\n\ @deftypefnx{Loadable Function} {vn} = biotsavart (@var{cp}, @var{cn}, @var{x}, @var{y}, \"bn\")\n\ @code{@var{vi}(i,j,1:3)} is the velocity induced in @code{@var{cp}(i,1:3)}\n\ -in the direction @code{@var{cn}(i,1:3)\n\ +in the direction @code{@var{cn}(i,1:3)}\n\ by a vortex segment joining @code{@var{x}(j,1:3)} and @code{@var{y}(j,1:3)}.\n\ @deftypefnx{Loadable Function} {vi} = biotsavart (@var{cp}, @var{x}, \"c\")\n\ @code{@var{vi}(i,j,1:3)} is the velocity induced in @code{@var{cp}(i,1:3)}\n\ by a vortex segment joining @code{@var{x}(j,1:3)} and @code{@var{x}(j+1,1:3)}.\n\ @deftypefnx{Loadable Function} {vn} = biotsavart (@var{cp}, @var{cn}, @var{x}, \"cn\")\n\ @code{@var{vi}(i,j,1:3)} is the velocity induced in @code{@var{cp}(i,1:3)}\n\ -in the direction @code{@var{cn}(i,1:3)\n\ +in the direction @code{@var{cn}(i,1:3)}\n\ by a vortex segment joining @code{@var{x}(j,1:3)} and @code{@var{x}(j+1,1:3)}.\n\ @end deftypefn") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[6589] trunk/octave-forge/extra/nlwing2 From: - 2009-12-03 15:00:55 ```Revision: 6589 http://octave.svn.sourceforge.net/octave/?rev=6589&view=rev Author: highegg Date: 2009-12-03 15:00:43 +0000 (Thu, 03 Dec 2009) Log Message: ----------- more robustness changes Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m trunk/octave-forge/extra/nlwing2/inst/loadpolars.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-12-03 14:56:37 UTC (rev 6588) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-12-03 15:00:43 UTC (rev 6589) @@ -1,3 +1,10 @@ +2009-12-03 Jaroslav Hajek + + * inst/ppder.m: Adapt to latest Octave. + * inst/liftanalyze.m: Add & reorder test. Make zero lift estimation + more robust. + * inst/loadpolars.m: Preserve the shape of input. + 2009-10-15 Jaroslav Hajek * inst/makewing.m: Also store wing.cac. Modified: trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2009-12-03 14:56:37 UTC (rev 6588) +++ trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2009-12-03 15:00:43 UTC (rev 6589) @@ -27,24 +27,39 @@ function [a0, amax, clmax] = liftanalyze (al, cl, pn = '') if (pn) - wpref = strcat ("liftanalyze (", pn, "): "); + wpref = ["liftanalyze (", pn, "): "]; else wpref = "liftanalyze: "; endif - if (cl(1) > 0) - warning ([wpref, "polar starts at positive lift"]); - warned = true; - endif [clmin, imin] = min (cl); [clmax, imax] = max (cl); - if (any (cl(imin+1:imax) < cl(imin:imax-1))) - warning ([wpref, "multimodal lift curve"]); - warned = true; + if (imin >= imax || clmax < 0) + error ([wpref, "unphysical lift curve"]); endif + if (clmin > 0) + warning ([wpref, "polar starts at positive lift"]); + endif if (imax == length (cl)) warning ([wpref, "maximum lift at end of lift curve"]); - warned = true; endif - a0 = interp1 (cl(imin:imax), al(imin:imax), 0, "extrap"); amax = al(imax); + + if (any (cl(imin+1:imax) < cl(imin:imax-1))) + warning ([wpref, "multimodal lift curve"]); + % Try to reduce the range to find a monotonic subinterval. + if (clmin > 0) + ilo = imin; + imax = imin + 4; + else + ilo = find (cl < 0, 1, "last"); + iup = find (cl > 0, 1, "first"); + imin = max (imin, ilo - 2); + imax = min (imax, iup + 2); + endif + if (any (cl(imin+1:imax) < cl(imin:imax-1))) + error ([wpref, "failed to estimate zero lift"]); + endif + endif + + a0 = interp1 (cl(imin:imax), al(imin:imax), 0); endfunction Modified: trunk/octave-forge/extra/nlwing2/inst/loadpolars.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/loadpolars.m 2009-12-03 14:56:37 UTC (rev 6588) +++ trunk/octave-forge/extra/nlwing2/inst/loadpolars.m 2009-12-03 15:00:43 UTC (rev 6589) @@ -38,6 +38,10 @@ function pol = loadpolars (pn) if (ischar (pn)) + if (rows (pn) != 1) + pol = loadpolars (cellstr (pn)); + return; + endif dat = load ('-ascii', pn); alpha = dat(:,1) * pi/180; [a0, amax, pol.clmax] = liftanalyze (alpha, dat(:,2), pn); @@ -49,11 +53,12 @@ pol.cm = pchip (alpha, dat(:,4)); elseif (iscellstr (pn)) % remove duplicates - [pnu, inu, inu] = unique (pn); + [pnu, inu, inu] = unique (pn(:)); polu = cellfun (@loadpolars, pnu); - pol = polu(inu); + pol = reshape (polu(inu), size (pn)); elseif (isstruct (pn)) - pol = loadpolars ({pn.names}); + names = reshape ({pn.names}, size (pn)); + pol = loadpolars (names); [pol.z] = pn.z; else error ("loadpolars: invalid input"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [Octave-cvsupdate] SF.net SVN: octave:[6653] trunk/octave-forge/extra/nlwing2 From: - 2009-12-17 12:43:12 ```Revision: 6653 http://octave.svn.sourceforge.net/octave/?rev=6653&view=rev Author: highegg Date: 2009-12-17 12:14:46 +0000 (Thu, 17 Dec 2009) Log Message: ----------- a few more fixes Modified Paths: -------------- trunk/octave-forge/extra/nlwing2/ChangeLog trunk/octave-forge/extra/nlwing2/inst/calcwing.m trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m Modified: trunk/octave-forge/extra/nlwing2/ChangeLog =================================================================== --- trunk/octave-forge/extra/nlwing2/ChangeLog 2009-12-16 12:17:55 UTC (rev 6652) +++ trunk/octave-forge/extra/nlwing2/ChangeLog 2009-12-17 12:14:46 UTC (rev 6653) @@ -1,3 +1,13 @@ +2009-12-17 Jaroslav Hajek + + * inst/calcwing.m: Gripe if not converged on initial iteration. + Correct computing integral quantities. + * inst/liftanalyze.m: Fix condition test. + +2009-12-17 Jaroslav Hajek + + * inst/calcwing.m: Correct integral quantities computation. + 2009-12-03 Jaroslav Hajek * inst/ppder.m: Adapt to latest Octave. Modified: trunk/octave-forge/extra/nlwing2/inst/calcwing.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-12-16 12:17:55 UTC (rev 6652) +++ trunk/octave-forge/extra/nlwing2/inst/calcwing.m 2009-12-17 12:14:46 UTC (rev 6653) @@ -96,7 +96,9 @@ if (isempty (flw1)) printf_flush (" bad.\n"); - if (step == opts.mstep) + if (first_iter) + error ("Could not converge from initial point. Try different settings"); + elseif (step == opts.mstep) printf_flush ("terminating.\n"); break; else @@ -158,24 +160,26 @@ clq.zsep = cell2mat (zsep); # integral quantities - dS = wing.ch .* diff (wing.zac); - dSp = wing.ch .* hypot (diff (wing.zac), diff (wing.yac)); + dzac = diff (wing.zac); + dS = wing.ch .* dzac; + dSp = wing.ch .* hypot (dzac, diff (wing.yac)); area = wing.area; if (wing.sym) area /= 2; endif cad = cos (clq.ad); sad = sin (clq.ad); - clq.clw = dS.' * (clq.cl .* cad) / area; + clq.clw = dS.' * (clq.cl .* cad + clq.cd .* sad) / area; clq.cdiw = -dSp.' * (clq.cl .* sad) / area; - clq.cdw = dSp.' * (clq.cd .* cad)/ area; + clq.cdw = dSp.' * (clq.cd .* cad)/ area + clq.cdiw; if (wing.sym) clq.bmw = dSp.' * (clq.cl .* cad) / area; endif # integral moment - local moment contributions clq.cmw = (dS .* wing.ch).' * clq.cm; - # local lift contributions - adm = repmat (wing.amac, 1, ns) + repmat (clq.al, length (dS), 1) + clq.ad; - clq.cmw += (dS .* wing.rmac).' * (clq.cl .* cos (adm)); + # local force contributions + adm = bsxfun (@minus, clq.al, wing.amac) + clq.ad; + clq.cmw -= (dS .* wing.rmac).' * (clq.cl .* cos (adm)); + clq.cmw += (dSp .* wing.rmac).' * (clq.cd .* sin (adm)); clq.cmw /= (area * wing.cmac); endfunction Modified: trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m =================================================================== --- trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2009-12-16 12:17:55 UTC (rev 6652) +++ trunk/octave-forge/extra/nlwing2/inst/liftanalyze.m 2009-12-17 12:14:46 UTC (rev 6653) @@ -47,7 +47,7 @@ if (any (cl(imin+1:imax) <= cl(imin:imax-1))) warning ([wpref, "multimodal lift curve"]); % Try to reduce the range to find a monotonic subinterval. - if (clmin > 0) + if (clmin >= 0) ilo = imin; iup = imin + 1; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```