Trouble using symsum function to solve the Radiation Resistance eqn. for a finite dipole

조회 수: 1 (최근 30일)
%Radiation Resistance for finite dipole
C=0.5772;%This is Eulers const.
k=(2*pi)/300;%wave number
l=140e-2;% length of dipole
eta=120*pi;%impedance of free space
Rad_resist=(eta/(2*pi))*(C+log(k*l)-cos_integral(k*l)...
+.5*sin(k*l)*(sine_integral(2*k*l)-2*sine_integral(k*l))...
+.5*cos(k*l)*(C+log((k*l)/2)+cos_integral(2*k*l)-2*cos_integral(k*l)));
disp(Rad_resist)
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Two functions that are called
function [c_i] = cos_integral(x)
%Cosine Integral
%Taken from Antenna Theory, Balanis
%9/5/2019
syms k;
C_euler_const=0.5772;%Eulers Constant
c_i=C_euler_const+log(x)+symsum(((((-1)^k)*((x)^(2*k)))/(2*k*factorial(2*k))),k,[1 100]);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [s_i] = sine_integral(x)
%Sine Integral
%Taken from Antenna Theory, Balanis
%9/5/2019
syms k;
s_i=symsum((((-1)^k)*(x^(2*k+1)))/((2*k+1)*factorial(2*k+1)),k,[1 100]);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%
output doesn't make sense; real summation limits should be 0 to Inf
val =
(189713413132327*pi^2)/337769972052787200000 - (2898399760547415523*pi^3)/12159718993900339200000000 + (129692640763094342591*pi^4)/4559894622712627200000000000 + (142021588266823360627*pi^5)/45598946227126272000000000000000 - (31776518994577836803303*pi^6)/115422332637413376000000000000000000 - (994151117867763524389*pi^7)/51298814505517056000000000000000000000 + (934239861683258850080753*pi^8)/692533..... keeps going...
These are the formulas I used from the book. Just wondering if I should go about a different method to solve this equation or if I'm missing something fundamentally important when using symsum function in MATLAB. Thank you!

채택된 답변

Nishant Gupta
Nishant Gupta 2019년 9월 11일
Hi Brandon,
You can use vpa function to get the result as follows:
vpa(Rad_resist,4);
To see how vpa function works you can refer to the followign document:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MuPAD에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by