base module¶
SSBJ base class¶
Classes:
|
Class defining Sobieski problem and related method to the problem such as disciplines computation, constraints, reference optimum. |
- class gemseo.problems.sobieski.base.SobieskiBase(dtype)[source]¶
Bases:
object
Class defining Sobieski problem and related method to the problem such as disciplines computation, constraints, reference optimum.
Constructor.
- Parameters
dtype (str) – data type
Attributes:
Methods:
compute_aero_center
(x_1)Computes the aerodynamic center.
compute_half_span
(x_shared)Compute half-span from surface and aspect ratio.
compute_thickness
(x_shared)Compute a wing thickness.
Definition of constants vector constants for Sobieski problem.
derive_normalize_s
(s_ref, s_new)Derivation of normalization of input variables for use of polynomial approximation.
derive_poly_approx
(s_ref, s_new, flag, s_bound)Compute the polynomial coefficients to characterize the behavior of certain synthetic variables and function modifiers.
get_bounds_by_name
(variables_names)Return bounds of design variables and coupling variables.
Return a default initial value for design variables.
Get initial values used by polynomial functions.
Set the input design bounds and return them as 2 numpy arrays.
Set the input design bounds and return them as a tuple of tuples.
poly_approx
(s_ref, s_new, flag, s_bound)This function calculates polynomial coefficients to characterize the behavior of certain synthetic variables and function modifiers.
- DTYPE_COMPLEX = 'complex128'¶
- DTYPE_DEFAULT = 'complex128'¶
- DTYPE_DOUBLE = 'float64'¶
- static compute_aero_center(x_1)[source]¶
Computes the aerodynamic center.
- 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 independent variables (5 variables at max)
s_new (numpy array) – vector of current values of independent 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 independent variables (5 variables at max)
s_new (numpy array) – vector of current values of independent 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 independent variables (5 variables at max)
s_new (numpy array) – vector of current values of independent 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