function.forr08a.aerofoilcd

function.forr08a.aerofoilcd(X)

Computes the drag coefficient (cd) of an aerofoil based on the shape parameter X.

This function reads the drag coefficient data from the “cd_data.csv” file and uses the input X (rounded to the nearest 0.01) to return the corresponding drag coefficients.

Parameters

Name Type Description Default
X np.ndarray A 1D NumPy array of values in the range [0, 1] representing the shape parameters. required

Returns

Name Type Description
np.ndarray np.ndarray: A 1D NumPy array of drag coefficients (cd) corresponding to the input X.

Raises

Name Type Description
ValueError If any value in X is outside the range [0, 1].

Examples

>>> from spotpython.surrogate.functions.forr08a import aerofoilcd
>>> X = np.array([0.5, 0.75])
>>> aerofoilcd(X)
array([0.029975, 0.033375])