help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intergration help required


From: Jordi Gutiérrez Hermoso
Subject: Re: Intergration help required
Date: Fri, 27 Jul 2012 09:54:23 -0400

On 27 July 2012 09:38, Mahvish Nazir <address@hidden> wrote:
> can u[sic] please tell me how to do the integration(numerical) for:
> (cos(10^11*pi*(t-(0.12*10^(-6)))^2))^2*exp(i*14.178*t) over the liits -5 to
> 5

Your function oscillates far too quickly on the given domain to
perform a good numerical integration, but you can attempt it:

    f = eval(vectorize("@(t)
(cos(10^11*pi*(t-(0.12*10^(-6)))^2))^2*exp(i*14.178*t)"))
    quadgk(f, -5, 5)
    quadv(f, -5, 5)

You should play with the parameters for quadgk and quadv to get a
better approximation.

HTH,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]