LeastSquaresFitHistory

Performs a polynomial least squares fit on the data contained in another VectorPostprocessor and stores the full time history of the coefficients

Description

LeastSquaresFitHistory is used perform a polynomial least squares fit of data provided through another VectorPostprocessor. It computes the coefficients for a polynomial of arbitrary, user-specified order that minimize the error using a standard least-squares procedure.This object stores the polynomial coefficients in a set of vectors that contain the full history of those values for a transient analysis.

This VectorPostprocessor is closely related to the LeastSquaresFit VectorPostprocessor, which performs the same type of least squares fit, but stores the results in a single vector, the history of which is not stored.

The polynomial coefficients are stored in a set of vectors named coef_0 through coef_n, where is the specified order of the polynomial. Each of these vectors stores the full history of its coefficient in time, so that the combination of component for each of these vectors defines the polynomial fit for time step . In addition, a vector named time stores the values of the solution time for each step of a transient analysis.

The vectors of values of the independent () and dependent () variables on which the least squares fit is performed are provided through another VectorPostprocessor, which must provide two equally-sized vectors of data upon which to operate. The name of this VectorPostprocessor is provided using the vectorpostprocessor parameter, and the names of the data vectors are provided with the x_name and y_name parameters. The vectors of data can be shifted and/or scaled through the use of optional parameters.

By default, if an insufficient number of points is provided in these data vectors, the order of the polynomial will be truncated to one less than the number of points. If the truncate_order parameter is set to `false, an error will be generated in this case.

Input Parameters

  • orderThe order of the polynomial fit

    C++ Type:unsigned int

    Controllable:No

    Description:The order of the polynomial fit

  • vectorpostprocessorThe vectorpostprocessor on whose values we perform a least squares fit

    C++ Type:VectorPostprocessorName

    Controllable:No

    Description:The vectorpostprocessor on whose values we perform a least squares fit

  • x_nameThe name of the independent variable

    C++ Type:std::string

    Controllable:No

    Description:The name of the independent variable

  • y_nameThe name of the dependent variable

    C++ Type:std::string

    Controllable:No

    Description:The name of the dependent variable

Required Parameters

  • execute_onTIMESTEP_ENDThe 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, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

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

    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, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.

  • parallel_typeREPLICATEDSet how the data is represented within the VectorPostprocessor (VPP); 'distributed' indicates that data within the VPP is distributed and no auto communication is performed, this setting will result in parallel output within the CSV output; 'replicated' indicates that the data within the VPP is correct on processor 0, the data will automatically be broadcast to all processors unless the '_auto_broadcast' param is set to false within the validParams function.

    Default:REPLICATED

    C++ Type:MooseEnum

    Options:DISTRIBUTED, REPLICATED

    Controllable:No

    Description:Set how the data is represented within the VectorPostprocessor (VPP); 'distributed' indicates that data within the VPP is distributed and no auto communication is performed, this setting will result in parallel output within the CSV output; 'replicated' indicates that the data within the VPP is correct on processor 0, the data will automatically be broadcast to all processors unless the '_auto_broadcast' param is set to false within the validParams function.

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • truncate_orderTrueTruncate the order of the fitted polynomial if an insufficient number of data points are provided. If this is set to false, an error will be generated in that case.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Truncate the order of the fitted polynomial if an insufficient number of data points are provided. If this is set to false, an error will be generated in that case.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

  • x_scale1Value used to scale x values (scaling is done after shifting)

    Default:1

    C++ Type:double

    Controllable:No

    Description:Value used to scale x values (scaling is done after shifting)

  • x_shift0Value used to shift x values (shifting is done before scaling)

    Default:0

    C++ Type:double

    Controllable:No

    Description:Value used to shift x values (shifting is done before scaling)

  • y_scale1Value used to scale y values (scaling is done after shifting)

    Default:1

    C++ Type:double

    Controllable:No

    Description:Value used to scale y values (scaling is done after shifting)

  • y_shift0Value used to shift y values (shifting is done before scaling)

    Default:0

    C++ Type:double

    Controllable:No

    Description:Value used to shift y values (shifting is done before scaling)

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • contains_complete_historyTrueSet this flag to indicate that the values in all vectors declared by this VPP represent a time history (e.g. with each invocation, new values are added and old values are never removed). This changes the output so that only a single file is output and updated with each invocation

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set this flag to indicate that the values in all vectors declared by this VPP represent a time history (e.g. with each invocation, new values are added and old values are never removed). This changes the output so that only a single file is output and updated with each invocation

  • 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:Yes

    Description:Set the enabled status of the MooseObject.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

  • outputsVector of output names where you would like to restrict the output of variables(s) associated with this object

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

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

Input Files