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]
  [./xtimes]
    type = ParsedFunction
    expression = 1.1*x
  [../]

  [./twoxplus1]
    type = ParsedFunction
    expression = 2*x+1
  [../]

  [./xsquared]
    type = ParsedFunction
    expression = (x-2)*x
  [../]

  [./tover2]
    type = ParsedFunction
    expression = 0.5*t
  [../]

  [./the_linear_combo]
    type = LinearCombinationFunction
    functions = 'xtimes twoxplus1 xsquared tover2'
    w = '3 -1.2 0.4 3'
  [../]

  [./should_be_answer]
    type = ParsedFunction
    expression = 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

  • 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)

Required Parameters

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

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

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters