help-octave
[Top][All Lists]
Advanced

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

Re: complex integral or multiple integral


From: John Smith
Subject: Re: complex integral or multiple integral
Date: Wed, 1 Mar 2000 08:47:30 +0000 (GMT)

A small part of your problem is solved by doing
doing Octave integrals with commands like

  octave>  quad("sin",0,3*pi)
  ans = 2.000000000

If you want to do complex integrals you need to a sequence of 
commands like

  function a = my_complex_function(t)
    a = exp(i*t) ;
  endfunction

  function ar = real_part( t )
    ar = real( my_complex_function( t )) ;
  endfunction

  function ai = imag_part( t )
    ai = imag( my_complex_function( t )) ;
  endfunction

  real_integral = quad( "real_part", here, there ) ;
  imag_integral = quad( "imag_part", here, there ) ;

  complex_answer = real_integral + imag_integral ;

Hope this sheds some light,

  John






-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

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