optframework.kernel_opt.opt_pbe module

PBE-related calculations during optimization

class optframework.kernel_opt.opt_pbe.OptPBE(base)[source]

Bases: object

close_pbe()[source]
calc_pop(pop, params=None, t_vec=None, init_N=None)[source]

Configure and calculate the PBE.

If calc_init_N is set to False, the full initialization is performed without calculating alpha. Otherwise, it calculates various terms such as F_M, B_R, and int_B_F before solving the PBE.

Parameters

popobject

The population instance for which the PBE will be calculated.

paramsdict, optional

The population parameters. If not provided, it uses the existing parameters of the population.

t_vecarray-like, optional

The time vector for which the PBE will be solved. If not provided, the default time vector is used.

Returns

None

set_init_pop_para(pop_params)[source]

Initialize population parameters for all PBEs.

This method sets the population parameters for the main population (p) as well as for the auxiliary populations (p_NM and p_M, if they exist).

Parameters

pop_paramsdict

The parameters to be applied to the populations.

Returns

None

set_pop_para(pop, params_in)[source]

Set the population parameters for a given population instance.

This method configures the population attributes based on the provided parameters. It handles both 1D and 2D populations and adjusts specific parameters such as alpha_prim and CORR_BETA depending on the dimensionality of the population.

Parameters

popobject

The population instance whose parameters are being set.

params_indict

The dictionary of population parameters to be applied.

Returns

None

set_pop_attributes(pop, params)[source]

Set attributes for a population instance from the provided parameters.

Parameters

popobject

The population instance whose attributes are being set.

paramsdict

A dictionary containing the population parameters. Each key-value pair corresponds to an attribute name and its value.

Returns

None