From: Ian Jackson Date: Sun, 8 Apr 2018 12:53:30 +0000 (+0100) Subject: curveopt: better costs, seems more plausible now X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=bcd5e7d40c0c5cd49610b62a9509daa903e06101;p=moebius3.git curveopt: better costs, seems more plausible now Signed-off-by: Ian Jackson --- diff --git a/symbolic.py b/symbolic.py index e6d3a65..8680378 100644 --- a/symbolic.py +++ b/symbolic.py @@ -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 ----------