org.apache.commons.math3.analysis.polynomials
Class FourierDecompositionEngine

java.lang.Object
  extended by org.apache.commons.math3.analysis.polynomials.FourierDecompositionEngine

public final class FourierDecompositionEngine
extends Object

Decompose a UnivariateFunction as a Fourier Series using TrigonometricPolynomialFunction representation.

Since:
1.2
Version:
$Id: FourierDecompositionEngine.java 17603 2017-05-18 08:28:32Z bignon $
Author:
Rami Houdroge
See Also:
TrigonometricPolynomialFunction
Use sample :
Given an integrator, the user must create an instance of this class, set the parameters and then call the decompose() method :

FourierDecompositionEngine engine = new FourierDecompositionEngine(integrator);
engine.setOrder(10);
engine.setFunction(userFunction, userFunctionPeriod);
FourierSeriesApproximation approximation = engine.decompose();

Concurrency :
not thread-safe
Concurrency comment :
not thread safe because of the setFunction method that can change the UnivariateFunction being decomposed

Constructor Summary
FourierDecompositionEngine(UnivariateIntegrator newIntegrator)
          Constructor.
 
Method Summary
 FourierSeriesApproximation decompose()
          Decompose function f, using user given period t and integrator, into a Fourier Series of order order.
 int getMaxEvals()
           
 int getOrder()
           
 double getPeriod()
           
 void setFunction(UnivariateFunction function, double period)
          Set the UnivariateFunction to decompose and its period.
 void setIntegrator(UnivariateIntegrator newIntegrator)
          Set the UnivariateIntegrator to use for the serires coefficient computation.
 void setMaxEvals(int maxEvaluations)
          Set the maximum evaluations allowed for the integrator.
 void setOrder(int newOrder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FourierDecompositionEngine

public FourierDecompositionEngine(UnivariateIntegrator newIntegrator)
Constructor. Create a new instance of the FourierDecompositionEngine class with the specified integrator.

Parameters:
newIntegrator - integrator to use
Method Detail

getOrder

public int getOrder()
Returns:
the order

setOrder

public void setOrder(int newOrder)
Parameters:
newOrder - the order to set

getPeriod

public double getPeriod()
Returns:
the period of function f

getMaxEvals

public int getMaxEvals()
Returns:
the maximum evaluations for the integrator

setMaxEvals

public void setMaxEvals(int maxEvaluations)
Set the maximum evaluations allowed for the integrator. Default is 100

Parameters:
maxEvaluations - the maximum evaluations for the integrator

setIntegrator

public void setIntegrator(UnivariateIntegrator newIntegrator)
Set the UnivariateIntegrator to use for the serires coefficient computation.

Parameters:
newIntegrator - to use

setFunction

public void setFunction(UnivariateFunction function,
                        double period)
Set the UnivariateFunction to decompose and its period.
Warning : The user should make sure the period specified is coherent with the function.

Parameters:
function - to decompose
period - period of function

decompose

public FourierSeriesApproximation decompose()
Decompose function f, using user given period t and integrator, into a Fourier Series of order order. Warning : the user must make sure the given period t is coherent with the function f.

Returns:
A FourierSeriesApproximation instance containing the Fourier Series approximation of the user function and the latter.


Copyright © 2017 CNES. All Rights Reserved.