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

17 views (last 30 days)
Ahmed on 27 Dec 2022
Commented: Star Strider on 29 Dec 2022
D=(-lamda*3*10^8)*(d^2(neff)/d(lamda)^2)
##### 2 CommentsShow 1 older commentHide 1 older comment
Ahmed on 28 Dec 2022
Yes neff the refractive index
The second derivative Star Strider on 28 Dec 2022
Try this —
syms c lambda n_eff(lambda)
D_T = -(lambda/c) * diff(n_eff,2)
D_T(lambda) = .
Star Strider on 29 Dec 2022
As always, my pleasure!

Hiro Yoshino on 28 Dec 2022
You can use gradient to calculate this problem numerically.
Let me use SiO2 as an example.
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) Ahmed on 29 Dec 2022
Thank you