|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nfunk.jep.function.PostfixMathCommand org.lsmp.djep.xjep.function.SumType org.lsmp.djep.xjep.function.Trapezium org.lsmp.djep.xjep.function.Simpson
public class Simpson
The Simpson rule for approximation to a definite integral. h * (y0 + yn + 4(y1+y3+...+y_(n-1)) + 2(y2+y4+...+y_(n-2)) ) /3 where h = (xn-x0)/n, yi = f(xi) Simpson(x^2,x,0,10,0.5) finds an approximation for int(x^2) where x runs from 0 to 10 in steps of h=0.5.
Field Summary |
---|
Fields inherited from class org.lsmp.djep.xjep.function.SumType |
---|
name |
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand |
---|
curNumberOfParameters, numberOfParameters |
Constructor Summary | |
---|---|
Simpson()
|
Method Summary | |
---|---|
java.lang.Object |
evaluate(java.lang.Object[] elements)
Evaluates the function given the set of y values. |
Methods inherited from class org.lsmp.djep.xjep.function.Trapezium |
---|
evaluate |
Methods inherited from class org.lsmp.djep.xjep.function.SumType |
---|
checkNumberOfParameters, evaluate, run |
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand |
---|
checkStack, getNumberOfParameters, setCurNumberOfParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Simpson()
Method Detail |
---|
public java.lang.Object evaluate(java.lang.Object[] elements) throws ParseException
SumType
evaluate
in class Trapezium
elements
- the y values
ParseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |