jhplot
Class FND
- All Implemented Interfaces:
- Serializable
public class FNDextends DrawOptions
Create a function in multiple dimensions. The function name could have parameters named in unique way as P0, P1, P2 ... They have to be replaced with values using setPar() method for evaluation- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor and Description FND(FProxy f)
Initialize function from proxy.FND(String name, String vars)
Build a function, setting its title to the definition.FND(String title, String name, String vars)
Create a function in any dimension evaluation.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
diff(String var)
differentiate the expression and simplifyvoid
doc()
Show online documentation.double
eval(String vars)
Evaluate a function at a specific point in xboolean
eval(String indvars, double xmin, double xmax)
Evaluate a function at a specific point for one single variable.boolean
eval(String indvars, double xmin, double xmax, String vars)
Evaluate a function at a specific point for one single variable.FProxy
get()
Get the proxy of this function used for serialization and non-graphical representations.String
getFixedVars()
String with fixed variablesdouble
getMax()
Get the maximum value in Xdouble
getMin()
Get the minimum value in XString
getName()
Get the name of the function used for evaluationint
getPoints()
Get the number of pointsString[]
getVars()
Return all variablesString
getVarString()
Get arguments of the function (independent variables).double
getX(int i)
Get value in X-axisdouble
getY(int i)
Get value in Y-axisboolean
isEvaluated()
Is the function was evaluated?void
setComplex()
Treat the function as complex.void
setMax(double max)
Set the maximum value in Xvoid
setMin(double min)
Set Min value in Xvoid
setName(String name)
Sets a name of the function, i.e.void
setPoints(int bins)
Sets the number points between Min and Max for evaluationvoid
simplify()
Treat the function as complex.String
toString()
Convert to stringMethods inherited from class jhplot.DrawOptions
copyLinePars, getBinWidth, getColor, getDrawOption, getDrawOptions, getFillColor, getLegend, getLineParm, getLineStyle, getNameX, getNameY, getNameZ, getPenWidth, getSymbol, getSymbolShape, getSymbolSize, getTitle, getType, isBars, isErrX, isErrY, isFilled, printDrawOptions, printDrawOptions, setBars, setBinWidth, setColor, setDrawLine, setDrawLineKey, setDrawOption, setDrawSymbol, setErr, setErrAll, setErrColor, setErrColor, setErrColorX, setErrColorY, setErrFill, setErrFillColor, setErrFillColor, setErrSys, setErrSysFill, setErrSysFillColor, setErrSysFillColor, setErrSysX, setErrSysY, setErrTicSize, setErrX, setErrY, setFill, setFillColor, setFillColorTransparency, setGraphStyle, setLegend, setLineStyle, setNameX, setNameY, setNameZ, setPenDash, setPenDash, setPenWidth, setPenWidthErr, setPenWidthErrSys, setStyle, setSymbol, setSymbol, setSymbolSize, setTitle, setType
Constructor Detail
FND
public FND(String title, String name, String vars)
Create a function in any dimension evaluation. The function may have many independent variables.List of commands
- ( ) parenthesis , comma
- +, -, unary -, unary +
- *, /
- ^ (raise to a power)
- pi, e, All the constants in class SpecialFunction
- log
- sin, cos, tan, sinh, cosh, tanh
- asin, acos, atan, asinh, acosh, atanh
- sqrt
- rand
- exp
- remainder
- atan2
- Special functions and constants. Look at the book
- All the functions in class SpecialFunction
- Independent variables x
- Scientific notation using "e", "E", "d", "D".
- Parameters:
name
- String representing the functionvars
- String representing variables. Each variable should be separated by a comma. Example "x,y,z"
FND
public FND(String name, String vars)
Build a function, setting its title to the definition.- Parameters:
title
- Titlename
- namevars
- Options
FND
public FND(FProxy f)
Initialize function from proxy.- Parameters:
f
-
Method Detail
setComplex
public void setComplex()
Treat the function as complex.
simplify
public void simplify()
Treat the function as complex.
diff
public void diff(String var)
differentiate the expression and simplify- Parameters:
var
- variable used for differentiation
getVars
public String[] getVars()
Return all variables- Returns:
- array array with variables
eval
public double eval(String vars)
Evaluate a function at a specific point in x- Parameters:
vars
- Values for evaluation separated by commas, x=1,y=2,z=3- Returns:
- function value at x
eval
public boolean eval(String indvars, double xmin, double xmax, String vars)
Evaluate a function at a specific point for one single variable. Evaluation is done between xmin and xmax- Parameters:
indvars
- Define independent variable, like 'x' Only one variable is allowedxmin
- xmin value for independent variblexmax
- xmax value for independent variblevars
- define values for other variables, like 'y=1,z=3'- Returns:
- true if no errors
eval
public boolean eval(String indvars, double xmin, double xmax)
Evaluate a function at a specific point for one single variable. Evaluation is done between xmin and xmax. It is assumed that there are no any other variable involved- Parameters:
indvars
- Define independent variable, like 'x' Only one variable is allowedxmin
- xmin value for independent variblexmax
- xmax value for independent varible- Returns:
- true if no errors
isEvaluated
public boolean isEvaluated()
Is the function was evaluated?
getX
public double getX(int i)
Get value in X-axis- Parameters:
i
- index- Returns:
- value in X
getY
public double getY(int i)
Get value in Y-axis- Parameters:
i
- index- Returns:
- value in Y
setName
public void setName(String name)
Sets a name of the function, i.e. what will be used for evaluation- Parameters:
name
- Name
get
public FProxy get()
Get the proxy of this function used for serialization and non-graphical representations.- Parameters:
proxy
- proxy of this function.
getName
public String getName()
Get the name of the function used for evaluation- Returns:
- Name
getVarString
public String getVarString()
Get arguments of the function (independent variables).- Returns:
- arguments
doc
public void doc()
Show online documentation.
setMin
public void setMin(double min)
Set Min value in X- Parameters:
min
- Minimum value
getMin
public double getMin()
Get the minimum value in X- Returns:
- min Minimum value
setMax
public void setMax(double max)
Set the maximum value in X- Parameters:
max
- Maximal value
getMax
public double getMax()
Get the maximum value in X- Returns:
- Maximal value
setPoints
public void setPoints(int bins)
Sets the number points between Min and Max for evaluation- Parameters:
bins
- Number of points
getPoints
public int getPoints()
Get the number of points- Returns:
- Number of points
getFixedVars
public String getFixedVars()
String with fixed variables- Returns:
- String with fixed variables
DMelt 2.7 © DataMelt by jWork.ORG