field radiation pattern generation

please help me in writing code for attached file. i have written code like below but it is taking many hours for execution. so please help me for fast execution of equation in the attached file.
code i have written is
theta=[-90:0.01:90];
syms x
L=5;
A(x)=sym(1-(2*x/L)^2);
A(x)=(1-(2*x/L)^2);
phi(x)=sym(0)
phi(x)=0;
u=sin(theta);
fun=(A(x)*(exp((j*pi*10)*((u*x)+phi(x)))));
E= int(fun,x,-1,1)
Edb=20*log10(E);
plot(u,Edb);
grid on
title("radiation pattern");
help me what modifications i have to do for fast execution of this code

2 件のコメント

Image Analyst
Image Analyst 2021 年 3 月 15 日
Does it have to be symbolic, or can we do it numerically where you define some range for your input?
darova
darova 2021 年 3 月 17 日
@ramya k comment's moved here
we have to write numerically and we should get plot for that
please verify the attached file.. in that electric field equation available.. we have to execcute that equation.

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

 採用された回答

darova
darova 2021 年 3 月 17 日

0 投票

Use trapz
t = -90:90; % i choosed step 1
x = -1:0.1:1);
[T,X] = meshgrid(t,x);
u = sin(T);
A = ...%
fun = A.*exp(...);
E = trapz(x,fun,1);
plot(t,E)

7 件のコメント

ramya k
ramya k 2021 年 3 月 18 日
tq for your idea, but i didnt get proper pattern, i got some scattered pattern when wrtten code according to your idea. i have uploaded required model pattern and what i got now. i am very new the matlab so please help me.
darova
darova 2021 年 3 月 18 日
please attach the code
ramya k
ramya k 2021 年 3 月 19 日
please find the code
darova
darova 2021 年 3 月 19 日
Range of X axis is [-1 1] here. BUt it's impossible since it's range of (x is integration variable, it disappears after integration)
The code and formulas are also not identical. but you assumed A=1 in your code
Can you collaborate?
ramya k
ramya k 2021 年 3 月 22 日
A means amplitude, it can be anything like constant or circle or parabola. thats y i have taken constant as 1 in first execution.
darova
darova 2021 年 3 月 22 日
i made some correction to your code
clc,clear
t = -90:90;
x = -1:0.1:1
[T,X] = meshgrid(t,x);
u = sin(T);
A = 1;
phi = 0;
fun = A.*exp(1j*pi*10*(u.*X+phi));
E = trapz(X,fun,1);
Edb = 20*log10(E);
plot(t,E)
ramya k
ramya k 2021 年 4 月 7 日
thank you so much for your help

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2021 年 3 月 15 日

コメント済み:

2021 年 4 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by