def set_table(self, n=100, dx=None):
r'''Method to set an interpolation table of liquids levels versus
volumes in the tank, for a fully defined tank. Normally run by the
h_from_V method, this may be run prior to its use with a custom
specification. Either the number of points on the table, or the
vertical distance between steps may be specified.
Parameters
----------
n : float, optional
Number of points in the interpolation table, [-]
dx : float, optional
Vertical distance between steps in the interpolation table, [m]
'''
if dx:
self.heights = np.linspace(0, self.h_max, int(self.h_max/dx)+1)
else:
self.heights = np.linspace(0, self.h_max, n)
self.volumes = [self.V_from_h(h) for h in self.heights]
self.interp_h_from_V = InterpolatedUnivariateSpline(self.volumes, self.heights, ext=3)
self.table = True
评论列表
文章目录