Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6505
| From | "J. Jesús Rico Melgoza" <jerico@umich.mx> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | NIntegrate to compute LegendreP approximations to functions |
| Date | 2011-11-18 11:26 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <ja5fd6$6dl$1@smc.vnet.net> (permalink) |
Hello
I am approximating general scalar functions via orthogonal series. I am
using LegendreP polynomials.
As an example, I have approximated a Sign function. The coefficients
have been calculated as follows:
n = 20;
u = Sign[t];
N[Table[(2 k + 1)/2 Integrate[u LegendreP[k, t], {t, -1, 1}], {k, 0,
n}]]
Everything works well but I would like to speed up computations since
for large values of n, Integrate takes long computations times. I need
to speed up the process since in general I will be approximating
multi-variable functions. I have tried NIntegrate but I get multiple
messages such as
NIntegrate::slwcon : "Numerical integration converging too slowly;
suspect \
one of the following: singularity, value of the integration is 0, highly
\
oscillatory integrand, or WorkingPrecision too small. =91=99=98ButtonBox["
",
Appearance->{Automatic, None},
BaseStyle->"Link",
ButtonData:>"paclet:ref/message/NIntegrate/slwcon",
ButtonNote->"NIntegrate::slwcon"]"
NIntegrate is a very complete function in Mathematica, so much that it
has been rather difficult to find an adequate combination of a method
and a strategy of integration that would improve the timing of
Integrate.
Could anyone give me some advice?
Jesus Rico-Melgoza
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
NIntegrate to compute LegendreP approximations to functions "J. Jesús Rico Melgoza" <jerico@umich.mx> - 2011-11-18 11:26 +0000 Re: NIntegrate to compute LegendreP approximations to functions "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-11-23 12:09 +0000
csiph-web