help-octave
[Top][All Lists]
Advanced

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

Re: Intergration help required


From: Mahvish Nazir
Subject: Re: Intergration help required
Date: Tue, 24 Jul 2012 14:48:41 +0100



On Tue, Jul 24, 2012 at 2:19 PM, Juan Pablo Carbajal <address@hidden> wrote:
On Tue, Jul 24, 2012 at 2:49 PM, Mahvish Nazir <address@hidden> wrote:
> Hi
>
> Thanks a lot for your reply!
>
> I am looking for a numerical solution only, but the problem is, the values
> of my constants will keep on changing. Does that mean everytime the value of
> my constant changes i have to write a new program to compute its numerical
> value?
> And what do you mean by "choose a discretisation of the integration domain"?
> Please explain.
>
> Thanks and Regards
> Mahvish
>
> On Tue, Jul 24, 2012 at 1:18 PM, Jordi Gutiérrez Hermoso
> <address@hidden> wrote:
>>
>> On 24 July 2012 07:26, haazu <address@hidden> wrote:
>> > Hi I am new to Octave, trying to solve the below integral in octave.
>> > please
>> > help: http://octave.1599824.n4.nabble.com/file/n4631617/Untitled.png
>> > The limits are -5 to +5,
>> > I am solving a problem relating to radar and came up with this
>> > integral...
>> > Any clue how to solve this?
>>
>> What does a "solution" mean to you? If you want symbolic integration,
>> Octave is the wrong tool for the task, because it's not a CAS.
>>
>> If you want numerical integration, then you need to assign values to
>> the constants and choose a discretisation of the integration domain.
>> Then use one of the quad function.
>>
>> HTH,
>> - Jordi G. H.
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

Please post your answer at the bottom of the email so people jumping
in into the conversation can follow easily.

I do to fully understand what do you mean, but lets say you want to integrate

\int_0^T cos(w*t)^2 dt

and let say T = 1, and w=3.

You could do

integrand = @(t) cos (3*t).^2
value = quadgk (integrand, 0, 1);

then value will contain the value of the integral.

If the coefficient, instead of being a constant, was a function of
time itself, lets say w = sin(10*t). You need to replace it and you
could do

integrand = @(t) cos (sin(10*t).*t).^2
value = quadgk (integrand, 0, 1);

There are many fuctions to do numerical integration depending on the
properties of your integrand. Please check the help of the function
you decide to use to make sure the result is correct. To get help for
quadgk type

help quadgk


--
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/

Should I use quadc? as the last part of my integral has a complex number?
reply via email to

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