help-octave
[Top][All Lists]
Advanced

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

## Re: [Maxima-discuss] dblquad fail

 From: Doug Stewart Subject: Re: [Maxima-discuss] dblquad fail Date: Wed, 27 Jul 2016 22:54:16 -0400

On Wed, Jul 27, 2016 at 10:32 PM, Doug Stewart wrote:

On Wed, Jul 27, 2016 at 9:57 PM, Ether Jones wrote:
Hello.

I am trying to numerically integrate a function using dblquad, but getting errors shown below.  Thank you.

octave-3.6.4.exe:3> I = dblquad(@(r,q)r*sqrt(r^2+1-2*cos(2*pi()*q)),0,1,0,1)
error: for A^b, A must be a square matrix
error: evaluating argument list element number 1
error: called from:
error:    at line -1, column -1
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 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

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave

I don't know what you want, but maybe this will help.

>> I = dblquad(@(r,q)abs( r.*sqrt(r.^2+1-2*cos(2*pi*q))),0,1,0,1)
I =  0.58663

--
DAS

This might also help:

r=0:.01:1;
q=0:.01:1;
[xx yy]=meshgrid(r,q);

ff= @(r,q)abs( r.*sqrt(r.^2+1-2*cos(2*pi*q)))
zz=ff(xx,yy);
mesh(xx,yy,zz) # this shows the surface that we are using.

I = dblquad(@(r,q)abs( r.*sqrt(r.^2+1-2*cos(2*pi*q))),0,1,0,1)

--
DAS

reply via email to

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