hydesign.utils

Classes

hybridization_shifted

Class to inherit from when all output variables are explicit.

Functions

get_weights(grid, xtgt, maxorder)

Populates weights for finite difference formulas for derivatives of various orders.

sample_mean(outs)

Module Contents

hydesign.utils.get_weights(grid, xtgt, maxorder)[source]

Populates weights for finite difference formulas for derivatives of various orders.

Parameters:
  • grid (array-like) – Target x value where derivatives are approximated

  • xtgt (int) – Array of x values

  • maxorder (int) – Maximum order of derivative

  • Returns

  • c (array-like) – Array of weights

  • @article{fornberg_generation_1988 – title={Generation of finite difference formulas on arbitrarily spaced grids}, author={Fornberg, Bengt}, journal={Mathematics of computation}, volume={51}, number={184}, pages={699–706}, year={1988} doi={10.1090/S0025-5718-1988-0935077-0} }

:paramtitle={Generation of finite difference formulas on arbitrarily spaced grids},

author={Fornberg, Bengt}, journal={Mathematics of computation}, volume={51}, number={184}, pages={699–706}, year={1988} doi={10.1090/S0025-5718-1988-0935077-0} }

class hydesign.utils.hybridization_shifted(N_limit, life_y, N_time, life_h)[source]

Bases: openmdao.api.ExplicitComponent

Class to inherit from when all output variables are explicit.

Parameters:

**kwargs (dict of keyword arguments) – Keyword arguments that will be mapped into the Component options.

_has_compute_partials[source]

If True, the instance overrides compute_partials.

Type:

bool

N_limit[source]
life_y[source]
life_h[source]
N_time[source]
setup()[source]

Declare inputs and outputs.

Available attributes:

name pathname comm options

compute(inputs, outputs)[source]

Compute outputs given inputs. The model is assumed to be in an unscaled state.

Parameters:
  • inputs (Vector) – Unscaled, dimensional input variables read via inputs[key].

  • outputs (Vector) – Unscaled, dimensional output variables read via outputs[key].

  • discrete_inputs (dict or None) – If not None, dict containing discrete input values.

  • discrete_outputs (dict or None) – If not None, dict containing discrete output values.

hydesign.utils.sample_mean(outs)[source]