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: Stephen Montgomery-Smith
Subject: Re: complex line integral in octave
Date: Thu, 11 Apr 2013 10:40:46 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 04/11/2013 09:26 AM, Urs Hackstein wrote:
> Dear list,
> 
> I am looking for the most efficient and stable way to calculate a
> complex line integral using octave.
> 
> Let f(s) be a polynomial in the complex variable s, without restriction
> of degree 7. Let the curve \alpha be the edges of the rectangle with
> vertices s_d-10.^8, s_d+10.^8, s_d+10.^8+i*w_max, s_d-10.^8+i*w_max
> where s_d and w_max are arbitrary real numbers. Then we want to
> calculate the integral over s .* f ' (s)/f(s) with respect to the curve
> \alpha. How can this calculation be done the most efficient and stable way?

These are just random thoughts (i.e. I didn't try this).  Also, what
does the .* mean in this context?

I thought about the problem as I wrote the email, and I am writing this
sentence last.  I think the best method is to approximate the curve
f(alpha) by a polygonal curve, and use the algorithm described at the
very end of this email.

Method 1.  I would parametrize the curve as alpha(t) for a<=t<=b.  In
this case it will simply be a piecewise linear function.  Then use any
of the built in integration commands in octave to compute

int_a^b  f'(alpha(t))/f(alpha(t)))  alpha'(t)  dt

Next (presuming that the .* doesn't mean anything special), we know from
complex function theory that the integral will be 2 pi I times the
number of roots of f(s) inside the rectangle.  So divide by 2 pi I and
round to the nearest integer.

If one of the roots of f(s) happens to lie on the curve, then the
numerical integral should give some kind of error message.  And your
integral will not be well defined.  (You could define a "principle
value" for the integral, but I don't see a way of doing this without
knowing the value of the root.  Then I think it counts as adding pi*I to
the value, but I must admit I am not entirely sure.)

Method 2.  Another way to compute the integral would be to identify the
all the roots of f(s) (there will be exactly seven of them), see how
many of those roots lie inside the rectangle (count by multiplicity),
and then multiply that by 2 pi I.

http://en.wikipedia.org/wiki/Argument_principle

Another way would be to use the formula that the antiderivative of
f'(alpha(t))/f(alpha(t)))  alpha'(t) is log(f(alpha(t)).  But then you
have to be very careful because the logarithm isn't well defined on the
complex plane, and so you have to pick a value that is continuous along
the whole curve.  It is the imaginary part of the logarithm that will be
very hard to trace, and this is probably much harder to do than you
think, and the only proper way to keep track of this is to use:

Method 3.  Look at the curve f(alpha(t)), and see how many times it
winds around the origin, and then multiply that by 2 pi I.

http://www.engr.colostate.edu/~dga/dga/papers/point_in_polygon.pdf

(I found this by googling "winding number.")


reply via email to

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