フィルターのクリア

solving a triple sigma equation (or triple integral)

1 回表示 (過去 30 日間)
형준 이
형준 이 2022 年 7 月 14 日
コメント済み: 형준 이 2022 年 7 月 18 日
above equation is what i want to express by mathlab code
for definite the A(x,y,z)
A(x,y,z) : random size 3-D vector 00x00x00 (but example is 6x61x17)
below is my try, but i think that is not correct
it is hard to make code... please somebody help me
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clear
% for A = 6 x 61 x 17 (3-d vector)
A = ones(6,61,17);
k = linspace(10.4, 31.4, 6);
pii = linspace(0, pi, 61); % pii = 𝝓
E = linspace(-2, 2, 17);
for x = 1:6
for y = 1:61
for z = 17
for f = 1:6
for p = 1:61
for e = 1:17
A(x,y,z) = A(x,y,z) + (k(f)).^2 * (1/(norm([x y z]-[cos(pii(p)) sin(pii(p)) E(e)]))) * (1-cos(pii(p))-sin(pii(p))) * exp(1i*k(f)*(((norm([x y z]-[cos(pii(p)) sin(pii(p)) E(e)])))-1));
end
end
end
end
end
end
  5 件のコメント
형준 이
형준 이 2022 年 7 月 15 日
thankyou for your reply
I understand your question
In the original triple integral equation, the integral range is from 0 to inf, 0 to 2*pi, -inf to inf,
but the actual values inserted on equation are finite discrete samples.
Therefore, I transformed the expression to the sigma symbol instead of the integral.
There are 6 smaples of k, 61 of 𝝓, 17 of E which are actually used.
Torsten
Torsten 2022 年 7 月 15 日
When you approximate an integral by a sum, there must appear terms of the form
(k(i+1)-k(i))*(phi(j+1)-phi(j))*(E(n+1)-E(n))
for the volume element in which you evaluate the function.
I don't see this volume element in your finite sum.

サインインしてコメントする。

採用された回答

Chunru
Chunru 2022 年 7 月 15 日
% for A = 6 x 61 x 17 (3-d array)
A = ones(6,61,17);
k = linspace(10.4, 31.4, 6);
pii = linspace(0, pi, 61); % pii = 𝝓
E = linspace(-2, 2, 17);
% reshape to 3d array
k3d = reshape(k, 6, 1, 1); % along 1st dimension
p3d = reshape(pii, 1, 61, 1); % along 2nd dimension
e3d = reshape(E, 1, 1, 17); % along 3rd dimension
for x = 1:6
for y = 1:61
for z = 1:17
R = sqrt((x-cos(p3d)).^2 +(y-sin(p3d)).^2 + (z-e3d).^2);
tmp = k3d.^2 ./ R .* (1-x*cos(p3d)-y*sin(p3d)) .* exp(1i * k3d .*(R-1));
A(x,y,z) = sum(tmp, 'all');
end
end
end
imagesc(20*log10(abs(A(:, :, 8)))); % slice for z=8
  1 件のコメント
형준 이
형준 이 2022 年 7 月 18 日
i appreciate your response

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by