def adjointSystem(self, dq): rg, N, T = self.getSimData() if self.noJ: if self.unconstrained: ealpha, ex, ez = kernelMatrix_fort.adjointsystem_unconstrained( \ self.dt, self.sfactor, self.kvs, self.kvo, \ self.khs, self.kho, \ self.alpha, self.xt, self.m, self.z, \ dq[0], dq[1], self.num_times, rg.num_nodes) else: ealpha, ex = kernelMatrix_fort.adjointsystem_noj( \ self.dt, self.sfactor, self.kvs, self.kvo, \ self.khs, self.kho, \ self.alpha, self.xt, self.m, self.z, \ dq[0], dq[1], self.num_times, rg.num_nodes) else: ealpha, ex = kernelMatrix_fort.adjointsystem( \ self.dt, self.sfactor, self.kvs, self.kvo, \ self.khs, self.kho, \ self.alpha, self.xt, self.m, self.z, self.J, \ dq[0], dq[1], dq[2], self.num_times, rg.num_nodes) #if self.spline_interp: if False: si = SplineInterp(rg, self.KH, ealpha) ge = si.minimize() else: ge = ealpha if self.unconstrained: return ge, ex, ez*self.z0weight else: return ge, ex
def adjointSystem(self, dx, dm, dJ): rg, N, T = self.getSimData() ealpha, ex = kernelMatrix_fort.adjointsystem( \ self.dt, self.sfactor, self.kvs, self.kvo, \ self.khs, self.kho, \ self.alpha, self.xt, self.m, self.z, self.J, \ dx, dm, dJ, self.num_times, rg.num_nodes) if self.spline_interp: si = SplineInterp(rg, self.KH, ealpha[:,0]) ge = si.minimize() else: ge = ealpha return ge, ex