what is the matlab code for ploting dispersion against wavelength (for chromatic dispersion)?

 Akzeptierte Antwort

Try this —
syms c lambda n_eff(lambda)
D_T = -(lambda/c) * diff(n_eff,2)
D_T(lambda) = 
.

5 Kommentare

Lambda=[0.8 0.9 1 1.2 1.3 1.4 1.5 1.55 1.6 1.7];
neff=[1.4338 1.4275 1.4211 1.4073 1.4 1.3924 1.3845 1.3804 1.3763 1.3678 1.3650];
D=(-Lambda/3*10^8)*((diff(diff(neff)))/(diff(Lambda).^2));
plot(Lambda,(D));
This way, is it correct?
As always, my pleasure!
For numeric data, I would do something like this —
Lambda=[0.8 0.9 1 1.2 1.3 1.4 1.5 1.55 1.6 1.7];
n_eff=[1.4338 1.4275 1.4211 1.4073 1.4 1.3924 1.3845 1.3804 1.3763 1.3678 1.3650];
% dn_effdlambda = gradient(n_eff) ./ gradient(Lambda)
dn_effdlambda = gradient(n_eff(1:end-1)) ./ gradient(Lambda);
D = (-Lambda/3*10^8) .* dn_effdlambda.^2;
figure
plot(Lambda,D)
grid
xlabel('\lambda')
ylabel('D')
There appears to be a missing λ value, so I shortened by one element to calculate the derivative.
See the documentation on the gradient function for details.
.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

You can use gradient to calculate this problem numerically.
Let me use SiO2 as an example.
data = readtable("SiO2.txt");
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
lambda = data.Wavelength_nm_;
n = data.n;
c = 3e8;
plot(lambda,n);
xlabel("\lambda (nm)");
Here is how to visualize D for you:
dn_dlambda = gradient(n,5); % 1st order
d2n_dlambda2 = gradient(dn_dlambda,5); % 2nd order
D = -lambda/c.*d2n_dlambda2; % your D
plot(lambda,D)

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by