- functionsThis function will return Sum_over_i(w_i * functions_i)
C++ Type:std::vector<FunctionName>
Unit:(no unit assumed)
Controllable:No
Description:This function will return Sum_over_i(w_i * functions_i)
- wThis function will return Sum_over_i(w_i * functions_i)
C++ Type:std::vector<double>
Unit:(no unit assumed)
Controllable:No
Description:This function will return Sum_over_i(w_i * functions_i)
LinearCombinationFunction
Returns the linear combination of the functions
Example input syntax
In this input file, we show how a LinearCombinationFunction
may be used to combine a variety of different functions, then compare the results to a manually computed linear combination.
[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
[./xtimes]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 1.1*x
[../]
[./twoxplus1]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 2*x+1
[../]
[./xsquared]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = (x-2)*x
[../]
[./tover2]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 0.5*t
[../]
[./the_linear_combo]
type = LinearCombinationFunction<<<{"description": "Returns the linear combination of the functions", "href": "LinearCombinationFunction.html"}>>>
functions<<<{"description": "This function will return Sum_over_i(w_i * functions_i)"}>>> = 'xtimes twoxplus1 xsquared tover2'
w<<<{"description": "This function will return Sum_over_i(w_i * functions_i)"}>>> = '3 -1.2 0.4 3'
[../]
[./should_be_answer]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 3*1.1*x-1.2*(2*x+1)+0.4*(x-2)*x+3*0.5*t
[../]
[]
(moose/test/tests/functions/linear_combination_function/lcf1.i)Input 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.