diff --git a/examples/example_dispersion_1.py b/examples/example_dispersion_1.py index 971dc5c430a5d76cd2fc1fede47c09daf4b0b599..e725528c8ecb56ca55b23b97861448af822f7f72 100644 --- a/examples/example_dispersion_1.py +++ b/examples/example_dispersion_1.py @@ -30,9 +30,9 @@ E_Tx = sig_1550(esig = esig) # Define your parameters here T_0 = 25.0e-12 -z = 100.0e3 -D = 17.0 -beta_2, beta_3 = DS2beta(17.0, 0, gp.lambda0) +z = SSMF.l +D = SSMF.D +beta_2, beta_3 = DS2beta(D, 0, gp.lambda0) # Create a single pulse with gaussian shape (not power!) @@ -45,7 +45,7 @@ E = SSMF(E = E, D = D, l = z) # Plot Input and Output signal plt.figure(1) plt.plot(gp.timeax*1.0e12, np.abs(E_Tx[0]['E'][0]), 'r', label='\$E(0, t)\$') -plt.plot(gp.timeax*1.0e12, np.abs(E[0]['E'][0]), 'g', label='\$E(z=100\$km\$, t)\$') +plt.plot(gp.timeax*1.0e12, np.abs(E[0]['E'][0]), 'g', label='\$E(z='+ str(SSMF.l/1e3)+' \$km\$, t)\$') # Get FWHM of the input signal E_Tx @@ -64,6 +64,7 @@ plt.annotate(s='', xy=(r1,np.max(np.abs(E[0]['E'][0]))/2), xytext=(r2,np.max(np. plt.text(r1+(r2-r1)/2.0, 0.01 + np.max(np.abs(E[0]['E'][0]))/2, '\$T_{FWHM,1}\$ = ' + str(np.round(r2-r1,2)) + ' ps', fontsize=12, horizontalalignment='center') T_FWHM_1 = (r2-r1) * 1e-12 plt.ylabel('\$|E|\$ a.u.'); plt.xlabel('Time \$t\$ [ps]'); legend = plt.legend(loc='upper right') +plt.show() L_D = (T_0_plot)**2 / np.abs(beta_2) # Print the results