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 <highegg@...>
+
+ * 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 <highegg@...>
+
+ * inst/calcwing.m: Correct integral quantities computation.
+
2009-12-03 Jaroslav Hajek <highegg@...>
* 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.
|