field radiation pattern generation

2 vues (au cours des 30 derniers jours)
ramya k
ramya k le 15 Mar 2021
Commenté : ramya k le 7 Avr 2021
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 commentaires
Image Analyst
Image Analyst le 15 Mar 2021
Does it have to be symbolic, or can we do it numerically where you define some range for your input?
darova
darova le 17 Mar 2021
@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.

Connectez-vous pour commenter.

Réponse acceptée

darova
darova le 17 Mar 2021
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 commentaires
darova
darova le 22 Mar 2021
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 le 7 Avr 2021
thank you so much for your help

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by