From bcd5e7d40c0c5cd49610b62a9509daa903e06101 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Apr 2018 13:53:30 +0100 Subject: [PATCH] curveopt: better costs, seems more plausible now Signed-off-by: Ian Jackson --- symbolic.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 ---------- -- 2.30.2