This page was generated from unit-7-optimization/03_Shape_Derivative_Laplace_SemiAuto.ipynb.
7.3 PDE-Constrained Shape Optimization in NGSolve¶
- We want to solve the PDE-constrained shape optimization problem :nbsphinx-math:`begin{equation}
underset{Omegasubset mathsf{D}}{mbox{min}} ; J(u) := int_Omega |u-u_d|^q ; dx, quad qge 2
- end{equation}` subject to that \((\Omega,u)\) satisfy :nbsphinx-math:`begin{equation}
int_Omega nabla u cdot nabla v ; dx = int_Omega f v ; dx ; quad text{ for all } v in H_0^1(Omega),
end{equation}` where \(\Omega \subset \mathbb R^2\) for given \(u_d, f \in C^1(\mathbb R^2)\).
[1]:
import netgen.gui
from ngsolve import *
from netgen.geom2d import SplineGeometry
[2]:
geo = SplineGeometry()
geo.AddCircle(c=(0.5,0.5), r=0.5, bc = 'circle')
mesh = Mesh(geo.GenerateMesh(maxh = 0.08))
[3]:
#given data of our problem (chosen such that \Omega^* = [0,1]^2 is the optimal shape)
f = CoefficientFunction(2*y*(1-y)+2*x*(1-x))
ud = x*(1-x)*y*(1-y)
grad_f = CoefficientFunction( (f.Diff(x), f.Diff(y) ) )
grad_ud = CoefficientFunction( (ud.Diff(x), ud.Diff(y) ) )
State equation¶
[4]:
fes = H1(mesh, order=2, dirichlet=".*")
u, v = fes.TnT()
gfu = GridFunction(fes)
Draw (gfu, mesh, "state")
a = BilinearForm(fes, symmetric=True)
a += grad(u)*grad(v)*dx
fstate = LinearForm(fes)
fstate += f*v*dx
[5]:
def SolveStateEquation():
rhs = gfu.vec.CreateVector()
rhs.data = fstate.vec - a.mat * gfu.vec
update = gfu.vec.CreateVector()
update.data = a.mat.Inverse(fes.FreeDofs()) * rhs
gfu.vec.data += update
[6]:
a.Assemble()
fstate.Assemble()
SolveStateEquation()
Redraw()
Adjoint equation¶
- We set up the adjoint equation :nbsphinx-math:`begin{align*}
mbox{Find } p in H_0^1(Omega): int_Omega nabla w cdot nabla p , mbox dx = - partial_u J(u)(w) quad text{ for all } w in H_0^1(Omega)
- end{align*}` where \(u\) is the solution to the state equation. For \(J(u) = \int_\Omega |u-u_d|^q \mbox dx\), we get :nbsphinx-math:`begin{align*}
partial_u J(u)(w) = q int_Omega (u-u_d)^{d-1}w ,mbox dx.
end{align*}` However, we can also use the Diff(…) command:
[7]:
q=6
def Cost(u):
return (u-ud)**q*dx
p, w = fes.TnT()
gfp = GridFunction(fes)
Draw (gfp, mesh, "adjoint")
fadjoint = LinearForm(fes)
fadjoint += -1*Cost(gfu).Diff(gfu,w)
[8]:
def SolveAdjointEquation():
rhs = gfp.vec.CreateVector()
rhs.data = fadjoint.vec - a.mat.T * gfp.vec
update = gfp.vec.CreateVector()
update.data = a.mat.Inverse(fes.FreeDofs()).T * rhs
gfp.vec.data += update
[9]:
fadjoint.Assemble()
SolveAdjointEquation()
Redraw()
Note that (for linear problems) the operator on the left hand side of the adjoint equation is just the transpose of the state operator.
Automatic Shape Differentiation¶
- The formula for the shape derivative was derived as the partial derivative of the perturbed Lagrangian (brought back to the original domain): :nbsphinx-math:`begin{align*}
- dmathcal J(Omega; X) = frac{partial}{partial t} left( int_Omega xi(t)|u - u_d^t|^q mbox{d} x
int_{Omega} (F_t^{-top}nabla u) cdot (F_t^{-top} nabla p) xi(t) , dx - int_{Omega} xi(t) f^t p ,dx right)|_{t=0}
end{align*}` where
\(T_t(x)=x+tX(x)=y\)
\(F_t = DT_t = I+t DX\)
\(\xi(t) = \mbox{det}(F_t)\)
\(u_d^t = u_d \circ T_t\)
\(f^t = f \circ T_t\)
- The integrand depends on the parameter \(t\) only via \(\xi(t)\), \(F_t\) and \(T_t\). Denoting the integrand by \(G^{u,p}\), the derivative is given by :nbsphinx-math:`begin{align*}
dmathcal J(Omega; X) =& frac{d G^{u,p}}{d xi} frac{d xi}{d t} + frac{d G^{u,p}}{d F} frac{d F}{d t} + frac{d G^{u,p}}{dy} cdot frac{d T_t}{dt} \ =& frac{d G^{u,p}}{d xi} mbox{div}(X) + frac{d G^{u,p}}{d F} DX + frac{d G^{u,p}}{dy} cdot X
end{align*}`
[10]:
J = Parameter(1)
F = Id(2)
#Finv = 2*Id(2) - F # consistent linearization at F = I (avoids calling Inv() for speedup)
def Equation(u,v):
return ( (Inv(F.trans)*grad(u))*(Inv(F.trans)*grad(v))-f*v)*J*dx
# return ( (Finv.trans*grad(u))*(Finv.trans*grad(v))-f*v)*J*dx
def CostAuto(u):
return J*(u-ud)**q*dx
[11]:
VEC = H1(mesh, order=2, dim=2)
PHI, X = VEC.TnT()
Lagrangian = CostAuto(gfu) + Equation(gfu,gfp)
dJOmegaAuto = LinearForm(VEC)
dJOmegaAuto += Lagrangian.Diff(J, div(X))
dJOmegaAuto += Lagrangian.Diff(F, grad(X).trans) # grad(X).trans is Jacobian
dJOmegaAuto += Lagrangian.Diff(x, X[0]) + Lagrangian.Diff(y, X[1])
[12]:
b = BilinearForm(VEC)
b += InnerProduct(grad(X),grad(PHI))*dx + InnerProduct(X,PHI)*dx
gfX = GridFunction(VEC)
# gfset denotes the deformation of the original domain and will be updated during the shape optimization
gfset = GridFunction(VEC)
gfset.Set((0,0))
Draw(gfset,mesh,"gfset")
SetVisualization (deformation=True)
[13]:
def SolveDeformationEquationAuto():
rhs = gfX.vec.CreateVector()
rhs.data = dJOmegaAuto.vec - b.mat * gfX.vec
update = gfX.vec.CreateVector()
update.data = b.mat.Inverse(VEC.FreeDofs()) * rhs
gfX.vec.data += update
[14]:
b.Assemble()
dJOmegaAuto.Assemble()
SolveDeformationEquationAuto()
Draw(-gfX, mesh, "gfX")
[15]:
print('Cost at initial design', Integrate (CostAuto(gfu), mesh))
gfset.Set((0,0))
scale = 0.5 / Norm(gfX.vec)
gfset.vec.data -= scale * gfX.vec
Cost at initial design 6.143043263037125e-13
[16]:
mesh.SetDeformation(gfset)
a.Assemble()
fstate.Assemble()
SolveStateEquation()
print('Cost at new design', Integrate (CostAuto(gfu), mesh))
Cost at new design 5.152967258479243e-14
Equation can also be used to define the bilinear form. The following defines the same bilinear form as above:
[17]:
aAuto = BilinearForm(fes, symmetric=True)
aAuto += Equation(u,v)
Thus, the user has to enter the PDE (in its transformed form) only once.
Finally, let us again run the full algorithm:
[18]:
#reset to and solve for initial configuration
gfset.Set((0,0))
mesh.SetDeformation(gfset)
a.Assemble()
fstate.Assemble()
SolveStateEquation()
LineSearch = False
# visoptions.vecfunction='gfset'
# visoptions.scalfunction='state'
iter_max = 600
Jold = Integrate(CostAuto(gfu), mesh)
converged = False
for k in range(iter_max):
print('cost at iteration', k, ': ', Jold)
mesh.SetDeformation(gfset)
a.Assemble()
fstate.Assemble()
SolveStateEquation()
fadjoint.Assemble()
SolveAdjointEquation()
b.Assemble()
dJOmegaAuto.Assemble()
SolveDeformationEquationAuto()
scale = 0.01 / Norm(gfX.vec)
gfsetOld = gfset
gfset.vec.data -= scale * gfX.vec
Jnew = Integrate(CostAuto(gfu), mesh)
if LineSearch:
while Jnew > Jold and scale > 1e-12:
# input('a')
scale = scale / 2
if scale <= 1e-12:
converged = True
break
gfset.vec.data = gfsetOld.vec - scale * gfX.vec
mesh.SetDeformation(gfset)
a.Assemble()
fstate.Assemble()
SolveStateEquation()
Jnew = Integrate(CostAuto(gfu), mesh)
if converged==True:
break
Jold = Jnew
Redraw(blocking=True)
cost at iteration 0 : 6.143043263037127e-13
cost at iteration 1 : 5.748857816381934e-13
cost at iteration 2 : 5.207270131870279e-13
cost at iteration 3 : 4.712193947183997e-13
cost at iteration 4 : 4.2601324606961974e-13
cost at iteration 5 : 3.8477993445559863e-13
cost at iteration 6 : 3.4721107538485816e-13
cost at iteration 7 : 3.130177330421254e-13
cost at iteration 8 : 2.8192962180345637e-13
cost at iteration 9 : 2.5369431054191987e-13
cost at iteration 10 : 2.280764313728382e-13
cost at iteration 11 : 2.0485689447866912e-13
cost at iteration 12 : 1.838321106450843e-13
cost at iteration 13 : 1.6481322313260296e-13
cost at iteration 14 : 1.476253505021809e-13
cost at iteration 15 : 1.3210684200784194e-13
cost at iteration 16 : 1.181085471626843e-13
cost at iteration 17 : 1.0549310107220428e-13
cost at iteration 18 : 9.413422710301215e-14
cost at iteration 19 : 8.39160584031288e-14
cost at iteration 20 : 7.473247969163732e-14
cost at iteration 21 : 6.648649055935531e-14
cost at iteration 22 : 5.908959122098619e-14
cost at iteration 23 : 5.246119116250038e-14
cost at iteration 24 : 4.6528040331926496e-14
cost at iteration 25 : 4.1223681277638775e-14
cost at iteration 26 : 3.6487918732912864e-14
cost at iteration 27 : 3.22663002850714e-14
cost at iteration 28 : 2.850959756536922e-14
cost at iteration 29 : 2.5173271393222678e-14
cost at iteration 30 : 2.2216896097479226e-14
cost at iteration 31 : 1.9603507877046842e-14
cost at iteration 32 : 1.7298831296296984e-14
cost at iteration 33 : 1.5270333588860834e-14
cost at iteration 34 : 1.3486078674797666e-14
cost at iteration 35 : 1.191345526676865e-14
cost at iteration 36 : 1.0518156552078755e-14
cost at iteration 37 : 9.264472779318316e-15
cost at iteration 38 : 8.118887168346722e-15
cost at iteration 39 : 7.058250171792467e-15
cost at iteration 40 : 6.077560983164733e-15
cost at iteration 41 : 5.186120602835839e-15
cost at iteration 42 : 4.3933889356531054e-15
cost at iteration 43 : 3.7006103837890046e-15
cost at iteration 44 : 3.102068194394042e-15
cost at iteration 45 : 2.5888119284477655e-15
cost at iteration 46 : 2.1511127364366323e-15
cost at iteration 47 : 1.7795892314124534e-15
cost at iteration 48 : 1.4656210725535295e-15
cost at iteration 49 : 1.2014536750232382e-15
cost at iteration 50 : 9.801838758516994e-16
cost at iteration 51 : 7.957047641845267e-16
cost at iteration 52 : 6.426393663778916e-16
cost at iteration 53 : 5.162736988947876e-16
cost at iteration 54 : 4.1249266370631474e-16
cost at iteration 55 : 3.277198063538509e-16
cost at iteration 56 : 2.5886118975809744e-16
cost at iteration 57 : 2.0325334019841409e-16
cost at iteration 58 : 1.5861520877974e-16
cost at iteration 59 : 1.230039298526729e-16
cost at iteration 60 : 9.477436412506653e-17
cost at iteration 61 : 7.25419638516689e-17
cost at iteration 62 : 5.514937132585659e-17
cost at iteration 63 : 4.163531785142369e-17
cost at iteration 64 : 3.12087089825216e-17
cost at iteration 65 : 2.322266990758364e-17
cost at iteration 66 : 1.7182454510833098e-17
cost at iteration 67 : 1.2894450909945808e-17
cost at iteration 68 : 1.079997865413344e-17
cost at iteration 69 : 9.605031906614878e-18
cost at iteration 70 : 8.350803657661996e-18
cost at iteration 71 : 7.377590777642137e-18
cost at iteration 72 : 6.4630788827086864e-18
cost at iteration 73 : 5.6958169868781e-18
cost at iteration 74 : 5.0065924676217956e-18
cost at iteration 75 : 4.408909622327819e-18
cost at iteration 76 : 3.8826418372302256e-18
cost at iteration 77 : 3.4190927750681498e-18
cost at iteration 78 : 3.0146898061483515e-18
cost at iteration 79 : 2.655582123720523e-18
cost at iteration 80 : 2.3436988005045063e-18
cost at iteration 81 : 2.0654492382712877e-18
cost at iteration 82 : 1.824354597581179e-18
cost at iteration 83 : 1.608606174690784e-18
cost at iteration 84 : 1.4219188489963211e-18
cost at iteration 85 : 1.2544867648821696e-18
cost at iteration 86 : 1.1097385726160517e-18
cost at iteration 87 : 9.796841795248418e-19
cost at iteration 88 : 8.673301097301503e-19
cost at iteration 89 : 7.662168073870216e-19
cost at iteration 90 : 6.789214790685016e-19
cost at iteration 91 : 6.002360620968781e-19
cost at iteration 92 : 5.323467411507856e-19
cost at iteration 93 : 4.710548717874695e-19
cost at iteration 94 : 4.182066841470261e-19
cost at iteration 95 : 3.7041264995784936e-19
cost at iteration 96 : 3.292301130701417e-19
cost at iteration 97 : 2.9191638448311097e-19
cost at iteration 98 : 2.597862987462298e-19
cost at iteration 99 : 2.3061383430126417e-19
cost at iteration 100 : 2.055116262096188e-19
cost at iteration 101 : 1.826664060581047e-19
cost at iteration 102 : 1.6302282608242625e-19
cost at iteration 103 : 1.4509762831470494e-19
cost at iteration 104 : 1.2969610129260707e-19
cost at iteration 105 : 1.1559921724942204e-19
cost at iteration 106 : 1.03496588813625e-19
cost at iteration 107 : 9.23811880078129e-20
cost at iteration 108 : 8.284639855937116e-20
cost at iteration 109 : 7.405576512822442e-20
cost at iteration 110 : 6.652230561054662e-20
cost at iteration 111 : 5.954730581726789e-20
cost at iteration 112 : 5.357629855136733e-20
cost at iteration 113 : 4.802229962501629e-20
cost at iteration 114 : 4.3273793640860843e-20
cost at iteration 115 : 3.8834908365668714e-20
cost at iteration 116 : 3.504554501271e-20
cost at iteration 117 : 3.148457409312235e-20
cost at iteration 118 : 2.8450209228474785e-20
cost at iteration 119 : 2.5583030890175726e-20
cost at iteration 120 : 2.3145226275445723e-20
cost at iteration 121 : 2.0828667330074938e-20
cost at iteration 122 : 1.886421006264646e-20
cost at iteration 123 : 1.698664674315469e-20
cost at iteration 124 : 1.5399440859042634e-20
cost at iteration 125 : 1.3873539107641397e-20
cost at iteration 126 : 1.2588353600201309e-20
cost at iteration 127 : 1.1345481568011195e-20
cost at iteration 128 : 1.0303146400092054e-20
cost at iteration 129 : 9.289087630572976e-21
cost at iteration 130 : 8.442813223585179e-21
cost at iteration 131 : 7.6144851446612e-21
cost at iteration 132 : 6.92704796648706e-21
cost at iteration 133 : 6.249992251615111e-21
cost at iteration 134 : 5.6915840818037934e-21
cost at iteration 135 : 5.13804678475058e-21
cost at iteration 136 : 4.684631077688574e-21
cost at iteration 137 : 4.232093576512325e-21
cost at iteration 138 : 3.8641508154977105e-21
cost at iteration 139 : 3.494208587017907e-21
cost at iteration 140 : 3.195783812044608e-21
cost at iteration 141 : 2.8932982730645755e-21
cost at iteration 142 : 2.6512866374926297e-21
cost at iteration 143 : 2.4037537345685076e-21
cost at iteration 144 : 2.207372348775815e-21
cost at iteration 145 : 2.0044592698836802e-21
cost at iteration 146 : 1.8448571434000533e-21
cost at iteration 147 : 1.6780591065449921e-21
cost at iteration 148 : 1.5480182857960313e-21
cost at iteration 149 : 1.4103892736925021e-21
cost at iteration 150 : 1.3040773098039511e-21
cost at iteration 151 : 1.1899987272675435e-21
cost at iteration 152 : 1.1027473431853678e-21
cost at iteration 153 : 1.0077153732342402e-21
cost at iteration 154 : 9.358165781723471e-22
cost at iteration 155 : 8.56244546795749e-22
cost at iteration 156 : 7.967661085575252e-22
cost at iteration 157 : 7.298062842694039e-22
cost at iteration 158 : 6.804313276029465e-22
cost at iteration 159 : 6.2382128950362595e-22
cost at iteration 160 : 5.827147012864426e-22
cost at iteration 161 : 5.34650412466481e-22
cost at iteration 162 : 5.00351448881027e-22
cost at iteration 163 : 4.593858715259883e-22
cost at iteration 164 : 4.3072399098305265e-22
cost at iteration 165 : 3.9568799825409797e-22
cost at iteration 166 : 3.7171793174285824e-22
cost at iteration 167 : 3.41659516425832e-22
cost at iteration 168 : 3.2161158901633384e-22
cost at iteration 169 : 2.9574950931677226e-22
cost at iteration 170 : 2.7899176327014718e-22
cost at iteration 171 : 2.566803601767619e-22
cost at iteration 172 : 2.426897329336015e-22
cost at iteration 173 : 2.2339241554305903e-22
cost at iteration 174 : 2.1173284627447425e-22
cost at iteration 175 : 1.9500253879127919e-22
cost at iteration 176 : 1.853082333056546e-22
cost at iteration 177 : 1.7077388222413414e-22
cost at iteration 178 : 1.6273590168267007e-22
cost at iteration 179 : 1.500947976882005e-22
cost at iteration 180 : 1.4344832984199508e-22
cost at iteration 181 : 1.3246252535983086e-22
cost at iteration 182 : 1.2696969642106822e-22
cost at iteration 183 : 1.174523552149206e-22
cost at iteration 184 : 1.12878042553455e-22
cost at iteration 185 : 1.0463964420503125e-22
cost at iteration 186 : 1.0077070667480009e-22
cost at iteration 187 : 9.357458502280107e-23
cost at iteration 188 : 9.031688673240356e-23
cost at iteration 189 : 8.39203313140342e-23
cost at iteration 190 : 8.129684289397838e-23
cost at iteration 191 : 7.54955604177451e-23
cost at iteration 192 : 7.363927632523533e-23
cost at iteration 193 : 6.83945903263976e-23
cost at iteration 194 : 6.790283599550871e-23
cost at iteration 195 : 6.367776207667181e-23
cost at iteration 196 : 6.281156437052984e-23
cost at iteration 197 : 5.877243881306708e-23
cost at iteration 198 : 5.792951476530403e-23
cost at iteration 199 : 5.423041961572011e-23
cost at iteration 200 : 5.366601602435748e-23
cost at iteration 201 : 5.0208851677624786e-23
cost at iteration 202 : 4.9868587527017664e-23
cost at iteration 203 : 4.6595398204400735e-23
cost at iteration 204 : 4.6454814324465567e-23
cost at iteration 205 : 4.33428706899063e-23
cost at iteration 206 : 4.339576084449309e-23
cost at iteration 207 : 4.042884532699324e-23
cost at iteration 208 : 4.0678052621701616e-23
cost at iteration 209 : 3.783260457082071e-23
cost at iteration 210 : 3.8296839082678736e-23
cost at iteration 211 : 3.5543375647075765e-23
cost at iteration 212 : 3.628750715672591e-23
cost at iteration 213 : 3.364019614363634e-23
cost at iteration 214 : 3.4890499930051717e-23
cost at iteration 215 : 3.28133149801178e-23
cost at iteration 216 : 3.368769612634089e-23
cost at iteration 217 : 3.156477738257927e-23
cost at iteration 218 : 3.1643613745802317e-23
cost at iteration 219 : 2.973304684600272e-23
cost at iteration 220 : 3.0023050244757944e-23
cost at iteration 221 : 2.8321157023343893e-23
cost at iteration 222 : 2.8745933271039635e-23
cost at iteration 223 : 2.7165238644022596e-23
cost at iteration 224 : 2.763100510727823e-23
cost at iteration 225 : 2.617494384997035e-23
cost at iteration 226 : 2.6602918910377127e-23
cost at iteration 227 : 2.5384298598970356e-23
cost at iteration 228 : 2.5691863544489445e-23
cost at iteration 229 : 2.5179102127038453e-23
cost at iteration 230 : 2.537304533020561e-23
cost at iteration 231 : 2.573555715796343e-23
cost at iteration 232 : 2.3994759283813864e-23
cost at iteration 233 : 2.4468505850508594e-23
cost at iteration 234 : 2.2638364615654818e-23
cost at iteration 235 : 2.3327466310990423e-23
cost at iteration 236 : 2.1767886318115645e-23
cost at iteration 237 : 2.2632799871269392e-23
cost at iteration 238 : 2.1119347466157272e-23
cost at iteration 239 : 2.222096381522108e-23
cost at iteration 240 : 2.0759981748208628e-23
cost at iteration 241 : 2.2566447214456713e-23
cost at iteration 242 : 2.1419535349912913e-23
cost at iteration 243 : 2.173384792991751e-23
cost at iteration 244 : 2.054321511618151e-23
cost at iteration 245 : 2.0461013797380416e-23
cost at iteration 246 : 1.9601207323279104e-23
cost at iteration 247 : 1.970863407030868e-23
cost at iteration 248 : 1.9056195467570276e-23
cost at iteration 249 : 1.9215734439249664e-23
cost at iteration 250 : 1.8745435288763984e-23
cost at iteration 251 : 1.883585524985646e-23
cost at iteration 252 : 1.8999117076150324e-23
cost at iteration 253 : 1.916502771345481e-23
cost at iteration 254 : 2.010676079553046e-23
cost at iteration 255 : 1.8223274478629144e-23
cost at iteration 256 : 1.920269789989374e-23
cost at iteration 257 : 1.7194707454531933e-23
cost at iteration 258 : 1.8428137393526653e-23
cost at iteration 259 : 1.6648361228996673e-23
cost at iteration 260 : 1.8092147160756957e-23
cost at iteration 261 : 1.6337174936908383e-23
cost at iteration 262 : 1.8147369765846806e-23
cost at iteration 263 : 1.6668120001191487e-23
cost at iteration 264 : 1.9020602536425074e-23
cost at iteration 265 : 1.6786379107534984e-23
cost at iteration 266 : 1.7964524731194852e-23
cost at iteration 267 : 1.575143538192778e-23
cost at iteration 268 : 1.7229071097347644e-23
cost at iteration 269 : 1.520227417392661e-23
cost at iteration 270 : 1.6855934996523652e-23
cost at iteration 271 : 1.5014071504315854e-23
cost at iteration 272 : 1.6676258801055806e-23
cost at iteration 273 : 1.5582143620229632e-23
cost at iteration 274 : 1.755980494464641e-23
cost at iteration 275 : 1.6243070249754505e-23
cost at iteration 276 : 1.6145504376863375e-23
cost at iteration 277 : 1.5306641267661308e-23
cost at iteration 278 : 1.5509120111093546e-23
cost at iteration 279 : 1.4754474368080367e-23
cost at iteration 280 : 1.5200556956813144e-23
cost at iteration 281 : 1.4636939392047364e-23
cost at iteration 282 : 1.5226339116141175e-23
cost at iteration 283 : 1.5303321531305526e-23
cost at iteration 284 : 1.6079299830024743e-23
cost at iteration 285 : 1.4998957364369496e-23
cost at iteration 286 : 1.527847632842116e-23
cost at iteration 287 : 1.40323744191664e-23
cost at iteration 288 : 1.4741230636592796e-23
cost at iteration 289 : 1.3607493368411903e-23
cost at iteration 290 : 1.4530055638304375e-23
cost at iteration 291 : 1.341969544088835e-23
cost at iteration 292 : 1.4586544357593165e-23
cost at iteration 293 : 1.3433424758984624e-23
cost at iteration 294 : 1.612364471178219e-23
cost at iteration 295 : 1.3759249356654562e-23
cost at iteration 296 : 1.550264583869012e-23
cost at iteration 297 : 1.3154261519275472e-23
cost at iteration 298 : 1.464006069172052e-23
cost at iteration 299 : 1.265606933502466e-23
cost at iteration 300 : 1.433591627316355e-23
cost at iteration 301 : 1.2457053044535323e-23
cost at iteration 302 : 1.4415396639170875e-23
cost at iteration 303 : 1.2684004271794421e-23
cost at iteration 304 : 1.572578757168804e-23
cost at iteration 305 : 1.3226976382472826e-23
cost at iteration 306 : 1.454108066192539e-23
cost at iteration 307 : 1.2492589704940608e-23
cost at iteration 308 : 1.3906931560669908e-23
cost at iteration 309 : 1.204609944871292e-23
cost at iteration 310 : 1.3642481183056874e-23
cost at iteration 311 : 1.1996905178968037e-23
cost at iteration 312 : 1.3692278670350217e-23
cost at iteration 313 : 1.3110280959920835e-23
cost at iteration 314 : 1.4034277713916777e-23
cost at iteration 315 : 1.327035496685202e-23
cost at iteration 316 : 1.3204408559645344e-23
cost at iteration 317 : 1.2290590241939755e-23
cost at iteration 318 : 1.2814869256607595e-23
cost at iteration 319 : 1.1972165951470914e-23
cost at iteration 320 : 1.2680791585691988e-23
cost at iteration 321 : 1.2069030067662905e-23
cost at iteration 322 : 1.3220472323776193e-23
cost at iteration 323 : 1.313629544732238e-23
cost at iteration 324 : 1.2777298242448967e-23
cost at iteration 325 : 1.2779025946658156e-23
cost at iteration 326 : 1.2077038907802269e-23
cost at iteration 327 : 1.2148426363856292e-23
cost at iteration 328 : 1.1750331842778867e-23
cost at iteration 329 : 1.1921019688517618e-23
cost at iteration 330 : 1.17012468850872e-23
cost at iteration 331 : 1.1883985132339595e-23
cost at iteration 332 : 1.2365028630534283e-23
cost at iteration 333 : 1.2857903189554373e-23
cost at iteration 334 : 1.2843165800429096e-23
cost at iteration 335 : 1.2080209549669855e-23
cost at iteration 336 : 1.2114391111539533e-23
cost at iteration 337 : 1.1536611107896802e-23
cost at iteration 338 : 1.170531205620965e-23
cost at iteration 339 : 1.1328003789025087e-23
cost at iteration 340 : 1.169997142210276e-23
cost at iteration 341 : 1.144774379533962e-23
cost at iteration 342 : 1.2650755845885046e-23
cost at iteration 343 : 1.2274623354496525e-23
cost at iteration 344 : 1.2114427500676185e-23
cost at iteration 345 : 1.1712445069252924e-23
cost at iteration 346 : 1.1329825539567677e-23
cost at iteration 347 : 1.129810690108674e-23
cost at iteration 348 : 1.1024635182522225e-23
cost at iteration 349 : 1.1178899900067179e-23
cost at iteration 350 : 1.093392427038022e-23
cost at iteration 351 : 1.1402438076809178e-23
cost at iteration 352 : 1.1331370834358173e-23
cost at iteration 353 : 1.3251702428829126e-23
cost at iteration 354 : 1.0904211729645503e-23
cost at iteration 355 : 1.2668613857672813e-23
cost at iteration 356 : 1.0172764450740869e-23
cost at iteration 357 : 1.2143367348252067e-23
cost at iteration 358 : 9.859166624354784e-24
cost at iteration 359 : 1.2041586408730946e-23
cost at iteration 360 : 9.788923687850262e-24
cost at iteration 361 : 1.2423754717390956e-23
cost at iteration 362 : 1.054297689647998e-23
cost at iteration 363 : 1.2891404537710635e-23
cost at iteration 364 : 1.0551785403835406e-23
cost at iteration 365 : 1.2142432316365749e-23
cost at iteration 366 : 9.7665251763108e-24
cost at iteration 367 : 1.1816615546923356e-23
cost at iteration 368 : 9.53543864481997e-24
cost at iteration 369 : 1.1749225450778707e-23
cost at iteration 370 : 9.775692017681873e-24
cost at iteration 371 : 1.2870957205434286e-23
cost at iteration 372 : 1.1147025796834962e-23
cost at iteration 373 : 1.1003311609407008e-23
cost at iteration 374 : 1.0873290089588027e-23
cost at iteration 375 : 1.0490792959661811e-23
cost at iteration 376 : 1.0430988768953601e-23
cost at iteration 377 : 1.0284885152713581e-23
cost at iteration 378 : 1.0417993498633313e-23
cost at iteration 379 : 1.039350126066815e-23
cost at iteration 380 : 1.1280595471670396e-23
cost at iteration 381 : 1.1172955067668043e-23
cost at iteration 382 : 1.0850575918548e-23
cost at iteration 383 : 1.0665470219229604e-23
cost at iteration 384 : 1.0122787032055781e-23
cost at iteration 385 : 1.0304036297695174e-23
cost at iteration 386 : 9.854492710882776e-24
cost at iteration 387 : 1.0204678728176825e-23
cost at iteration 388 : 9.793779497443384e-24
cost at iteration 389 : 1.0431343314491184e-23
cost at iteration 390 : 1.0210647564944272e-23
cost at iteration 391 : 1.2235980589584317e-23
cost at iteration 392 : 9.80328093711085e-24
cost at iteration 393 : 1.1648024450863158e-23
cost at iteration 394 : 9.122401122529743e-24
cost at iteration 395 : 1.1184588554179767e-23
cost at iteration 396 : 8.849131867550297e-24
cost at iteration 397 : 1.1113423037529194e-23
cost at iteration 398 : 8.803761599189697e-24
cost at iteration 399 : 1.1538989202579109e-23
cost at iteration 400 : 9.611612294787951e-24
cost at iteration 401 : 1.1787534527952989e-23
cost at iteration 402 : 9.594425720949521e-24
cost at iteration 403 : 1.112347494957407e-23
cost at iteration 404 : 8.8797588876272e-24
cost at iteration 405 : 1.0847278260501976e-23
cost at iteration 406 : 8.68799827079082e-24
cost at iteration 407 : 1.0819952243738197e-23
cost at iteration 408 : 9.00115496196567e-24
cost at iteration 409 : 1.217263652100493e-23
cost at iteration 410 : 1.005209631763921e-23
cost at iteration 411 : 1.0278620522637284e-23
cost at iteration 412 : 9.729854912634523e-24
cost at iteration 413 : 9.84832096142395e-24
cost at iteration 414 : 9.367378235353493e-24
cost at iteration 415 : 9.693148844060401e-24
cost at iteration 416 : 9.413530580008544e-24
cost at iteration 417 : 9.958806046302313e-24
cost at iteration 418 : 1.0468308903246594e-23
cost at iteration 419 : 1.0049508850492803e-23
cost at iteration 420 : 1.0084493813394402e-23
cost at iteration 421 : 9.561474847668705e-24
cost at iteration 422 : 9.475490303343286e-24
cost at iteration 423 : 9.28213565462408e-24
cost at iteration 424 : 9.27684907176654e-24
cost at iteration 425 : 9.240387048281436e-24
cost at iteration 426 : 9.267921451800175e-24
cost at iteration 427 : 9.727951145469457e-24
cost at iteration 428 : 1.0249376721138063e-23
cost at iteration 429 : 1.0369872308929484e-23
cost at iteration 430 : 9.523533546675596e-24
cost at iteration 431 : 9.85335221409459e-24
cost at iteration 432 : 9.02828881287988e-24
cost at iteration 433 : 9.507435311032132e-24
cost at iteration 434 : 8.850901945676468e-24
cost at iteration 435 : 9.518142635129526e-24
cost at iteration 436 : 8.940502937567454e-24
cost at iteration 437 : 1.0410042183231967e-23
cost at iteration 438 : 9.877561220691362e-24
cost at iteration 439 : 9.796706063640824e-24
cost at iteration 440 : 9.459324632685989e-24
cost at iteration 441 : 9.140008629496881e-24
cost at iteration 442 : 9.109875137664887e-24
cost at iteration 443 : 8.891934811793666e-24
cost at iteration 444 : 9.018184785152216e-24
cost at iteration 445 : 8.845647560173692e-24
cost at iteration 446 : 9.252995120048034e-24
cost at iteration 447 : 9.366765503106952e-24
cost at iteration 448 : 1.0889658790843575e-23
cost at iteration 449 : 8.81982954059847e-24
cost at iteration 450 : 1.0394335202122556e-23
cost at iteration 451 : 8.191621891288014e-24
cost at iteration 452 : 9.998084810755072e-24
cost at iteration 453 : 7.956601180007115e-24
cost at iteration 454 : 9.947590364554791e-24
cost at iteration 455 : 7.929165338873217e-24
cost at iteration 456 : 1.0388648018386802e-23
cost at iteration 457 : 8.793365581329966e-24
cost at iteration 458 : 1.047603336982703e-23
cost at iteration 459 : 8.699002795385282e-24
cost at iteration 460 : 9.919920199766905e-24
cost at iteration 461 : 8.074065083858724e-24
cost at iteration 462 : 9.673918356035558e-24
cost at iteration 463 : 7.904029353194695e-24
cost at iteration 464 : 9.659928870786773e-24
cost at iteration 465 : 8.20474172854623e-24
cost at iteration 466 : 1.0922240834221615e-23
cost at iteration 467 : 9.193304787192984e-24
cost at iteration 468 : 9.267318411834086e-24
cost at iteration 469 : 8.889002175204415e-24
cost at iteration 470 : 8.863925788066045e-24
cost at iteration 471 : 8.554165398428318e-24
cost at iteration 472 : 8.720786048416701e-24
cost at iteration 473 : 8.597773718059375e-24
cost at iteration 474 : 8.937036479159469e-24
cost at iteration 475 : 9.61906857224595e-24
cost at iteration 476 : 9.16047198893715e-24
cost at iteration 477 : 9.192368169826234e-24
cost at iteration 478 : 8.735244895499006e-24
cost at iteration 479 : 8.61396805447497e-24
cost at iteration 480 : 8.472831218061575e-24
cost at iteration 481 : 8.426446343005776e-24
cost at iteration 482 : 8.429331129451515e-24
cost at iteration 483 : 8.422634639018576e-24
cost at iteration 484 : 8.845926955708524e-24
cost at iteration 485 : 9.364460475367885e-24
cost at iteration 486 : 9.546129657294525e-24
cost at iteration 487 : 8.651919841328004e-24
cost at iteration 488 : 9.099201694695545e-24
cost at iteration 489 : 8.176760919791603e-24
cost at iteration 490 : 8.77915257309313e-24
cost at iteration 491 : 8.008031071301174e-24
cost at iteration 492 : 8.78416006378623e-24
cost at iteration 493 : 8.069580422871973e-24
cost at iteration 494 : 9.560811793479299e-24
cost at iteration 495 : 9.09638152201245e-24
cost at iteration 496 : 8.962665641408829e-24
cost at iteration 497 : 8.729308288858472e-24
cost at iteration 498 : 8.368890950482206e-24
cost at iteration 499 : 8.389717995219262e-24
cost at iteration 500 : 8.134553440177243e-24
cost at iteration 501 : 8.294242899287556e-24
cost at iteration 502 : 8.096064216470758e-24
cost at iteration 503 : 8.489027301577814e-24
cost at iteration 504 : 8.56252616740239e-24
cost at iteration 505 : 1.0125908144784628e-23
cost at iteration 506 : 8.053733360299188e-24
cost at iteration 507 : 9.654637466725513e-24
cost at iteration 508 : 7.483855749230533e-24
cost at iteration 509 : 9.276097650609025e-24
cost at iteration 510 : 7.26882045948657e-24
cost at iteration 511 : 9.224103420275905e-24
cost at iteration 512 : 7.246939363886378e-24
cost at iteration 513 : 9.622518348100141e-24
cost at iteration 514 : 8.032251066907866e-24
cost at iteration 515 : 9.820924606210862e-24
cost at iteration 516 : 7.944358595474423e-24
cost at iteration 517 : 9.307184144358581e-24
cost at iteration 518 : 7.340157559726426e-24
cost at iteration 519 : 9.093805480563086e-24
cost at iteration 520 : 7.186284048366969e-24
cost at iteration 521 : 9.10628988184338e-24
cost at iteration 522 : 7.499313944930938e-24
cost at iteration 523 : 1.0502652953026671e-23
cost at iteration 524 : 8.284494932236562e-24
cost at iteration 525 : 8.778557525526417e-24
cost at iteration 526 : 7.991416889484146e-24
cost at iteration 527 : 8.434935332292712e-24
cost at iteration 528 : 7.711211060545261e-24
cost at iteration 529 : 8.329554725990353e-24
cost at iteration 530 : 7.783830188064811e-24
cost at iteration 531 : 8.661221675123929e-24
cost at iteration 532 : 8.82598003888687e-24
cost at iteration 533 : 8.38716355589884e-24
cost at iteration 534 : 8.514522230948288e-24
cost at iteration 535 : 7.976782331703136e-24
cost at iteration 536 : 8.044775354708645e-24
cost at iteration 537 : 7.763421010651188e-24
cost at iteration 538 : 7.903865842864899e-24
cost at iteration 539 : 7.75267138850078e-24
cost at iteration 540 : 7.951408104375933e-24
cost at iteration 541 : 8.382118006085538e-24
cost at iteration 542 : 8.989428443502133e-24
cost at iteration 543 : 8.427460025270022e-24
cost at iteration 544 : 8.423051735682487e-24
cost at iteration 545 : 7.852125526955232e-24
cost at iteration 546 : 8.122174613819842e-24
cost at iteration 547 : 7.600389696054849e-24
cost at iteration 548 : 8.036905637187307e-24
cost at iteration 549 : 7.668179679160321e-24
cost at iteration 550 : 8.329721186876724e-24
cost at iteration 551 : 8.756102683484913e-24
cost at iteration 552 : 8.25715306833963e-24
cost at iteration 553 : 8.36547925953857e-24
cost at iteration 554 : 7.846323777643256e-24
cost at iteration 555 : 7.88178915407565e-24
cost at iteration 556 : 7.619231886550828e-24
cost at iteration 557 : 7.728516971381937e-24
cost at iteration 558 : 7.599456849238223e-24
cost at iteration 559 : 7.761595076961539e-24
cost at iteration 560 : 8.147629559711524e-24
cost at iteration 561 : 8.8343369882489e-24
cost at iteration 562 : 8.280163418444718e-24
cost at iteration 563 : 8.222369823082001e-24
cost at iteration 564 : 7.761500619499465e-24
cost at iteration 565 : 7.903980408658223e-24
cost at iteration 566 : 7.50232501335732e-24
cost at iteration 567 : 7.807290274116686e-24
cost at iteration 568 : 7.552200993504909e-24
cost at iteration 569 : 8.030127036311384e-24
cost at iteration 570 : 8.562193711815275e-24
cost at iteration 571 : 8.208713918000935e-24
cost at iteration 572 : 8.13212013455137e-24
cost at iteration 573 : 7.832376080341146e-24
cost at iteration 574 : 7.615837248992569e-24
cost at iteration 575 : 7.602161106338687e-24
cost at iteration 576 : 7.449349848352815e-24
cost at iteration 577 : 7.564782233268485e-24
cost at iteration 578 : 7.454419382031178e-24
cost at iteration 579 : 7.92945767886818e-24
cost at iteration 580 : 8.36709071164168e-24
cost at iteration 581 : 8.52353523300174e-24
cost at iteration 582 : 7.718521687028212e-24
cost at iteration 583 : 8.138320715563985e-24
cost at iteration 584 : 7.293354999804356e-24
cost at iteration 585 : 7.860783290611785e-24
cost at iteration 586 : 7.145436861287991e-24
cost at iteration 587 : 7.860309291722117e-24
cost at iteration 588 : 7.190928922802719e-24
cost at iteration 589 : 8.492915463330946e-24
cost at iteration 590 : 8.22379968152277e-24
cost at iteration 591 : 7.983147400441006e-24
cost at iteration 592 : 7.88709041208265e-24
cost at iteration 593 : 7.485247555594425e-24
cost at iteration 594 : 7.565417594415449e-24
cost at iteration 595 : 7.274369368103888e-24
cost at iteration 596 : 7.46777939059467e-24
cost at iteration 597 : 7.245646624017625e-24
cost at iteration 598 : 7.615496926722102e-24
cost at iteration 599 : 7.65242208957692e-24
[ ]: