Simulation Functions

Below are example simulation functions available in libEnsemble. Most of these demonstrate an inexpensive algorithm and do not launch tasks (user applications). To see an example of a simulation function launching tasks, see the Electrostatic Forces tutorial.

Important

See the API for simulation functions here.

six_hump_camel

This module contains various versions that evaluate the six hump camel function.

six_hump_camel.six_hump_camel(H, persis_info, sim_specs, _)

Evaluates the six hump camel function for a collection of points given in H['x']. Additionally evaluates the gradient if 'grad' is a field in sim_specs['out'] and pauses for sim_specs['user']['pause_time']] if defined.

six_hump_camel.six_hump_camel_simple(x, persis_info, sim_specs, _)

Evaluates the six hump camel function for a single point x.

See also

test_fast_alloc.py # noqa

six_hump_camel.six_hump_camel_with_different_ranks_and_nodes(H, persis_info, sim_specs, libE_info)

Evaluates the six hump camel for a collection of points given in H['x'] but also performs a system call with a given number of nodes and ranks per node using a machinefile (to show one way of evaluating a compiled simulation).

chwirut

chwirut1.chwirut_eval(H, persis_info, sim_specs, _)

Evaluates the chwirut objective function at a given set of points in H['x']. If 'obj_component' is a field in sim_specs['out'], only that component of the objective will be evaluated. Otherwise, all 214 components are evaluated and returned in the 'fvec' field.

See also

test_old_aposmm_pounders.py for an example where the entire fvec is computed each call.

See also

test_old_aposmm_one_residual_at_a_time.py for an example where one component of fvec is computed per call

noisy_vector_mapping

This module contains a test noisy function

noisy_vector_mapping.func_wrapper(H, persis_info, sim_specs, libE_info)

Wraps an objective function

noisy_vector_mapping.noisy_function(x)

periodic_func

This module contains a periodic test function

periodic_func.func_wrapper(H, persis_info, sim_specs, libE_info)

Wraps an objective function

periodic_func.periodic_func(x)

This function is periodic

borehole

borehole.borehole(H, persis_info, sim_specs, _)

Wraps the borehole function

borehole.borehole_func(x)

This evaluates the Borehole function for n-by-8 input matrix x, and returns the flow rate through the Borehole. (Harper and Gupta, 1983) input:

Parameters

x (matrix of dimension (n, 8), where n is the number of input configurations:) –

x[:,0]: Tu, transmissivity of upper aquifer (m^2/year)
x[:,1]: Tl, transmissivity of lower aquifer (m^2/year)
x[:,2]: Hu, potentiometric head of upper aquifer (m)
x[:,3]: Hl, potentiometric head of lower aquifer (m)
x[:,4]: r, radius of influence (m)
x[:,5]: rw, radius of borehole (m)
x[:,6]: Kw, hydraulic conductivity of borehole (m/year)
x[:,7]: L, length of borehole (m)

Returns

flow rate through the Borehole (m^3/year)

Return type

vector of dimension (n, 1)

borehole.gen_borehole_input(n)

Generates and returns n inputs for the Borehole function, according to distributions outlined in Harper and Gupta (1983).

input:

n: number of input to generate

output:

matrix of (n, 8), input to borehole_func(x) function

executor_hworld

executor_hworld.executor_hworld(H, persis_info, sim_specs, libE_info)

Tests launching and polling task and exiting on task finish