base module¶
SSBJ base class¶
-
class
gemseo.problems.sobieski.base.SobieskiBase(dtype)[source]¶ Bases:
objectClass defining Sobieski problem and related method to the problem such as disciplines computation, constraints, reference optimum
Constructor
- Parameters
dtype (str) – data type
-
DTYPE_COMPLEX= 'complex128'¶
-
DTYPE_DEFAULT= 'complex128'¶
-
DTYPE_DOUBLE= 'float64'¶
-
static
compute_aero_center(x_1)[source]¶ Compute a wing thickness.
- Parameters
x_1 (numpy array) – local design variables (structure)
- Returns
aerodynamic center
- Return type
numpy array
-
compute_half_span(x_shared)[source]¶ Compute half-span from surface and aspect ratio.
- Parameters
x_shared (numpy array) – global design variables
- Returns
half-span
- Return type
numpy array
-
compute_thickness(x_shared)[source]¶ Compute a wing thickness.
- Parameters
x_shared (numpy array) – global design variables
- Returns
thickness
- Return type
numpy array
-
default_constants()[source]¶ Definition of constants vector constants for Sobieski problem.
- Returns
constant vector
- Return type
numpy array
-
derive_normalize_s(s_ref, s_new)[source]¶ Derivation of normalization of input variables for use of polynomial approximation.
- Parameters
s_ref (numpy array) – vector of initial values of independant variables (5 variables at max)
s_new (numpy array) – vector of current values of independant variables
- Returns
derivatives of normalized value and normalized+centered value
- Return type
numpy array
-
derive_poly_approx(s_ref, s_new, flag, s_bound)[source]¶ Compute the polynomial coefficients to characterize the behavior of certain synthetic variables and function modifiers. Compared to poly_approx, also returns polynomial coeff for linearization
- Parameters
s_ref (numpy array) – vector of initial values of independant variables (5 variables at max)
s_new (numpy array) – vector of current values of independant variables
flag (int) –
indicates functional relationship between variables:
flag = 1: linear >0
flag = 2: nonlinear >0
flag = 3: linear < 0
flag = 4: nonlinear <0
flag = 5: parabolic
s_bound (numpy array) – offset value for normalization
- Returns
poly_value: value of synthetic variable or modifier
- Return type
numpy array
-
classmethod
get_bounds_by_name(variables_names)[source]¶ Return bounds of design variables and coupling variables.
- Parameters
variables_names (str or list(str)) – names of variables
- Returns
lower bound and upper bound
-
get_default_x0()[source]¶ Return a default initial value for design variables.
- Returns
initial design variables
- Return type
numpy array
warning: ##DO NOT CHANGE VALUE: THEY ARE USED FOR POLYNOMIAL APPROXIMATION ##
-
get_initial_values()[source]¶ Get initial values used by polynomial functions.
- Returns
initial values
- Return type
tuple(ndarray)
-
classmethod
get_sobieski_bounds()[source]¶ Set the input design bounds and return them as 2 numpy arrays.
- Returns
upper and lower bounds
- Return type
numpy array, numpy array
-
static
get_sobieski_bounds_tuple()[source]¶ Set the input design bounds and return them as a tuple of tuples.
- Returns
Subtuple is build with lower bound and upper bound.
- Return type
tuple(tuple)
-
poly_approx(s_ref, s_new, flag, s_bound)[source]¶ This function calculates polynomial coefficients to characterize the behavior of certain synthetic variables and function modifiers.
- Parameters
s_ref (numpy array) – vector of initial values of independant variables (5 variables at max)
s_new (numpy array) – vector of current values of independant variables
flag (int) –
indicates functional relationship between variables:
flag = 1: linear >0
flag = 2: nonlinear >0
flag = 3: linear < 0
flag = 4: nonlinear <0
flag = 5: parabolic
s_bound (numpy array) – offset value for normalization
- Returns
poly_value: value of synthetic variable or modifier
- Return type
numpy array