- expressionThe user defined function.
C++ Type:FunctionExpression
Unit:(no unit assumed)
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.
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<<<{"href": "../../syntax/Functions/index.html"}>>>]
[parsed_opt]
type = ParsedOptimizationFunction<<<{"description": "Function used for optimization that uses a parsed expression with parameter dependence.", "href": "ParsedOptimizationFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 'x*v1 + y*v2*v2 + z*v3*v3*v3 + t*v4*v4*v4*v4'
param_symbol_names<<<{"description": "Names of parameters in 'expression' being optimized."}>>> = 'v1 v2 v3 v4'
param_vector_name<<<{"description": "Reporter or VectorPostprocessor vector containing parameter values."}>>> = 'params/vals'
[]
[]
(moose/modules/optimization/test/tests/functions/parsed_function/parsed_function.i)params/vals
is the name of a vector reporter value, define as:
[Reporters<<<{"href": "../../syntax/Reporters/index.html"}>>>]
[params]
type = ConstantReporter<<<{"description": "Reporter with constant values to be accessed by other objects, can be modified using transfers.", "href": "../reporters/ConstantReporter.html"}>>>
real_vector_names<<<{"description": "Names for each vector of reals value."}>>> = 'vals'
# Random numbers (0,1)
real_vector_values<<<{"description": "Values for vectors of reals."}>>> = '0.2045493861327407 0.1683865411251007 0.5071506764525194 0.7257355264179883'
[]
[]
(moose/modules/optimization/test/tests/functions/parsed_function/parsed_function.i)Input 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>
Unit:(no unit assumed)
Controllable:No
Description:Constant numeric values for vars.
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.