Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.symbolic.independent

Topic: Numerical integration with maxima
Replies: 4   Last Post: Nov 7, 2012 3:21 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Claude

Posts: 2
Registered: 11/6/12
Re: Numerical integration with maxima
Posted: Nov 7, 2012 3:21 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Thank you all for your help !

claude

James Cloos wrote:

>>>>>> "C" == Claude <claude@nospam.invalid> writes:
>
> Just a couple of notes:
>
> C> I've defined the function
> C> f=abs(sin(x))
>
> Use either:
>
> f:abs(sin(x));
>
> or:
>
> f(x):=abs(sin(x));
>
> C> integrate(f, x, 0, 2*pi)
>
> Use 2*%pi.
>
> C> But now I don't know how to numerically evaluate this integral.
>
> More importantly, integrate() is for symbolic integration. For
> numerical integration use quad_qag() and the related functions.
>
> Try:
>
> quad_qag(abs(sin(x)), x, 0, 2*%pi, 2);
>
> for a 2nd order approximation. I get the result:
>
> [4.0, 4.440892098500626e-14, 63, 0]
>
> the values in the list are theapproximation, the approx error, the
> number of evaluations and an error code. 0 means no error. So the
> result is 4.0 +- 4.440892098500626e-14.
>
> Try:
>
> ? quad_qag
>
> and:
>
> ?? QUADPACK
>
> in maxima.
>
> Or read the QUADPACK sections of the info or printable manual.
>
> -JimC





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.