Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: double integration. numerical integration
Replies: 4   Last Post: May 30, 2012 1:32 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
prabhakaran m

Posts: 39
Registered: 9/18/10
Re: double integration. numerical integration
Posted: May 30, 2012 10:35 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Steven_Lord" <slord@mathworks.com> wrote in message <jq5829$bar$1@newscl01ah.mathworks.com>...
>
>
> "prabhakaran m" <prabha.gahon@gmail.com> wrote in message
> news:jq47qc$16c$1@newscl01ah.mathworks.com...

> > i am trying to approximate this double integrable.
> > A(l,n) = 1/(2*pi*L) int(0 , L) int ( 0, 2*pi ) w(x,y) cos( l*theta) cos( n
> > pi x/L) dx dy

>
> If you have a function with which you can compute w(x, y), use INTEGRAL2 or
> QUAD2D or DBLQUAD (depending on how old a version of MATLAB you're using.)
>
> If you don't know the form w(x, y) but you want A to be a function of w, try
> INT from Symbolic Math Toolbox. Don't expect too much unless you can provide
> it more information about w.



w(x,y) is a matrix of discrete data of size(22,73), where A(l,n) is the fourier coefficients i am trying to deduce. here is the modified code i have written first for integrals, int(0,2*pi) w(x,y)*cos(l*theta) dtheta . approximated by rectangular method


y=linspace(0,2*pi,73)
NA=length(x);
NC=length(y);

for i=1:NA
for l=1:floor(NC/2)
sum1=0;
for j=1:NC
y1=d(j,i)*cos((l-1)*y(j));
sum1=sum1+y1;
end
F(i,l)=2*pi*sum1/NC;
end
end

and then doing for int(0,L) F(i,l) *cos(k*pi*l/NA) dl approximated by trapezoidal method

for L=1:floor(NC/2)
for k = 1:floor(NA/2)
sum1=0.5*(F1(1,L)+F1(NA,L))*cos(k*pi);
for i = 2:NA-1
arg=(k-1)*pi*(i-1)/NA;
y11=F(i,L)*cos(arg);
sum1=sum1+y11
end
A(k,L)=2*sum1/(pi*(NA));
end
end

is this approximation correct.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.