pyuncertainnumber.propagation.performance ========================================= .. py:module:: pyuncertainnumber.propagation.performance Functions --------- .. autoapisummary:: pyuncertainnumber.propagation.performance.func_inspect pyuncertainnumber.propagation.performance.foo_args pyuncertainnumber.propagation.performance.foo_iter pyuncertainnumber.propagation.performance.foo_vec pyuncertainnumber.propagation.performance.foo_universal pyuncertainnumber.propagation.performance.bar pyuncertainnumber.propagation.performance.bar_vec pyuncertainnumber.propagation.performance.bar_universal pyuncertainnumber.propagation.performance.bar_individual pyuncertainnumber.propagation.performance.cb_func pyuncertainnumber.propagation.performance.cb_deflection pyuncertainnumber.propagation.performance.cb_deflection_vectorised pyuncertainnumber.propagation.performance.cb_deflection_separate pyuncertainnumber.propagation.performance.cb_stress Module Contents --------------- .. py:function:: func_inspect() inspect the formatting of the user-defined function .. py:function:: foo_args(x0, x1, x2) func signature with individual inputs (arguments) .. py:function:: foo_iter(x) func signature with iterable input (list, tuple, np.ndarray) .. py:function:: foo_vec(x) func signature with matrix input (2D np.ndarray) .. py:function:: foo_universal(x) a universal signature that takes iterable and matrix inputs but not individual inputs caveat: - this function works with a vector Interval object - but wrong answer with a 2d matrix Interval object due to unclear broadcasting rules .. py:function:: bar(x) a simple 2-dimensional function for testing purposes .. py:function:: bar_vec(x) a simple vectroised 2-dimensional function for testing purposes .. py:function:: bar_universal(x) a universal signature that takes iterable and matrix inputs but not individual inputs caveat: - this function works with a vector Interval object - but wrong answer with a 2d matrix Interval object due to unclear broadcasting rules .. py:function:: bar_individual(x0, x1) a simple 2-dimensional function for testing purposes with individual inputs .. py:function:: cb_func(x) Calculates deflection and stress for a cantilever beam. :param x: Array of input parameters: x[0]: Distance from the neutral axis to the point of interest (m) x[1]: Length of the beam (m) x[2]: Second moment of area (mm^4) x[3]: Applied force (N) x[4]: Young's modulus (MPa) :type x: np.array :returns: np.array([deflection (m), stress (MPa)]) Returns np.array([np.nan, np.nan]) if calculation error occurs. .. py:function:: cb_deflection(x: list[numbers.Number] | numpy.ndarray | pyuncertainnumber.pba.intervals.number.Interval | list[pyuncertainnumber.pba.intervals.number.Interval]) Calculates deflection and stress for a cantilever beam. :param x: Array of input parameters: x[0]: Length of the beam (m) x[1]: Second moment of area (mm^4) x[2]: Applied force (N) x[3]: Young's modulus (MPa) :type x: np.array :returns: deflection (m) Returns np.nan if calculation error occurs. :rtype: float .. py:function:: cb_deflection_vectorised(x: numpy.ndarray | pyuncertainnumber.pba.intervals.number.Interval) Vectorised version for calculating cantilever beam deflection over multiple inputs. :param x: 2D inputs of matrix shape, x.shape = (N, 4) :type x: Interval or np.ndarray .. py:function:: cb_deflection_separate(L, I, F, E) compute the deflection in the cantilever beam example # TODO add typing for UncertainNumber :param L: Length of the beam (m) :type L: UncertainNumber :param I: Second moment of area (mm^4) :param F: Applied force (N) :param E: Young's modulus (MPa) :returns: deflection (m) Returns np.nan if calculation error occurs. :rtype: float .. py:function:: cb_stress(y, L, I, F) to compute bending stress in the cantilever beam example