%Chapt2Fig3a.m
%200 THz electric field modulated by Gaussian envelope;
clear;
clf;

tau0=14.14E-15;						%time constant (s)
tau02=tau0^2;

w0=2*pi*200.E12;					%200 THz optical frequency (rad s-1)
t0=0.5E-13;							%time t0 (s)

npoints=500;						%number of points plotted
tmax=1.E-13;						%maximum time (s)
tstep=tmax/npoints					%time step (s)

t=[0:tstep:tmax];					%time [start:increment:stop]   

y=cos(w0*t);
y=y.*exp(-(t-t0).^2/tau02);

figure(1);
plot(t*1e15,y,'b');					%electric field as function of time
axis([0,tmax*1e15,-1,1]);
temp2=['Chapt2Fig3a, \omega_0 = 2\pi x ',num2str(w0/1e12/2/pi),...
    ' T rad s^{-1}, \tau_0 = ',num2str(tau0/1e-15),' fs'];
title(temp2);
xlabel(['Time, t (fs)']);
ylabel(['Amplitude']);


