def Area(self): r""" Gets the Area :math:`A` of the PBEAML. .. math:: A = \int \, A(x) dx .. note:: a spline is fit to :math:`A(x)` and then integrated. """ Areas = [] for dim in self.dim: Areas.append(_bar_areaL('PBEAML', self.Type, dim)) A = integrate_line(self.xxb, Areas) return A
def Area(self): r""" Gets the Area :math:`A` of the PBEAML. .. math:: A = \int \, A(x) dx .. note:: a spline is fit to :math:`A(x)` and then integrated. """ areas = [] for dim in self.dim: areas.append(_bar_areaL('PBEAML', self.Type, dim)) try: A = integrate_line(self.xxb, areas) except ValueError: print('PBEAML integration error; pid=%s x/xb=%s areas=%s' % (self.pid, self.xxb, areas)) A = mean(areas) return A
def MassPerLength(self): r""" Gets the mass per length :math:`\frac{m}{L}` of the PBEAML. .. math:: \frac{m}{L} = A(x) \rho + nsm .. math:: \frac{m}{L} = nsm L + \rho \int \, A(x) dx """ rho = self.Rho() massPerLs = [] for (dim, nsm) in zip(self.dim, self.nsm): a = _bar_areaL('PBEAML', self.Type, dim) try: massPerLs.append(a * rho + nsm) except: msg = "PBEAML a*rho+nsm a=%s rho=%s nsm=%s" % (a, rho, nsm) raise RuntimeError(msg) massPerL = integrate_positive_line(self.xxb, massPerLs) return massPerL