net.sourceforge.webcompmath.functions
Class ImplicitFunction

java.lang.Object
  extended by net.sourceforge.webcompmath.functions.ImplicitFunction

public class ImplicitFunction
extends java.lang.Object

Author:
PKHG 050505, several adjustments

Field Summary
 ExpressionInput expressionInput
           
 ZeroFinder zeroFinder
           
 
Constructor Summary
ImplicitFunction()
           
ImplicitFunction(java.lang.String equation)
           
 
Method Summary
 double dydxExplicit(double xIn)
          Making a Table function to save (x,y) pairs for a y'(x) Never save NaN in history
 double dydxExplicit(double xIn, double yIn)
          Derivative of y(x) at xIn (given yIn) If y(x) is known ...
 ExpressionFunction getDefiningEquation()
           
 ExpressionFunction getDydxImplicit()
          Vectorfield (-Dx/Dy)(x,y) from equation(x,y) = 0
 TableFunction getDyDxRemembered()
          The computed derivative y'(x) if the history switch was on.
 java.lang.String getEquation()
           
 double getEquationValueIn(double xIn, double yIn)
          The value of the given equation(x,y)
 ExpressionFunction getFGivenX()
          The function equation(givenX, variable) of variable
 boolean getHistory()
          Status of the history switch
 Parser getParser()
           
 int getTableStyle()
          Style of the TableFunctions
 double getXStart()
           
 Variable getXVar()
           
 TableFunction getYRemembered()
          If the history switch is on, computed y(x) values are remembered in a TableFunction
 double getYStart()
           
 Variable getYVar()
           
 ZeroFinder getZeroFinder()
          The zeroFinder used.
 void initialization()
          To initialize the important parts.
 void setDelta(double d)
          Set the inteval for the ZeroFinder [ystart-delta, ystart+delta] d may be negative.
 void setEquation(java.lang.String equation)
           
 void setFGivenX(double xNew)
          Compute the function at a given x value.
 void setHistory(boolean b)
          Set the history switch
 void setTableStyle(int i)
          Set the Style of the TableFunction(s)
 void setYStart(double testY)
          Set the startvalue for the ZeroFinder
 double y_x(double start)
          The value y(x) of an implicit given function from equation = 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expressionInput

public ExpressionInput expressionInput

zeroFinder

public ZeroFinder zeroFinder
Constructor Detail

ImplicitFunction

public ImplicitFunction()

ImplicitFunction

public ImplicitFunction(java.lang.String equation)
Method Detail

initialization

public void initialization()
To initialize the important parts. Used e.g. in the contructors


getEquation

public java.lang.String getEquation()

setEquation

public void setEquation(java.lang.String equation)

getDefiningEquation

public ExpressionFunction getDefiningEquation()
Returns:
The defining equation as a function of two variables

getXStart

public double getXStart()
Returns:
latest computation at xStart

setFGivenX

public void setFGivenX(double xNew)
Compute the function at a given x value.


getYStart

public double getYStart()
Returns:
double

y_x

public double y_x(double start)
The value y(x) of an implicit given function from equation = 0. NaN if ZeroFinder was not succesful or not existing at x.

Parameters:
start -
Returns:
y(x)

dydxExplicit

public double dydxExplicit(double xIn)
Making a Table function to save (x,y) pairs for a y'(x) Never save NaN in history

Returns:
y'(x)

dydxExplicit

public double dydxExplicit(double xIn,
                           double yIn)
Derivative of y(x) at xIn (given yIn) If y(x) is known ... Dangerous, if used you may better use setHistory(false);

Parameters:
xIn -
yIn -
Returns:
y'(x)

getDydxImplicit

public ExpressionFunction getDydxImplicit()
Vectorfield (-Dx/Dy)(x,y) from equation(x,y) = 0


getParser

public Parser getParser()
Returns:
used parser

getXVar

public Variable getXVar()
Returns:
x variable

getYVar

public Variable getYVar()
Returns:
y variable

getEquationValueIn

public double getEquationValueIn(double xIn,
                                 double yIn)
The value of the given equation(x,y)

Parameters:
xIn -
yIn -
Returns:
equation(xIn,yIn)

getFGivenX

public ExpressionFunction getFGivenX()
The function equation(givenX, variable) of variable

Returns:
ExpressionFunction

setYStart

public void setYStart(double testY)
Set the startvalue for the ZeroFinder


setDelta

public void setDelta(double d)
Set the inteval for the ZeroFinder [ystart-delta, ystart+delta] d may be negative.

Parameters:
d -

getZeroFinder

public ZeroFinder getZeroFinder()
The zeroFinder used.

Returns:
zeroFinder

getYRemembered

public TableFunction getYRemembered()
If the history switch is on, computed y(x) values are remembered in a TableFunction

Returns:
historyOfY

getHistory

public boolean getHistory()
Status of the history switch

Returns:
saveHistory

setHistory

public void setHistory(boolean b)
Set the history switch

Parameters:
b -

getTableStyle

public int getTableStyle()
Style of the TableFunctions

Returns:
the used style of TableFunctions

setTableStyle

public void setTableStyle(int i)
Set the Style of the TableFunction(s)

Parameters:
i -

getDyDxRemembered

public TableFunction getDyDxRemembered()
The computed derivative y'(x) if the history switch was on.

Returns:
the computed history of y'(x)