how can i plot radiation pattern in cartesian coordinate in matlab ?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
채택된 답변
sixwwwwww
2013년 10월 13일
Dear Naveedp, here is the code you can use for plotting:
theta = -90:90;
theta_rad = degtorad(theta);
r = 1;
elevation = 0;
[x,y,z] = sph2cart(theta_rad,elevation,r);
E_theta = 1j * 30 * exp(-1j * 2 * pi) * sin(5 * pi * sin(theta)) ./ (5 * pi * sin(theta));
E_phi = 1j * 30 * exp(-1j * 2 * pi) * cos(theta) .* sin(3 * pi * sin(theta)) ./ (3 * pi * sin(theta));
figure, subplot(2,1,1), plot3(x, y, abs(E_theta)), xlabel('x'), ylabel('y'), zlabel('z'), title('E(theta) amplitude')
subplot(2,1,2), plot3(x, y, angle(E_theta)), xlabel('x'), ylabel('y'), zlabel('z'), title('E(theta) phase')
figure, subplot(2,1,1), plot3(x, y, abs(E_phi)), xlabel('x'), ylabel('y'), zlabel('z'), title('E(phi) amplitude')
subplot(2,1,2), plot3(x, y, angle(E_phi)), xlabel('x'), ylabel('y'), zlabel('z'), title('E(phi) phase')
Since, I did't see use of angle phi so I assumed it to be 0 and assumed value of radius to be 1. I hope it will help you
댓글 수: 12
You should keep the original equations and you can put them here in a nice way like code(as me and Youssef) did so that I can solve it. You can make your code nicer by first putting code here then selecting it and then press "{}Code" button to make it nicer. Also try to put the values for "phi" and "radius" as well then I will try to solve it for you
Dear Navdeep, for value of phi = 0 we get Y = 0 because sin(0) = 0 so we can't evaluate sin(Y) / Y and for phi = 90 we get X = 0 because cos(90) = 0 so we can't evaluate sin(X) / X. So in both of these "phi" cases we can't evaluate the equations. So what do you suggest? Should we calculate E_theta and E_phi for values of phi other than 0 and 90?
Ok I got it you want it to use L'Hospital's Rule. I try to formulate it now
Dear Navdeep, here is your code:
r = 1;
theta_degree = -90:90;
theta = degtorad(theta_degree);
theta = theta(theta ~= 0);
phi_degree = [0 90];
phi = degtorad(phi_degree);
for i = 1:length(phi)
if phi_degree(i) == 0
Y = 0;
sinYY = 1;
else
Y = 5 * pi * sin(theta) * sin(phi(i));
sinYY = sin(Y) ./ Y;
end
if phi_degree(i) == 90
X = 0;
sinXX = 1;
else
X = 3 * pi * sin(theta) * cos(phi(i));
sinXX = sin(X) ./ X;
end
E_theta = (1j / r) * 30 * exp (-1j * 2 * pi) * sin(phi(i)) * sinXX * sinYY;
E_phi = (1j / r) * 30 * exp(-1j * 2 * pi) * cos(theta) * cos(phi(i)) .* sinXX .* sinYY;
[x,y,z] = sph2cart(theta,phi(i),r);
figure, plot3(x, y, abs(E_theta)), xlabel('x'), ylabel('y'), zlabel('E(theta) amplitude'), title(strcat('E(theta) amplitude for phi =',...
num2str(phi_degree(i))))
figure, plot3(x, y, angle(E_theta)), xlabel('x'), ylabel('y'), zlabel('E(theta) phase'), title(strcat('E(theta) amplitude for phi =',...
num2str(phi_degree(i))))
figure, plot3(x, y, abs(E_phi)), xlabel('x'), ylabel('y'), zlabel('E(phi) amplitude'), title(strcat('E(phi) amplitude for phi =',...
num2str(phi_degree(i))))
figure, plot3(x, y, angle(E_phi)), xlabel('x'), ylabel('y'), zlabel('E(phi) phase'), title(strcat('E(phi) amplitude for phi =',...
num2str(phi_degree(i))))
end
If you can't understand something, feel free to ask. Also if you like my answer then accept the answer to make others to find the solution as well if they are looking for similar question. Good luck!
Dear Navdeep, now see this code, it will give you exact output as you need:
r = 1;
theta_degree = -90:0.01:90;
theta = degtorad(theta_degree);
theta = theta(theta ~= 0);
phi_degree = [0 90];
phi = degtorad(phi_degree);
for i = 1:length(phi)
if phi_degree(i) == 0
Y = 0;
sinYY = 1;
else
Y = 5 * pi * sin(theta) * sin(phi(i));
sinYY = sin(Y) ./ Y;
end
if phi_degree(i) == 90
X = 0;
sinXX = 1;
else
X = 3 * pi * sin(theta) * cos(phi(i));
sinXX = sin(X) ./ X;
end
E_theta = (1j / r) * 30 * exp (-1j * 2 * pi) * sin(phi(i)) * sinXX * sinYY;
E_phi = (1j / r) * 30 * exp(-1j * 2 * pi) * cos(theta) * cos(phi(i)) .* sinXX .* sinYY;
[x,y,z] = sph2cart(theta,phi(i),r);
figure, plot3(x, y, abs(E_theta)), xlabel('x'), ylabel('y'), zlabel('E(theta) amplitude'), title(strcat('E(theta) amplitude for phi =',...
num2str(phi_degree(i)))), view([90 0])
figure, plot3(x, y, abs(E_phi)), xlabel('x'), ylabel('y'), zlabel('E(phi) amplitude'), title(strcat('E(phi) amplitude for phi =',...
num2str(phi_degree(i)))), view([90 0])
end
Feel free to ask if you can't understand anything
If you tell me how to convert current scale in graph to "dB" scale then I can do it. I mean what is the formula to convert amplitude in to dB units?
no we are plotting them separately. do you want to plot them combined?
Navdeep we can plot combine. but i checked that graph doesn't look good in dB scale. It doesn't look like the figure you attached. So what you say?
I did but it doesn't look good. But maybe you can also try by yourself. Here is the code:
r = 1;
theta_degree = -90:0.01:90;
theta = degtorad(theta_degree);
theta = theta(theta ~= 0);
phi_degree = [0 90];
phi = degtorad(phi_degree);
for i = 1:length(phi)
if phi_degree(i) == 0
Y = 0;
sinYY = 1;
else
Y = 5 * pi * sin(theta) * sin(phi(i));
sinYY = sin(Y) ./ Y;
end
if phi_degree(i) == 90
X = 0;
sinXX = 1;
else
X = 3 * pi * sin(theta) * cos(phi(i));
sinXX = sin(X) ./ X;
end
E_theta = (1j / r) * 30 * exp (-1j * 2 * pi) * sin(phi(i)) * sinXX * sinYY;
E_phi = (1j / r) * 30 * exp(-1j * 2 * pi) * cos(theta) * cos(phi(i)) .* sinXX .* sinYY;
E = E_theta + E_phi;
E_dB = 10 * log(E);
[x,y,z] = sph2cart(theta,phi(i),r);
figure, plot3(x, y, abs(E)), xlabel('x'), ylabel('y'), zlabel('Radiation Intensity'), title(strcat('Radiation Intensity at phi=',...
num2str(phi_degree(i)))), view([90 0])
figure, plot3(x, y, abs(E_dB)), xlabel('x'), ylabel('y'), zlabel('Radiation Intensity [dB]'), title(strcat('Radiation Intensity at phi=',...
num2str(phi_degree(i)))), view([90 0])
end
You will get 4 figures. second and fourth figures are in dB scales
Here is your code:
r = 1;
theta_degree = -90:0.01:90;
theta_degree = theta_degree(theta_degree ~= 0);
theta = degtorad(theta_degree);
phi_degree = [0 90];
phi = degtorad(phi_degree);
for i = 1:length(phi)
if phi_degree(i) == 0
Y = 0;
sinYY = 1;
else
Y = 5 * pi * sin(theta) * sin(phi(i));
sinYY = sin(Y) ./ Y;
end
if phi_degree(i) == 90
X = 0;
sinXX = 1;
else
X = 3 * pi * sin(theta) * cos(phi(i));
sinXX = sin(X) ./ X;
end
E_theta = (1j / r) * 30 * exp (-1j * 2 * pi) * sin(phi(i)) * sinXX * sinYY;
E_phi = (1j / r) * 30 * exp(-1j * 2 * pi) * cos(theta) * cos(phi(i)) .* sinXX .* sinYY;
E = E_theta + E_phi;
E = E / max(E);
E_dB = 10 * log(E);
figure, plot(theta_degree, abs(E)), xlabel('Angle [theta]'), ylabel('Normalized Radiation Intensity'), title(strcat('Radiation Intensity at phi=',...
num2str(phi_degree(i))))
figure, plot(theta_degree, abs(E_dB)), xlabel('Angle [theta]'), ylabel('Normalized Radiation Intensity [dB]'),...
title(strcat('Radiation Intensity at phi=', num2str(phi_degree(i))))
end
I forgot to ask you. Is it your homework? Tell me truly hahhahha
hahahhaha. It's not fair you should have told me before and now I should get marks instead of you. lolx. You can add grid the following way:
figure, plot(theta_degree, abs(E)), xlabel('Angle [theta]'), ylabel('Normalized Radiation Intensity'), title(strcat('Radiation Intensity at phi=',...
num2str(phi_degree(i)))), grid on
Hey sixwwwwww, I need to plot the two-way radiation pattern of a planar array for my SAR antenna for both elevation and azimuth. The figures are necessary as input to my Noise Equivalent Sigma Zero (NESZ) computation. Can you please help?
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Time Series Events에 대해 자세히 알아보기
태그
아직 태그를 입력하지 않았습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
