Integration of a function given by a table
- From: "Michael O'Leary" <moonoleary@xxxxxxxxxxxxx>
- Date: Mon, 3 Oct 2005 23:05:45 -0400
Frustrated by my attempts to integrate a function with respect x,
which contains a function containing several functions with definite
integrals with respect to z, by means of nested functions, I have
decided to generate a table of values in the hopes that I could
integrate that table. Here's what I mean:
clear;
l = 1;
eta = 3.32890;
lam = 0.8776;
x = 0:0.017552:lam;
for j = 1:51
if x(j)==lam
G2(j)= 0
else
c2 = @(z)z.^2./sqrt(z.^2-x(j).^2);
c3 = @(z)lam.*sqrt(z.^2-x(j).^2)./(z.*sqrt(z.^2-lam.^2));
c4 = @(z)(z.^2)./sqrt(z.^2-x(j).^2);
c5 = @(z)z.*sqrt(z.^2-lam.^2)./(lam.*sqrt(z.^2-x(j).^2));
G2(j) = 2./(lam.*l).*quad(c2,x(j).*(1+eps), lam.*(1-eps));
G3(j) = (2./l).*quad(c3, lam.*(1+eps), l.*(1-eps));
G4(j) = (2./(l.*lam)).*quad(c4, lam.*(1+eps), l.*(1-eps));
G5(j) = (2./l).*quad(c5, lam.*(1+eps), l.*(1-eps));
Wp(j)=(2*asin(lam./l).*sqrt(1-(x(j)./l).^2)+(- G2(j) + G3(j)
- G4(j) + G5(j)))./pi
end
end
With these points I get a perfectly good curve. How can I define this
table of values as a function so that I can then integrate it from
zero to lam?
Michael
.
- Follow-Ups:
- Re: Integration of a function given by a table
- From: Michael O'Leary
- Re: Integration of a function given by a table
- Prev by Date: Re: How to store multiple images using Image Processing Toolbox
- Next by Date: NN tool box
- Previous by thread: Processors
- Next by thread: Re: Integration of a function given by a table
- Index(es):
Relevant Pages
|
Loading