chiark / gitweb /
curveopt: better costs, seems more plausible now
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Apr 2018 12:53:30 +0000 (13:53 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Apr 2018 12:53:30 +0000 (13:53 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
symbolic.py

index e6d3a659e78321a06c0cdd028a6034179b578d7b..8680378ea06d906cbf58b4d230f09451e5ec281d 100644 (file)
@@ -133,15 +133,14 @@ def calculate():
   au, bu = CoordArray ('au bu',   'NP-1', a / al        ).s() # [1]
 
   tan_theta = (au ^ bu) / (au & bu)     # [1]     bending
-  curvature = tan_theta / sqrt(al * bl) # [1/mm]  bending per unit length
 
   global mu, nu
-  mu, nu = CoordArray ('mu nu', 'NP-2', curvature ).s() # [1/mm]
+  mu, nu = CoordArray ('mu nu', 'NP-2', tan_theta ).s() # [1]
 
-  CostComponent('NP-3', sqnorm(mu - nu)) # [1/mm^2]
+  CostComponent('NP-3', sqnorm(mu - nu)) # [1]
 
-  d_density = 1/al - 1/bl # [1/mm]
-  CostComponent('NP-2', pow(d_density, 2)) # [1/mm^2]
+  dl2 = pow(al - bl, 2) # [mm^2]
+  CostComponent('NP-2', dl2 / (al*bl)) # [1]
 
   # ---------- end of cost computation formulae ----------