3d plot of a wave equation solution

18 ビュー (過去 30 日間)
Youssef FAKHREDDINE
Youssef FAKHREDDINE 2019 年 7 月 4 日
回答済み: darova 2019 年 7 月 4 日
Hi everybody,
after solving it a wave equation with separation of variables
I find the solution
with :
and i want to have a 3 d graph for for example for u(x,y,1,1) but I find it very difficult to do it.
i did this but it doesn't work:
clear all;close all;clc;
x=[0:.1:5];y=[0:.1:5];
[X,Y] = meshgrid(x,y);
for n=1:20
for m=1:20
for k=1:20
fun = @(a) sin((n*pi/5)*a);
fun2 = @(c) sin((m*pi/5)*c)*integral(fun,0,5);
fun3 = @(c) sin(k*c)*integral(fun,0,5);
Z1(n,m,k)=(8/(3*(10^8)*5*5*sqrt(1+((m*pi)/5)^2+((n*pi)/5)^2)))*...
integral(fun3,0,10)*sin(3*(10^8)*sqrt(k^2+(m*pi/5)^2+(n*pi/5)^2))*...
(sin((n*pi/5).*X)*sin((m*pi/5).*Y)*sin(k));
end
end
end
for n=1:20
for m=1:20
for m=1:20
Z=Z+Z1(n,m,k);
end
end
end
mesh(X,Y,Z)
please if anyone can help me
  2 件のコメント
darova
darova 2019 年 7 月 4 日
You have in the second expression. It has no result. Am i wrong?
Youssef FAKHREDDINE
Youssef FAKHREDDINE 2019 年 7 月 4 日
i think i must switch the infinty by a number λ for example which is big enough .
or bigger enought than 5 because i'm studing this wave in a rectangular wave guide a waveguide that is section and which is of great depth like a tunel.

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

採用された回答

darova
darova 2019 年 7 月 4 日
I used formula to generate x,y,z (t=1) and u0 = u(x,y,z,1) as color? Calculation takes some time. How to vectorize it?
That is what i got
img.png

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by