closeall; load("forward.fsp"); switchtolayout; Imin = 0.01; Imax = 0.5; lc = 1580e-9; # center wavelength w_center = (c/lc)*2*pi; nt = 15500; t = matrix(nt); amp = matrix(nt); phase = matrix(nt); t = linspace(0,nt*1e-15,nt); I = linspace(Imin,Imax,nt); phase = -w_center*t; setnamed('FDTD','simulation time',nt*1e-15); amp = sqrt(sqrt(mu0/eps0)*I*10^10/(0.5*1.52)); setsourcesignal("source_custom",t,amp,phase,c/lc,0); plot(t,amp,"t","amplitude"); fname = "forward.fsp"; save(fname); addjob(fname); # reverse switchtolayout; I = linspace(Imax,Imin,nt); amp = sqrt(sqrt(mu0/eps0)*I*10^10/(0.5*1.52)); setsourcesignal("source_custom",t,amp,phase,c/lc,0); plot(t,amp,"t","amplitude"); fname = "reverse.fsp"; save(fname); addjob(fname); runjobs;