help-octave
[Top][All Lists]
Advanced

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

Re: [Maxima-discuss] dblquad fail


From: Tatsuro MATSUOKA
Subject: Re: [Maxima-discuss] dblquad fail
Date: Fri, 29 Jul 2016 16:50:59 +0900 (JST)

----- Original Message -----

> From: Ether Jones 
> To: help-octave
> Cc: 
> Date: 2016/7/28, Thu 20:54
> Subject: Re: [Maxima-discuss] dblquad fail
> 
> 
> Thank you.
> 
> This works:
> octave-3.6.4.exe:3>  I = dblquad(@(r,q)abs(
> r.*sqrt(r.^2+1-2*cos(2*pi*q))),0,1,0,1)
> I =  0.586626703381746
> 
> ... but this doesn't:
> octave-3.6.4.exe:4>  I =
> dblquad(@(r,q)r.*sqrt(r.^2+1-2*cos(2*pi*q)),0,1,0,1)
> error: quadcc: integrand F must return a single, real-valued vector
> error: called from:
> error:  
> K:\OctaveVS\share\octave\3.6.4\m\general\dblquad.m 
> at line 72,
> column 10
> error:    at line -1, column -1
> error: quadcc: integrand F must return a single, real-valued vector
> error:  
> K:\OctaveVS\share\octave\3.6.4\m\general\dblquad.m 
> at line 65,
> column 5
> 
> Why is the abs() necessary?
> 
As already written by some persons, the function value should be real
for all integration range.
However when example r=0.1, q=1
>> r.^2+1-2*cos(2*pi*q)
ans = -0.99000


>> sqrt (r.^2+1-2*cos(2*pi*q))
ans =  0.00000 + 0.99499i

Then
>> r.*sqrt(r.^2+1-2*cos(2*pi*q))
ans =  0.000000 + 0.099499i

pure imaginary.

Perhaps problem is not simple double integration.
(conditional integration with r and q)
I recommend you reconsider your problem in mathematical or physical sense.


Tatsuro



reply via email to

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