help-octave
[Top][All Lists]
Advanced

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

Re: complex line integral in octave


From: Urs Hackstein
Subject: Re: complex line integral in octave
Date: Tue, 16 Apr 2013 17:12:53 +0200

Dear Carlo,

thanks a lot for your suggestion which works well for the first edge of the rectangle. If I take the second edge, the function to integrate takes complex values and octave informs me that it will ignore the imaginary part. Have I thus to split up the integral into real resp. imaginary part after all while Stephen pointed out that this is not necessary? Or is there another routine than quad which allows to compute complex integrals directly?


2013/4/16 c. <address@hidden>

On 16 Apr 2013, at 00:02, Stephen Montgomery-Smith <address@hidden> wrote:

> This is a programming issue, not mathematics.  If you look at "help
> quad" you will see that the function takes only one parameter.  The
> other parameters, La,Lb,Lc,Ia,Ib,Ic,RC, will have to be passed in some
> other manner.  My suggestion would be to use global variables.

the recommended way of doing this is by using a specialized anonymous
function rather than global variables, i.e. something like:

function g1=complexfunction1(La,Lb,Lc,Ia,Ib,Ic,RC,t)
 ...
endfunction


qaud (@(t) complexfunction1(La,Lb,Lc,Ia,Ib,Ic,RC,t), tmin, tmax)

c.


reply via email to

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