jhplot
Class FND
- java.lang.Object
-
- jhplot.Plottable
-
- jhplot.DrawOptions
-
- jhplot.FND
-
- All Implemented Interfaces:
- java.io.Serializable
public class FND extends 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(java.lang.String name, java.lang.String vars)Build a function, setting its title to the definition.FND(java.lang.String title, java.lang.String name, java.lang.String vars)Create a function in any dimension evaluation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddiff(java.lang.String var)differentiate the expression and simplifyvoiddoc()Show online documentation.doubleeval(java.lang.String vars)Evaluate a function at a specific point in xbooleaneval(java.lang.String indvars, double xmin, double xmax)Evaluate a function at a specific point for one single variable.booleaneval(java.lang.String indvars, double xmin, double xmax, java.lang.String vars)Evaluate a function at a specific point for one single variable.FProxyget()Get the proxy of this function used for serialization and non-graphical representations.java.lang.StringgetFixedVars()String with fixed variablesdoublegetMax()Get the maximum value in XdoublegetMin()Get the minimum value in Xjava.lang.StringgetName()Get the name of the function used for evaluationintgetPoints()Get the number of pointsjava.lang.String[]getVars()Return all variablesjava.lang.StringgetVarString()Get arguments of the function (independent variables).doublegetX(int i)Get value in X-axisdoublegetY(int i)Get value in Y-axisbooleanisEvaluated()Is the function was evaluated?voidsetComplex()Treat the function as complex.voidsetMax(double max)Set the maximum value in XvoidsetMin(double min)Set Min value in XvoidsetName(java.lang.String name)Sets a name of the function, i.e.voidsetPoints(int bins)Sets the number points between Min and Max for evaluationvoidsimplify()Treat the function as complex.java.lang.StringtoString()Convert to string-
Methods 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(java.lang.String title, java.lang.String name, java.lang.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(java.lang.String name, java.lang.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(java.lang.String var)
differentiate the expression and simplify- Parameters:
var- variable used for differentiation
-
getVars
public java.lang.String[] getVars()
Return all variables- Returns:
- array array with variables
-
toString
public java.lang.String toString()
Convert to string- Overrides:
toStringin classjava.lang.Object
-
eval
public double eval(java.lang.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(java.lang.String indvars, double xmin, double xmax, java.lang.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(java.lang.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(java.lang.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 java.lang.String getName()
Get the name of the function used for evaluation- Returns:
- Name
-
getVarString
public java.lang.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 java.lang.String getFixedVars()
String with fixed variables- Returns:
- String with fixed variables
-
-
DMelt 3.0 © DataMelt by jWork.ORG