pyuncertainnumber.propagation.performance¶
Functions¶
inspect the formatting of the user-defined function |
|
|
func signature with individual inputs (arguments) |
|
func signature with iterable input (list, tuple, np.ndarray) |
|
func signature with matrix input (2D np.ndarray) |
a universal signature that takes iterable and matrix inputs but not individual inputs |
|
|
a simple 2-dimensional function for testing purposes |
|
a simple vectroised 2-dimensional function for testing purposes |
a universal signature that takes iterable and matrix inputs but not individual inputs |
|
|
a simple 2-dimensional function for testing purposes with individual inputs |
|
Calculates deflection and stress for a cantilever beam. |
Calculates deflection and stress for a cantilever beam. |
|
Vectorised version for calculating cantilever beam deflection over multiple inputs. |
|
|
compute the deflection in the cantilever beam example |
|
to compute bending stress in the cantilever beam example |
Module Contents¶
- pyuncertainnumber.propagation.performance.func_inspect()¶
inspect the formatting of the user-defined function
- pyuncertainnumber.propagation.performance.foo_args(x0, x1, x2)¶
func signature with individual inputs (arguments)
- pyuncertainnumber.propagation.performance.foo_iter(x)¶
func signature with iterable input (list, tuple, np.ndarray)
- pyuncertainnumber.propagation.performance.foo_vec(x)¶
func signature with matrix input (2D np.ndarray)
- pyuncertainnumber.propagation.performance.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
- pyuncertainnumber.propagation.performance.bar(x)¶
a simple 2-dimensional function for testing purposes
- pyuncertainnumber.propagation.performance.bar_vec(x)¶
a simple vectroised 2-dimensional function for testing purposes
- pyuncertainnumber.propagation.performance.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
- pyuncertainnumber.propagation.performance.bar_individual(x0, x1)¶
a simple 2-dimensional function for testing purposes with individual inputs
- pyuncertainnumber.propagation.performance.cb_func(x)¶
Calculates deflection and stress for a cantilever beam.
- Parameters:
x (np.array) – 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)
- Returns:
- np.array([deflection (m), stress (MPa)])
Returns np.array([np.nan, np.nan]) if calculation error occurs.
- pyuncertainnumber.propagation.performance.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.
- Parameters:
x (np.array) – 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)
- Returns:
- deflection (m)
Returns np.nan if calculation error occurs.
- Return type:
float
- pyuncertainnumber.propagation.performance.cb_deflection_vectorised(x: numpy.ndarray | pyuncertainnumber.pba.intervals.number.Interval)¶
Vectorised version for calculating cantilever beam deflection over multiple inputs.
- Parameters:
x (Interval or np.ndarray) – 2D inputs of matrix shape, x.shape = (N, 4)
- pyuncertainnumber.propagation.performance.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.
- Return type:
float
- pyuncertainnumber.propagation.performance.cb_stress(y, L, I, F)¶
to compute bending stress in the cantilever beam example