Having problems with this triple integral

I'm trying to solve this problem. Here's my code:
%44
fun = @(x,y,z) 1./(x.^2 + y.^2);
xmin = -1;
xmax = 1;
ymin = 0;
ymax = @(x) sqrt(1-x.^2);
zmin = 0;
zmax = @(x,y) y;
q= integral3(fun,xmin,xmax,ymin,ymax,zmin,zmax)
and this runs into and error saying that it reached the maximum number of function evalutions and failed the global error test. Can anyone tell me what did I do wrong?

回答 (2 件)

Bianca Drumea
Bianca Drumea 2022 年 3 月 23 日

0 投票

Are you missing a semicolon on the final line?
Carlos Guerrero García
Carlos Guerrero García 2022 年 11 月 24 日
編集済み: Carlos Guerrero García 2022 年 11 月 24 日

0 投票

The exercise ask for the evaluation using cylindrical coordinates and you're not using cylindrical coordinates in your code. Also, note that the origin belongs to Omega but the function 1/(x^2+y^2) is undefined in that point (i.e. you've got an improper integral right there)
Also, notice that your code works fine (although without cylindrical coordinates) changing "ymin=0" with "ymin=0.1", or "ymin=0.01", or "ymin=0.001", or "ymin=0.0001", ...
What do you think about the limit when "y" tends to cero?

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

リリース

R2021a

質問済み:

2021 年 5 月 15 日

編集済み:

2022 年 11 月 24 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by