Numerical integration methods
|
07-18-2022, 08:13 PM
(This post was last modified: 07-25-2022 05:02 PM by Albert Chan.)
Post: #2
|
|||
|
|||
RE: Numerical integration methods
When I tried this, integral gives an warning "Adaptive method failure, will try with Romberg ..."
So, the trick is to "adapt" manually, by splitting the integral. CAS> f(x) := x^2 * expm1(1/x^3) CAS> int(f(x), x, 1., 20.), int(f(x), x, 20., 100.) [3.19558488078, 1.60945857854] ∫ + ∫ = 4.80504345932 Udpate: I increased HOME eps setting to 1e-9 (default was 1e-12) CAS> int(f(x), x, 1., 100.) 4.80504345904 --- I had translated robve's double exponential quadrature code for HP Prime, here CAS> quad(f, 1, 100) [4.80504346031, 4.01306988706e−11] quad(f,a,b) was defaulted with eps = 1e-9, thus slight error on last digit. CAS> quad6(f, 1, 100, 1, 6, 1e-12) [4.80504346032, 1.28096166025e−13] |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)