public static double simpsonRuleM(Expr expr, string varName, double a, double b) { var f = expr.Compile(varName); f = Differentiate.SecondDerivativeFunc(Differentiate.SecondDerivativeFunc(f)); return(max(f(a), f(b))); }
public static double evaluate( [Desc("The equation to evaluate.")] Expr expr, [Desc("The name of the first variable in the equation.")] string aName, [Desc("The value of the first variable.")] double a, [Desc("The name of the second variable in the equation.")] string bName, [Desc("The value of the second variable.")] double b) { var f = expr.Compile(aName, bName); return(f(a, b)); }
public static double evaluate( [Desc("The equation to evaluate.")] Expr expr, [Desc("The name of the variable in the equation.")] string aName, [Desc("The value of the variable.")] double a) { var f = expr.Compile(aName); return(f(a)); }
public static double trapezoidalRuleEt(Expr expr, string varName, double a, double b, int n) { var f = expr.Compile(varName); double trValue = NewtonCotesTrapeziumRule.IntegrateComposite(f, a, b, n); double trueValue = Integrate.OnClosedInterval(f, a, b); return(abs(trueValue - trValue)); }
public static double simpsonRuleEs(Expr expr, string varName, double a, double b, int n) { var f = expr.Compile(varName); double srValue = SimpsonRule.IntegrateComposite(f, a, b, n); double trueValue = Integrate.OnClosedInterval(f, a, b); return(abs(trueValue - srValue)); }
public static double evaluate( [Desc("The equation to evaluate.")] Expr expr, [Desc("The name of the first variable in the equation.")] string aName, [Desc("The value of the first variable.")] double a, [Desc("The name of the second variable in the equation.")] string bName, [Desc("The value of the second variable.")] double b, [Desc("The name of the third variable in the equation.")] string cName, [Desc("The value of the third variable.")] double c, [Desc("The name of the fourth variable in the equation.")] string dName, [Desc("The value of the fourth variable.")] double d) { var f = expr.Compile(aName, bName, cName, dName); return(f(a, b, c, d)); }
public static double simpsonRule(Expr expr, string varName, double a, double b, int n) { var f = expr.Compile(varName); return(SimpsonRule.IntegrateComposite(f, a, b, n)); }
public static double trapezoidalRuleError(Expr expr, string varName, double a, double b, double Et) { var f = expr.Compile(varName); return(NewtonCotesTrapeziumRule.IntegrateAdaptive(f, a, b, Et)); }
public static double trapezoidalRule(Expr expr, string varName, double a, double b, int n) { var f = expr.Compile(varName); return(NewtonCotesTrapeziumRule.IntegrateComposite(f, a, b, n)); }
public static double integral(Expr expr, string varName, double a, double b) { var f = expr.Compile(varName); return(Integrate.OnClosedInterval(f, a, b)); }
public static double fourthDerivative(Expr expr, string varName, double x) { var f = expr.Compile(varName); return(Differentiate.SecondDerivative(Differentiate.SecondDerivativeFunc(f), x)); }
public static double firstDerivative(Expr expr, string varName, double x) { var f = expr.Compile(varName); return(Differentiate.FirstDerivative(f, x)); }