Register to reply

How to draw double integral functions

by matinking
Tags: double, draw, functions, integral
Share this thread:
matinking
#1
Feb14-12, 04:55 AM
P: 17
Hi every one!

I would like to draw a double integral function in related to R and h parameters by below M-File but It does goes wrong!!!
Is there any one to correct it for me???
thank you

syms R h;

a1 = 0;

a2 = atan(R./(R+h));

r1 = h;
r2 = sqrt(R.^2+(R+h).^2);

integrand = @(r,a)(h.*sin(a)/((r.^2).*(r.^2+h.^2-2.*r.*h.*cos(a))));
f = quad2d(integrand,r1,r2,a1,a2);

ezsurf(f,[0.001,5]);
Phys.Org News Partner Science news on Phys.org
Bees able to spot which flowers offer best rewards before landing
Classic Lewis Carroll character inspires new ecological model
When cooperation counts: Researchers find sperm benefit from grouping together in mice
kai_sikorski
#2
Feb14-12, 11:02 AM
PF Gold
kai_sikorski's Avatar
P: 162
There's two problems that I can see right away (and perhaps more that I don't see). For one I'm guessing you're trying to make f a function of R and h? But you just leave them as symbolic objects. The second problem is that where you define the integrand, you need an extra "."

integrand = @(r,a)(h.*sin(a)./((r.^2).*(r.^2+h.^2-2.*r.*h.*cos(a))));

If I understand what you're trying to do correctly then this should do it:
f = @(h,R) quad2d(@(r,a)(h.*sin(a)./((r.^2).*(r.^2+h.^2-2.*r.*h.*cos(a)))),h,sqrt(R.^2+(R+h).^2),0,atan(R./(R+h)));
ezsurf(f,[0.001,5]);
When I ran it, there were a bunch of warnings but I think that may be due to a singularity in the integral you're evaluating.
matinking
#3
Feb15-12, 04:36 AM
P: 17
Thank you very much.

your correctness lets the functions be drawn!!!!!


Register to reply

Related Discussions
Reexpressing double integral using parametric functions Calculus 0
Double integration of functions involving bessel functions and cosines/sines Calculus 0
Integrating Fresnel Functions (Double Integral) Calculus & Beyond Homework 0
How to draw integral with mathematica Math & Science Software 3
How to draw the domain of a function of two variables to find the double integral Calculus & Beyond Homework 7