<dependency>
    <groupId>com.huramkin.toolbox</groupId>
    <artifactId>toolbox</artifactId>
    <version>1.0.0.1.2-RELEASE</version>
</dependency>

用例

import com.huramkin.definite_integral_calculation.DefiniteIntegralCalculation;
import com.huramkin.math_function.Function;

import java.math.BigDecimal;

public class Test {
    public static void main(String[] args) {
        String result = DefiniteIntegralCalculation.definiteIntegralCalculation(new Function() {
            @Override
            public BigDecimal[] mathFun(BigDecimal[] x) {
                BigDecimal[] y = new BigDecimal[x.length];
                for (int i = 0; i < x.length; i++) {
                    double temp = 0;
                    temp = Math.pow(x[i].doubleValue(), 9);
                    temp = temp + x[i].doubleValue();
                    y[i] = new BigDecimal(temp);//y=x^9+x
                }
                return y;
            }
        }, 2, 0, 0.000001);
        System.out.println("y=x^9+x in [0,2] DefiniteIntegral result is "+ result);
    }
}
Last modification:June 8th, 2021 at 05:22 pm
If you think my article is useful to you, please feel free to appreciate