cape.attdb.dbll: Aerodynamic line load datakits¶
This module provides customizations of cape.attdb.rdb that are
especially useful for launch vehicle line load databases. The
force & moment coefficient names follow common missile naming
conventions:
Name
Symbol
Description
CA
\(C_A\)
Axial force
CY
\(C_Y\)
Side force
CN
\(C_N\)
Normal force
CLL
\(C_\ell\)
Rolling moment
CLM
\(C_m\)
Pitching moment
CLN
\(C_n\)
Yawing moment
Line loads are typically defined for the force coefficients, and the standard for these is to have dCN as a column name, which actually represents the value
\[\frac{\Delta C_N}{\Delta x/L_\mathit{ref}\]
In the limit of finer slices, this becomes \(\mathrm{d}C_N/\mathrm{d}x/L_\mathit{ref}\). In other words, the primary data is the derivative of a force coefficient with respect to the non-dimensional x-coordinate.
- class cape.attdb.dbll.DBLL(fname=None, **kw)¶
Database class for launch vehicle line loads
- Call:
>>> db = dbll.DBLL(fname=None, **kw)
- Inputs:
- fname: {
None} |str File name; extension is used to guess data format
- csv: {
None} |str Explicit file name for
CSVFileread- textdata: {
None} |str Explicit file name for
TextDataFile- simplecsv: {
None} |str Explicit file name for
CSVSimple- xls: {
None} |str File name for
XLSFile- mat: {
None} |str File name for
MATFile
- fname: {
- Outputs:
- db:
cape.attdb.dbfm.DBFM LV force & moment database
- db:
- Versions:
2020-05-19
@ddalle: First version
- create_dclm(col, xcol=None, ocol=None, **kw)¶
Create a dCLM line load based on dCN line load
- Call:
>>> v = db.create_dclm(col, xcol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- create_dcln(col, xcol=None, ocol=None, **kw)¶
Create a dCLN line load based on dCY line load
- Call:
>>> v = db.create_dcln(col, xcol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- create_ll3x_aweights(comps, scol=None, **kw)¶
Calculate and save each component’s adjustment weight
- Call:
>>> w = db.create_ll3x_aweights(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comp:
str Single component (trivial output)
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]
- db:
- Outputs:
- w:
dict[dict[np.ndarray]] Adjustment weight for each comp and each coeff caused by integral coeff change; for example
"wCN.CLL"is shift to a comp’s CN as a result of overall CLL shift
- w:
- Versions:
2020-06-18
@ddalle: First version2020-06-19
@ddalle: Weights same size of bkpts
- create_ll3x_basis(comps, scol=None, **kw)¶
Calculate and save SVD-based basis for LL3X adjustments
This is a highly customized function (hence the somewhat obscure name) that adjusts three line load force cols that are a function of x. It adjusts for five scenarios:
Adjust the dCA load such that integrated CA is increased by
1.0Adjust dCY such that CY increases
1.0and CLN is unchangedAdjust dCY such that CY is unchanged and CLN increases
1.0Adjust dCN such that CN increases
1.0and CLM is unchangedAdjust dCN such that CN is unchanged and CLM increases
1.0
- Call:
>>> basis = db.create_ll3x_basis(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3
(col1, col2, col3)
List/tuple of column names for CA, CY, and CN line loads
- scol: {
None} |str Name of slice col; calculate basis for each value in db.bkpts[scol]
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- CompLLCols:
dict[dict] Line load column names to use for each comp
- CompLLBasisCols:
dict[dict] Names to use when saving adjustment bases
- db:
- Outputs:
- basis:
dict Basis adjustment loads for five scenarios
- basis[“s”]:
np.ndarray|None Unique values of scol
- basis[comp][“dCA.CA”]:
np.ndarray Delta dCA load to adjust CA by
1.0- basis[comp][“dCY.CY”]:
np.ndarray Delta dCY load to adjust CY by
1.0- basis[comp][“dCY.CLN”]:
np.ndarray Delta dCY load to adjust CLN by
1.0- basis[comp][“dCN.CN”]:
np.ndarray Delta dCN load to adjust CN by
1.0- basis[comp][“dCN.CLM”]:
np.ndarray Delta dCN load to adjust CLM by
1.0
- basis:
- Versions:
2020-06-19
@ddalle: Version 1.0
- create_ll3x_comp_integrals(cols, **kw)¶
Integrate 3 or 6 line load columns
- Call:
>>> fm = db.create_ll3x_comp_integrals(cols, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3 | 6
List/tuple of column names for CA, CY, and CN [, CLL, CLM, CLN] line loads
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- fm:
dict[np.ndarray] Integrated force/moment for each coefficient
- fm[“CA”]:
np.ndarray Integrated cols[0]
- fm[“CY”]:
np.ndarray Integrated cols[1]
- fm[“CN”]:
np.ndarray Integrated cols[2]
- fm[“CLL”]:
np.ndarray Integrated cols[3] or rolling moment induced by CY and CN
- fm[“CLM”]:
np.ndarray Integrated cols[4] or pitching moment integrated from cols[2] plus what’s induced by CA
- fm[“CLN”]:
np.ndarray Integrated cols54] or pitching moment integrated from cols[1] plus what’s induced by CA
- fm:
- Versions:
2020-06-12
@ddalle: First version
- create_ll3x_fractions(comps, scol=None, **kw)¶
Calculate each component’s contribution to integral forces
- Call:
>>> f = db.create_ll3x_fractions(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comp:
str Single component (trivial output)
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]
- db:
- Outputs:
- f:
dict[dict[np.ndarray]] Fraction for each comp and each coeff
- f:
- Versions:
2020-06-16
@ddalle: First version2020-06-19
@ddalle: Weights same size of bkpts
- create_ll3x_integrals(comps, **kw)¶
Integrate line loads for several columns
- Call:
>>> fm = db.create_ll3x_integrals(comps, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3 | 6
List/tuple of column names for CA, CY, and CN [, CLL, CLM, CLN] line loads
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- fm:
dict[np.ndarray] Integrated force/moment for each coefficient
- fm[comp][coeff]:
np.ndarray Integrated coeff from line load for comp comp
- fm:
- Versions:
2020-06-15
@ddalle: First version
- create_ll_combo(col, cols, x, **kw)¶
Combine line loads from several components
This method can be used to combine several line loads with disparate x-coordinates, and point loads can also be injected into the combined line load. All cols must have an xcol specified. For existing line loads, a suitable default is often available via
get_output_xargs(), but injected point loads must have an xcol specified. The user may specify xcol as either a column name or a directly defined value. For point loads, this xcol may be just a number.- Call:
>>> v = db.create_ll_combo(col, cols, x, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name with which to save result
- cols:
list[str] List of load columns to combine
- x:
np.ndarray[float] ndim: 1 | 2
shape: (nx,) | (nx, ncase)
Array of x-coordinates for output
- mask: {
None} |np.ndarray Mask of which cases to include
- xcols:
dict[str|np.ndarray] Descriptor for what x coordinates to use for each col in cols; if
str, use it as a col name; ifnp.ndarray, use as directly defined coords; defaults todb.get_output_xargs(col)
- db:
- Outputs:
- v:
np.ndarray[float] ndim: 2
shape: (nx, ncase)
Combined loads
- v:
- Versions:
2020-06-10
@ddalle: First version
- create_ll_moment(col, ax1, ax2, ocol=None, **kw)¶
Create a moment line load based on a force line load
- Call:
>>> v = db.create_ll_moment(col, ax1, ax2, ocol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- ax1:
0|1|2|"x"|"y"|"z" Force axis direction
- ax2:
0|1|2|"x"|"y"|"z" Moment axis direction
- ocol: {
None} |str Name of col in which to store output; default is col plus
"_M%s_d%s" % (ax2, ax1)- xcol: {
None} |str Name of column to use as x-coords for moment arm
- ycol: {
None} |str Name of column to use as y-coords for moment arm
- zcol: {
None} |str Name of column to use as z-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- y: {
None} |np.ndarray Explicit y-coords for moment arm
- z: {
None} |np.ndarray Explicit z-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- yMRP: {
DB.yMRP} |float Moment reference point y-coordinate
- zMRP: {
DB.yMRP} |float Moment reference point z-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- genr8_dclm(col, xcol=None, **kw)¶
Create a dCLM line load based on dCN line load
- Call:
>>> v = db.genr8_dclm(col, xcol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- genr8_dcln(col, xcol=None, **kw)¶
Create a dCLN line load based on dCY line load
- Call:
>>> v = db.genr8_dcln(col, xcol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- genr8_ll3x_aweights(comps, scol=None, **kw)¶
Calculate each component’s adjustment weight
- Call:
>>> w = db.genr8_ll3x_aweights(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]- CompY:
dict[float] y-coordinate at which comp loads are applied
- CompZ:
dict[float] z-coordinate at which comp loads are applied
- db:
- Outputs:
- w:
dict[dict[np.ndarray]] Adjustment weight for each comp and each coeff caused by integral coeff change; for example
"wCN.CLL"is shift to a comp’s CN as a result of overall CLL shift
- w:
- Versions:
2020-06-18
@ddalle: First version2020-06-19
@ddalle: Weights same size of bkpts
- genr8_ll3x_basis(comps, scol=None, **kw)¶
Calculate SVD-based basis for adjusting line loads
This is a highly customized function (hence the somewhat obscure name) that adjusts three line load force cols that are a function of x. It adjusts for five scenarios:
Adjust the dCA load such that integrated CA is increased by
1.0Adjust dCY such that CY increases
1.0and CLN is unchangedAdjust dCY such that CY is unchanged and CLN increases
1.0Adjust dCN such that CN increases
1.0and CLM is unchangedAdjust dCN such that CN is unchanged and CLM increases
1.0
- Call:
>>> basis = db.genr8_ll3x_basis(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3
(col1, col2, col3)
List/tuple of column names for CA, CY, and CN line loads
- scol: {
None} |str Name of slice col; calculate basis for each value in db.bkpts[scol]
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- CompLLCols:
dict[dict] Line load column names to use for each comp
- db:
- Outputs:
- basis:
dict Basis adjustment loads for five scenarios
- basis[“s”]:
np.ndarray|None Unique values of scol
- basis[comp][“dCA.CA”]:
np.ndarray Delta dCA load to adjust CA by
1.0- basis[comp][“dCY.CY”]:
np.ndarray Delta dCY load to adjust CY by
1.0- basis[comp][“dCY.CLN”]:
np.ndarray Delta dCY load to adjust CLN by
1.0- basis[comp][“dCN.CN”]:
np.ndarray Delta dCN load to adjust CN by
1.0- basis[comp][“dCN.CLM”]:
np.ndarray Delta dCN load to adjust CLM by
1.0
- basis:
- Versions:
2020-06-04
@ddalle: Version 1.02020-06-19
@ddalle: Version 2.0
- genr8_ll3x_comp_basis(cols, scol=None, **kw)¶
Calculate SVD-based basis for adjusting line loads
This is a highly customized function (hence the somewhat obscure name) that adjusts three line load force cols that are a function of x. It adjusts for five scenarios:
Adjust the dCA load such that integrated CA is increased by
1.0Adjust dCY such that CY increases
1.0and CLN is unchangedAdjust dCY such that CY is unchanged and CLN increases
1.0Adjust dCN such that CN increases
1.0and CLM is unchangedAdjust dCN such that CN is unchanged and CLM increases
1.0
- Call:
>>> basis = db.genr8_ll3x_comp_basis(cols, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3
(col1, col2, col3)
List/tuple of column names for CA, CY, and CN line loads
- scol: {
None} |str Name of slice col; calculate basis for each value in db.bkpts[scol]
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- basis:
dict Basis adjustment loads for five scenarios
- basis[“s”]:
np.ndarray|None Unique values of scol
- basis[“dCA.CA”]:
np.ndarray Delta dCA load to adjust CA by
1.0- basis[“dCY.CY”]:
np.ndarray Delta dCY load to adjust CY by
1.0- basis[“dCY.CLN”]:
np.ndarray Delta dCY load to adjust CLN by
1.0- basis[“dCN.CN”]:
np.ndarray Delta dCN load to adjust CN by
1.0- basis[“dCN.CLM”]:
np.ndarray Delta dCN load to adjust CLM by
1.0
- basis:
- Versions:
2020-06-04
@ddalle: Version 1.02020-06-19
@ddalle: Version 2.0
- genr8_ll3x_comp_integrals(cols, **kw)¶
Integrate 3 or 6 line load columns
- Call:
>>> fm = db.genr8_ll3x_comp_integrals(cols, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3 | 6
List/tuple of column names for CA, CY, and CN [, CLL, CLM, CLN] line loads
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- fm:
dict[np.ndarray] Integrated force/moment for each coefficient
- fm[“CA”]:
np.ndarray Integrated cols[0]
- fm[“CY”]:
np.ndarray Integrated cols[1]
- fm[“CN”]:
np.ndarray Integrated cols[2]
- fm[“CLL”]:
np.ndarray Integrated cols[3] or rolling moment induced by CY and CN
- fm[“CLM”]:
np.ndarray Integrated cols[4] or pitching moment integrated from cols[2] plus what’s induced by CA
- fm[“CLN”]:
np.ndarray Integrated cols54] or pitching moment integrated from cols[1] plus what’s induced by CA
- fm:
- Versions:
2020-06-11
@ddalle: First version
- genr8_ll3x_fractions(comps, scol=None, **kw)¶
Calculate each component’s contribution to integral forces
- Call:
>>> f = db.genr8_ll3x_fractions(comp, scol=None, **kw) >>> f = db.genr8_ll3x_fractions(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comp:
str Single component (trivial output)
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]
- db:
- Outputs:
- f:
dict[dict[np.ndarray]] Fraction for each comp and each coeff
- f[comp][coeff]:
float|np.ndarray Average contribution of comp to coeff for each value of scol
- f[“s”]:
None|np.ndarray Unique values of scol
- f:
- Versions:
2020-06-12
@ddalle: First version2020-06-19
@ddalle: Weights same size of bkpts
- genr8_ll3x_integrals(comps, **kw)¶
Integrate line load columns for several components
- Call:
>>> fm = db.genr8_ll3x_integrals(comps, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comps:
list[str] List of components to integrate
- CompLLCols:
dict[list] Optional lists of line load cols for each comp in comps; default is
"<comp>.d<coeff>"- cols:
list[str] len: 3 | 6
List/tuple of column names for CA, CY, and CN [, CLL, CLM, CLN] line loads
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- fm:
dict[np.ndarray] Integrated force/moment for each coefficient
- fm[comp][coeff]:
np.ndarray Integrated coeff from line load for comp comp
- fm:
- Versions:
2020-06-15
@ddalle: First version
- genr8_ll_combo(cols, x, **kw)¶
Combine line loads from several components
This method can be used to combine several line loads with disparate x-coordinates, and point loads can also be injected into the combined line load. All cols must have an xcol specified. For existing line loads, a suitable default is often available via
get_output_xargs(), but injected point loads must have an xcol specified. The user may specify xcol as either a column name or a directly defined value. For point loads, this xcol may be just a number.- Call:
>>> v = db.genr8_ll_combo(cols, x, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] List of load columns to combine
- x:
np.ndarray[float] ndim: 1 | 2
shape: (nx,) | (nx, ncase)
Array of x-coordinates for output
- mask: {
None} |np.ndarray Mask of which cases to include
- xcols:
dict[str|np.ndarray] Descriptor for what x coordinates to use for each col in cols; if
str, use it as a col name; ifnp.ndarray, use as directly defined coords; defaults todb.get_output_xargs(col)
- db:
- Outputs:
- v:
np.ndarray[float] ndim: 2
shape: (nx, ncase)
Combined loads
- v:
- Versions:
2020-06-09
@ddalle: First version
- genr8_ll_moment(col, ax1, ax2, **kw)¶
Create a moment line load based on a force line load
- Call:
>>> v = db.genr8_ll_moment(col, ax1, ax2, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- ax1:
0|1|2|"x"|"y"|"z" Force axis direction
- ax2:
0|1|2|"x"|"y"|"z" Moment axis direction
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- ycol: {
None} |str Name of column to use as y-coords for moment arm
- zcol: {
None} |str Name of column to use as z-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- y: {
None} |np.ndarray Explicit y-coords for moment arm
- z: {
None} |np.ndarray Explicit z-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- x: {
None} |np.ndarray Optional 1D or 2D x-coordinates directly specified
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- make_dclm(col, xcol=None, ocol=None, **kw)¶
Create a dCLM line load from dCN if not present
- Call:
>>> v = db.make_dclm(col, xcol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- make_dcln(col, xcol=None, ocol=None, **kw)¶
Create a dCLN line load from dCY if not present
- Call:
>>> v = db.make_dcln(col, xcol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- xcol: {
None} |str Name of column to use as x-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version
- make_ll3x_adjustments(comps, db2, scol=None, **kw)¶
Retrieve [and calculate] adjusted line loads
- Call:
>>> lla = db.make_ll3x_adjustments(comps, db2, scol, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- db2:
cape.attdb.rdb.DataKit Target database with analysis tools
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- SourceCols:
dict[str] Cols in db to use as comparison to db2 for
"CA","CY", etc.- TargetCols:
dict[str] Cols in db2 to use as targets for
"CA", etc.- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]- CompLLCols:
dict[dict] Cols to use as line loads for
"CA","CY","CN"for each comp
- db:
- Outputs:
- lla:
dict[dict[np.ndarray]] Adjustment weight for each comp and each coeff caused by integral coeff change; for example
"wCN.CLL"is shift to a comp’s CN as a result of overall CLL shift
- lla:
- Versions:
2020-06-23
@ddalle: Version 1.0
- make_ll3x_aweights(comps, scol=None, **kw)¶
Retrieve [and calculate] each component’s adjustment weight
- Call:
>>> w = db.make_ll3x_aweights(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comp:
str Single component (trivial output)
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]
- db:
- Outputs:
- w:
dict[dict[np.ndarray]] Adjustment weight for each comp and each coeff caused by integral coeff change; for example
"wCN.CLL"is shift to a comp’s CN as a result of overall CLL shift
- w:
- Versions:
2020-06-19
@ddalle: First version
- make_ll3x_basis(comps, scol=None, **kw)¶
Get [and calculate] SVD-based basis for LL3X adjustments
This is a highly customized function (hence the somewhat obscure name) that adjusts three line load force cols that are a function of x. It adjusts for five scenarios:
Adjust the dCA load such that integrated CA is increased by
1.0Adjust dCY such that CY increases
1.0and CLN is unchangedAdjust dCY such that CY is unchanged and CLN increases
1.0Adjust dCN such that CN increases
1.0and CLM is unchangedAdjust dCN such that CN is unchanged and CLM increases
1.0
- Call:
>>> basis = db.make_ll3x_basis(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3
(col1, col2, col3)
List/tuple of column names for CA, CY, and CN line loads
- scol: {
None} |str Name of slice col; calculate basis for each value in db.bkpts[scol]
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- CompLLCols:
dict[dict] Line load column names to use for each comp
- CompLLBasisCols:
dict[dict] Names to use when saving adjustment bases
- db:
- Outputs:
- basis:
dict Basis adjustment loads for five scenarios
- basis[“s”]:
np.ndarray|None Unique values of scol
- basis[comp][“dCA.CA”]:
np.ndarray Delta dCA load to adjust CA by
1.0- basis[comp][“dCY.CY”]:
np.ndarray Delta dCY load to adjust CY by
1.0- basis[comp][“dCY.CLN”]:
np.ndarray Delta dCY load to adjust CLN by
1.0- basis[comp][“dCN.CN”]:
np.ndarray Delta dCN load to adjust CN by
1.0- basis[comp][“dCN.CLM”]:
np.ndarray Delta dCN load to adjust CLM by
1.0
- basis:
- Versions:
2020-06-19
@ddalle: Version 1.0
- make_ll3x_comp_integrals(cols, **kw)¶
Integrate 3 or 6 line load columns
- Call:
>>> fm = db.make_ll3x_comp_integrals(cols, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3 | 6
List/tuple of column names for CA, CY, and CN [, CLL, CLM, CLN] line loads
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- fm:
dict[np.ndarray] Integrated force/moment for each coefficient
- fm[“CA”]:
np.ndarray Integrated cols[0]
- fm[“CY”]:
np.ndarray Integrated cols[1]
- fm[“CN”]:
np.ndarray Integrated cols[2]
- fm[“CLL”]:
np.ndarray Integrated cols[3] or rolling moment induced by CY and CN
- fm[“CLM”]:
np.ndarray Integrated cols[4] or pitching moment integrated from cols[2] plus what’s induced by CA
- fm[“CLN”]:
np.ndarray Integrated cols54] or pitching moment integrated from cols[1] plus what’s induced by CA
- fm:
- Versions:
2020-06-12
@ddalle: First version
- make_ll3x_fractions(comps, scol=None, **kw)¶
Calculate each component’s contribution to integral forces
- Call:
>>> f = db.make_ll3x_fractions(comps, scol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- comp:
str Single component (trivial output)
- comps:
list[str] List of components to divide integral F&M
- scol: {
None} |str Column used to slice database; output will be constant on each slice
- CompFMCols:
dict[dict] Columns to use as integral of force and moment on each comp. Defaults filled in by comp.*coeff* for coeff in
["CA", "CY", "CN", "CLL", "CLM", "CLN"]
- db:
- Outputs:
- f:
dict[dict[np.ndarray]] Fraction for each comp and each coeff
- f:
- Versions:
2020-06-16
@ddalle: First version2020-06-19
@ddalle: Weights same size of bkpts
- make_ll3x_integrals(comps, **kw)¶
Integrate line loads for several columns
For each comp, new loads are only integrated if any one of the six coefficients are missing for that component.
- Call:
>>> fm = db.make_ll3x_integrals(comps, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- cols:
list[str] len: 3 | 6
List/tuple of column names for CA, CY, and CN [, CLL, CLM, CLN] line loads
- nPOD: {
10} |None|int> 0 Number of POD/SVD modes to use during optimization
- mask: {
None} |np.ndarray Mask or indices of which cases to include in POD calculation
- method: {
"trapz"} |"left"| callable Integration method used to integrate columns
- db:
- Outputs:
- fm:
dict[np.ndarray] Integrated force/moment for each coefficient
- fm[comp][coeff]:
np.ndarray Integrated coeff from line load for comp comp
- fm:
- Versions:
2020-06-15
@ddalle: First version
- make_ll_combo(col, cols, x, **kw)¶
Combine line loads from several components
This method can be used to combine several line loads with disparate x-coordinates, and point loads can also be injected into the combined line load. All cols must have an xcol specified. For existing line loads, a suitable default is often available via
get_output_xargs(), but injected point loads must have an xcol specified. The user may specify xcol as either a column name or a directly defined value. For point loads, this xcol may be just a number.This method does not combine the loads if col is already present in the database.
- Call:
>>> v = db.make_ll_combo(col, cols, x, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name with which to save result
- cols:
list[str] List of load columns to combine
- x:
np.ndarray[float] ndim: 1 | 2
shape: (nx,) | (nx, ncase)
Array of x-coordinates for output
- mask: {
None} |np.ndarray Mask of which cases to include
- xcols:
dict[str|np.ndarray] Descriptor for what x coordinates to use for each col in cols; if
str, use it as a col name; ifnp.ndarray, use as directly defined coords; defaults todb.get_output_xargs(col)
- db:
- Outputs:
- v:
np.ndarray[float] ndim: 2
shape: (nx, ncase)
Combined loads
- v:
- Versions:
2020-06-10
@ddalle: First version
- make_ll_moment(col, ax1, ax2, ocol=None, **kw)¶
Make a moment line load based on a force line load
- Call:
>>> v = db.make_ll_moment(col, ax1, ax2, ocol=None, **kw)
- Inputs:
- db:
cape.attdb.rdb.DataKit Database with analysis tools
- col:
str Name of data column to integrate
- ax1:
0|1|2|"x"|"y"|"z" Force axis direction
- ax2:
0|1|2|"x"|"y"|"z" Moment axis direction
- ocol: {
None} |str Name of col in which to store output; default is col plus
"_M%s_d%s" % (ax2, ax1)- xcol: {
None} |str Name of column to use as x-coords for moment arm
- ycol: {
None} |str Name of column to use as y-coords for moment arm
- zcol: {
None} |str Name of column to use as z-coords for moment arm
- x: {
None} |np.ndarray Explicit x-coords for moment arm
- y: {
None} |np.ndarray Explicit y-coords for moment arm
- z: {
None} |np.ndarray Explicit z-coords for moment arm
- mask:
np.ndarray[bool|int] Mask or indices of which cases to integrate
- xMRP: {
DB.xMRP} |float Moment reference point x-coordinate
- yMRP: {
DB.yMRP} |float Moment reference point y-coordinate
- zMRP: {
DB.yMRP} |float Moment reference point z-coordinate
- Lref: {
DB.Lref} |float Reference length for scaling moment (use
1.0for dimensional moment loads)
- db:
- Outputs:
- v:
np.ndarray 2D array of moments derived from db[col]
- v:
- Versions:
2020-06-04
@ddalle: First version