필터 지우기
필터 지우기

Summation of zero to infinity doesn't work. It only provides the plot from 0 to 500

조회 수: 1 (최근 30일)
%%PARAMETERS
D = 1*10^6; %FWHM of free runing laser
b = 0.01; % value depends on the injection ratio
vi = 10^6; % frequency of teh injected signal
r = 10^4; % FWHM after injection locking
%%RANGE
w = linspace(0.9*10^6,1.1*10^6,211);
%w = [0, ];
%%EQUATION
syms m n;
Y1 = (((D/(4*b))^m)*((2*m*b)+(r/2)))./(factorial(m)*(((2*m*b)+(r/2))^2+(w-vi).^2));
Y = symsum(Y1, m, 0, Inf);
X1 = (((D/(4*b))^n)*((2*n*b)+(r/2)))/(factorial(n)*(((2*n*b)+(r/2))^2));
X = symsum(X1, n, 0, Inf);
PowerDensity = Y./X;
%%PLOT
figure;
plot(w-vi,PowerDensity);
xlabel('Frequency Detuning (Hz)');
ylabel('Relative Power Density');
  댓글 수: 1
Jan
Jan 2018년 1월 8일
편집: Jan 2018년 1월 8일
Use the "{} Code" button to make your code readable. Thanks.
[EDITED], okay, thanks Walter. I hope Greshna sees, that you have formatted the code this time.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 1월 9일
Subsituting a symbolic w for the numeric one, and using a different program, I find that your Y sumsum would come out as
I = 1i;
Y = 5000*hypergeom([250001, -(50*I)*w+250000+50000000*I, (50*I)*w+250000-50000000*I], [250000, -(50*I)*w+250001+50000000*I, (50*I)*w+250001-50000000*I], 25000000)/((w-1000000)^2+25000000)
If you substitute a sample point of w = 1E6 (midpoint of your range) then this would come out approximately 2.20947928712610*10^10857356 . If you are counting on being able to get out meaningful ratios of values when some of them are that large, you should probably be reformulating your calculation. Calculating at some other other points takes a long time...
It appears to be difficult to find a closed form sum for your second formula, X, as it involves relatively large numbers in the numerator, 25000000^n, with a denominator that includes the fraction n/50
I would suggest that either your formulae are wrong or else that you will need a quite different approach. For example is it plausible that your symsum is standing in for an integral?

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by