ParsedOptimizationFunction

Function used for optimization that uses a parsed expression with parameter dependence.

Overview

This function is similar to ParsedFunction except it has some dedicated routines relevant to optimization, particularly the ability to differentiate the function with respect to parameters. The "expression" parameter indicates the function expression. Users may specify x, y, z, and t for space-time dependence. They may also define variables with constant values in the expression by specifying "constant_symbol_names" and "constant_symbol_values" pairs. Finally, parameter variables can be specified which correspond to the definitions in "param_symbol_names". The values of these parameter variables are evaluated from the inputted vector in "param_vector_name". The vector specified in "param_vector_name" can either be a vector-postprocessor vector or a vector reporter value. An error will occur if the length of this vector does not match the number of values specified in "param_symbol_names".

Example Input File Syntax

Here is an example where the parsed function represents the following expression:

[Functions]
  [parsed_opt]
    type = ParsedOptimizationFunction
    expression = 'x*v1 + y*v2*v2 + z*v3*v3*v3 + t*v4*v4*v4*v4'
    param_symbol_names = 'v1 v2 v3 v4'
    param_vector_name = 'params/vals'
  []
[]
(modules/optimization/test/tests/functions/parsed_function/parsed_function.i)

params/vals is the name of a vector reporter value, define as:

[Reporters]
  [params]
    type = ConstantReporter
    real_vector_names = 'vals'
    # Random numbers (0,1)
    real_vector_values = '0.2045493861327407 0.1683865411251007 0.5071506764525194 0.7257355264179883'
  []
[]
(modules/optimization/test/tests/functions/parsed_function/parsed_function.i)

Input Parameters

  • expressionThe user defined function.

    C++ Type:FunctionExpression

    Controllable:No

    Description:The user defined function.

  • param_symbol_namesNames of parameters in 'expression' being optimized.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Names of parameters in 'expression' being optimized.

  • param_vector_nameReporter or VectorPostprocessor vector containing parameter values.

    C++ Type:ReporterName

    Controllable:No

    Description:Reporter or VectorPostprocessor vector containing parameter values.

Required Parameters

  • constant_symbol_namesVariables (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the symbol_values vector.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Variables (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the symbol_values vector.

  • constant_symbol_valuesConstant numeric values for vars.

    C++ Type:std::vector<double>

    Controllable:No

    Description:Constant numeric values for vars.

  • execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS.

    Default:LINEAR

    C++ Type:ExecFlagEnum

    Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters

Input Files