NIntegrate is error on Android API 19

Issue #156 closed
Former user created an issue

hello, my friend, Calculate this formula (NIntegrate (x, {x, 0,2}) on the android API19 phone, throwing StackOverflowError. But running on API 24 can get normal results.

the exception as follow: java.lang.StackOverflowError at java.util.TreeMap.findByObject(TreeMap.java:351) at java.util.TreeMap.get(TreeMap.java:177) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:95) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.commons.math4.analysis.integration.gauss.BaseRuleFactory.getRuleInternal(BaseRuleFactory.java:97) at org.apache.commons.math4.analysis.integration.gauss.LegendreRuleFactory.computeRule(LegendreRuleFactory.java:47) at org.apache.c

Comments (3)

  1. Axel Kramer repo owner

    Did you try to use another integration method instead of LegendreGauss?

    Examples:

    NIntegrate (x, {x, 0,2}, Method->Simpson)
    NIntegrate (x, {x, 0,2}, Method->Romberg)
    NIntegrate (x, {x, 0,2}, Method->Trapezoid)
    

    or something like this:

    NIntegrate (x, {x, 0,2}, MaxPoints->10)
    NIntegrate (x, {x, 0,2}, MaxIterations->1000)
    
  2. DHG

    hello, my friend, thanks, according to your answer, it can get result on android api 19, thank you very much

  3. Log in to comment