Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
%%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 commentaire
Jan
Jan le 8 Jan 2018
Modifié(e) : Jan le 8 Jan 2018
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.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 9 Jan 2018
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?

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by