==================
Central Difference
==================
:doc:`/WorkProcessClassifiers/LocalAlgorithm/index` - :doc:`/WorkProcessClassifiers/OneDimensionalAlgorithm/index`

The basic formula for computing the *Central Difference* derivative at the point :math:`t_i` is stated as follows:

.. math::

   Y'(t_i) = \frac{Y(t_i+h_i) - Y(t_i-h_{i-1})}{h_{i-1} + h_i}

where :math:`Y(t_i)` is the function value at time point :math:`t_i`\ , :math:`Y'(t_i)` is the first derivative at time point :math:`t_i`\ , :math:`h_{i-1}` is the step size between the point :math:`t_i` and the preceding time point, and :math:`h_{i}` is the step size between the point :math:`t_i` and the next time point.

.. rubric:: Input Parameters

+----------------------------+----------------------------------------------------+------------+-------------+---------+
| Parameter                  | Type                                               | Constraint | Description | Remarks |
+============================+====================================================+============+=============+=========+
| :math:`Y`                  | A continuous function or a data vector             |            |             |         |
+----------------------------+----------------------------------------------------+------------+-------------+---------+
| :math:`h_i`                | :math:`h_i \in \mathbb{R}^+`                       |            |             |         |
+----------------------------+----------------------------------------------------+------------+-------------+---------+
| :math:`h_{i-1}`            | :math:`h_{i-1} \in \mathbb{R}^+`                   |            |             |         |
+----------------------------+----------------------------------------------------+------------+-------------+---------+

.. rubric:: Output Parameters

+----------------------------+---------------+------------+---------------------------------------------------------------------------+---------+
| Parameter                  | Type          | Constraint | Description                                                               | Remarks |
+============================+===============+============+===========================================================================+=========+
| :math:`\hat{Y}`            | A data vector |            | first derivative of :math:`Y`          with respect to :math:`t`          |         |
+----------------------------+---------------+------------+---------------------------------------------------------------------------+---------+

.. rubric:: Single Steps using the Algorithm

* :doc:`/DataPreprocessing/MathematicalComputation/NumericalDifferentiation/ComputingFirstOrderDerivative/ComputingFirstOrderDerivativeWithCentralDifference/index`

.. rubric:: References

- R.\  L. Burden and J. D. Faires, Numerical Analysis, Fifth Edition, PWS Publishing Co. Boston, MA, 1993.