How do I evaluate this integral?
1 回表示 (過去 30 日間)
古いコメントを表示
I have the following function.
function height = mount(x,y)
bach = 2000.*1./exp((1.1.*sqrt((x-1).^2+(y-3.5).^2)).^2)
beeth = 2000.*1./exp((2.*(sqrt((x-4.5).^2+(y-1.5).^2))).^2)
hay = -950.*1./exp((1*(sqrt((x-2.8).^2+(y-3.7).^2))).^2)
ridge = 1000.*(1/(1+(1.5*(sqrt((x-2.5).^2+(y-1.8).^2))).^2))
moz = 1500.*(1/(1+(1.1.*(sqrt((x-3).^2+(y-2).^2))).^2))
han = 3500.*(1/sqrt(1+(1.9.*sqrt((x-1).^2+(y-1).^2)).^2))
schu = 2000.*(1/sqrt(1+(2.*sqrt((x-4.25).^2+(y-4.1).^2)).^2))
prae = 200.*sqrt(1+(0.5.*sqrt((x-2.75).^2+(y-3.75).^2)).^2)
main = 7000
height = bach+beeth+hay+ridge+moz+han+schu+prae+main
end
I need to evaluate the integral over the region 0<x<5, 0<y<5, and 0<z<height. I was thinking of doing a double integral by using integral2(height1,0,5,0,5). I created an anoymous function(height 1) of the original function (height); however, matlab is saying that my bounds must be a function of eachother. I am stuck. Help would be appreciated :)
syms x y
height1 =@(x,y) 2000.*1./exp((1.1.*sqrt((x-1).^2+(y-3.5).^2)).^2) + 2000.*1./exp((2.*(sqrt((x-4.5).^2+(y-1.5).^2))).^2) -950.*1./exp((1*(sqrt((x-2.8).^2+(y-3.7).^2))).^2) + 1000.*(1/(1+(1.5*(sqrt((x-2.5).^2+(y-1.8).^2))).^2)) + 1500.*(1/(1+(1.1.*(sqrt((x-3).^2+(y-2).^2))).^2)) + 3500.*(1/sqrt(1+(1.9.*sqrt((x-1).^2+(y-1).^2)).^2)) + 2000.*(1/sqrt(1+(2.*sqrt((x-4.25).^2+(y-4.1).^2)).^2)) + 200.*sqrt(1+(0.5.*sqrt((x-2.75).^2+(y-3.75).^2)).^2) + 7000
integral2(height1,0,5,0,5)
0 件のコメント
回答 (2 件)
JESUS DAVID ARIZA ROYETH
2019 年 11 月 10 日
solution:
height1 =@(x,y) 2000.*1./exp((1.1.*sqrt((x-1).^2+(y-3.5).^2)).^2) + 2000.*1./exp((2.*(sqrt((x-4.5).^2+(y-1.5).^2))).^2) -950.*1./exp((1*(sqrt((x-2.8).^2+(y-3.7).^2))).^2) + 1000.*(1/(1+(1.5*(sqrt((x-2.5).^2+(y-1.8).^2))).^2)) + 1500.*(1/(1+(1.1.*(sqrt((x-3).^2+(y-2).^2))).^2)) + 3500.*(1/sqrt(1+(1.9.*sqrt((x-1).^2+(y-1).^2)).^2)) + 2000.*(1/sqrt(1+(2.*sqrt((x-4.25).^2+(y-4.1).^2)).^2)) + 200.*sqrt(1+(0.5.*sqrt((x-2.75).^2+(y-3.75).^2)).^2) + 7000
height1=str2func(vectorize(height1));
integral2(height1,0,0.5,0,0.5,'Method','iterated')
0 件のコメント
Walter Roberson
2019 年 11 月 10 日
You missed converting some / into ./
height1 =@(x,y) 2000.*1./exp((1.1.*sqrt((x-1).^2+(y-3.5).^2)).^2) + 2000.*1./exp((2.*(sqrt((x-4.5).^2+(y-1.5).^2))).^2) -950.*1./exp((1*(sqrt((x-2.8).^2+(y-3.7).^2))).^2) + 1000.*(1./(1+(1.5*(sqrt((x-2.5).^2+(y-1.8).^2))).^2)) + 1500.*(1./(1+(1.1.*(sqrt((x-3).^2+(y-2).^2))).^2)) + 3500.*(1./sqrt(1+(1.9.*sqrt((x-1).^2+(y-1).^2)).^2)) + 2000.*(1./sqrt(1+(2.*sqrt((x-4.25).^2+(y-4.1).^2)).^2)) + 200.*sqrt(1+(0.5.*sqrt((x-2.75).^2+(y-3.75).^2)).^2) + 7000
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!