A simple Python library that wraps the Design of Experiments (DOE) capability of OpenMDAO into a single "generate" function call. All DOE algorithms provided by OpenMDAO are available, including:
- Full factorial
- Uniform (random) distribution
- Latin hypercube
- Morris-Mitchell optimized Latin hypercube
Basic usage is:
doegen.generate(algorithm_name, parameter_ranges, **kwargs)
Where the algorithm name is provided as a string, the parameter ranges are a defined by a list of min/max values, and algorithm specific keyword arguments are added at the end.
A more detailed example of each algorithm type follows:
import doegen
# define 3 parameters by their min/max ranges
params = [[0, 1],
[-5.5, 7.5],
[300, 600]]
# generate a basic DOE for each algorithm type
print(doegen.generate('FullFactorial', params, num_levels=2))
print(doegen.generate('Uniform', params, num_samples=10))
print(doegen.generate('LatinHypercube', params, num_samples=10))
print(doegen.generate('OptimizedLatinHypercube', params, num_samples=10))
# generate an OLHC with additional algorithm specific arguments
X = doegen.generate('OptimizedLatinHypercube', params, num_samples=30, seed=3,
population=50, generations=4)
print('\nDOE points:')
i = 0
for x in X:
print('Iteration %d: p0=%g, p1=%g, p2=%g' % (i, x[0], x[1], x[2]))
i += 1
The following links provide a reference to the specific arguments of each algorithm. Note that OpenMDAO adds the word "Driver" to each algorithm.