#################################################### # File: gain_VCSEL_trans.lsf # # Description: This file is used to plot the normalized # transmission and material gain # # Copyright 2015 Lumerical Solutions #################################################### material="active_gain"; # material source_min_f=getnamed("Source2", "frequency start"); # source min frequency source_max_f=getnamed("Source2", "frequency stop"); # source max frequency f_vector=linspace(source_max_f,source_min_f,100); # get index data: n_fdtd=getfdtdindex(material,f_vector,source_min_f,source_max_f); # Calculate material gain and normalized power: gain_norm = abs(imag(n_fdtd))/(max(abs(imag(n_fdtd)))); T_data = getresult("trans","T"); T_norm = T_data.T/max(T_data.T); plot(f_vector*1e-12,gain_norm); holdon; plot(T_data.f*1e-12,T_norm); holdoff; legend("Material gain","Power transmission"); setplot("x label","Freq (THz)"); setplot("y label","normalized result");