public class DJep extends XJep
DJep j = new DJep(); j.addStandardDiffRules(); .... Node node = j.parse("x^3"); Node diff = j.differentiate(node,"x"); Node simp = j.simplify(diff); j.println(simp); Node node2 = j.parse("diff(x^4,x)"); Node proc = j.preprocess(node2); Node simp2 = j.simplify(proc); j.println(simp2);
Modifier and Type | Field and Description |
---|---|
protected DifferentiationVisitor |
dv |
cleaner, commandv, copier, extractor, polyv, rewritev, subv, tu
additionalComponents, allowAssignment, allowUndeclared, evaluator, funTab, implicitMul, lastRootNode, nodeFac, numFac, opTab, parser, pv, varFac, varTab
Constructor and Description |
---|
DJep()
Standard constructor.
|
DJep(ComponentSet dJepComponents) |
DJep(JepComponent... components) |
Modifier and Type | Method and Description |
---|---|
void |
addDiffRule(DiffRulesI rule)
Adds a rule with instruction on how to differentiate a function.
|
boolean |
addStandardDiffRules()
Adds the standard set of differentiation rules.
|
Node |
differentiate(Node node,
java.lang.String name)
Differentiate an equation with respect to a variable.
|
DifferentiationVisitor |
getDifferentationVisitor()
Returns the visitor used for differentiation.
|
Node |
replacePartialDerivativeByExpressions(Node node) |
protected void |
setXComponentInternal(JepComponent comp) |
addRewriteRule, calcVarValue, clean, deepCopy, equals, expand, getCommandVisitor, getCopier, getExpressionCleaner, getExtractor, getPolynomialCreator, getRewriteVisitor, getSubstitutionVisitor, getTreeUtils, getVarsInEquation, getVarsInEquation, preprocess, recursiveGetVarsInEquation, replaceRHSVariablesByEquations, replaceVariableByExpressions, rewrite, simplify, substitute, substitute, substitute, substitute, substitute, substitute, substituteConstantVariables
addConstant, addDefaultComponents, addFunction, addStandardConstants, addVariable, addVariable, addVariable, addVariable, continueParsing, evaluate, evaluate, evaluateD, getAdditionalComponent, getAdditionalComponents, getAllowAssignment, getAllowUndeclared, getDefaultValue, getEvaluator, getFunctionTable, getImplicitMul, getLastRootNode, getNodeFactory, getNumberFactory, getOperatorTable, getParser, getPrintVisitor, getVariable, getVariableFactory, getVariableTable, getVariableValue, initMultiParse, initMultiParse, parse, parse, print, print, print, println, println, println, reinitializeComponents, rootNodeToString, setAllowAssignment, setAllowUndeclared, setComponent, setComponentInternal, setComponents, setComponentsInternal, setDefaultValue, setImplicitMul, setVariable, toString, tryAddConstant
protected DifferentiationVisitor dv
public DJep()
public DJep(JepComponent... components)
public DJep(ComponentSet dJepComponents)
protected void setXComponentInternal(JepComponent comp)
setXComponentInternal
in class XJep
public DifferentiationVisitor getDifferentationVisitor()
public boolean addStandardDiffRules()
sin,cos,tan,asin,acos,atan,sinh,cosh,tanh,asinh,acosh,atanh sqrt,log,ln,abs,angle sum,im,re are handled separately. rand and mod currently un-handled Also adds rules for functions not in Jep function list: sec,cosec,cot,exp,pow,sgn
public void addDiffRule(DiffRulesI rule)
rule
- public Node differentiate(Node node, java.lang.String name) throws ParseException
node
- top node of the expression tree to differentiate.name
- differentiate with respect to this variable.ParseException
java.lang.IllegalArgumentException
public Node replacePartialDerivativeByExpressions(Node node) throws JepException
JepException
Copyright © 2018 Singular Systems http://www.singularsys.com/jep