lec5_code

lec5_code - from pylab import * close('all') # Define a few...

This preview shows pages 1–2. Sign up to view the full content.

from pylab import * close('all') # Define a few functions to plot: def expdecay(x,lam=1.,A=1.): return A*exp(-x*lam) def dampedsine(x,lam=1.,k=1.,A=1.): apass=A lampass=lam return expdecay(x,lam=lampass,A=apass)*sin(k*x) def gauss(x,A=1.,sig=1.,x0=5.): return A*exp(-(x-x0)**2/sig) x=linspace(0,10,100) #---------------------SLIDE 1--------------------- t=linspace(0,10,100) RC=2.0 V=10*exp(-t/RC) plot(t,V,'r-s',label='Circuit 1') legend(loc=1) xlabel('Time (s)', fontsize=16) ylabel('Potential (V)',fontsize=16) show() #---------------------SLIDE 2--------------------- #def V(t,RC): # return 10*exp(-t/RC) #RCvals=[0.5,1.0,2.0,4.0] #markers=['o','s','^','+','D'] # #for i in range( len(RCvals) ): # marker=markers[i] # RC=RCvals[i] # plot(t,V(t,RC),'b-'+marker,label='RC=%2.1s'%RC) # #legend(loc=1) #xlabel('Time (s)', fontsize=16) #ylabel('Potential (V)',fontsize=16) #show() #------------------SLIDE 3----------------------- #x=linspace(0,10,100) #y1=sqrt(x) #y2=x**3 # #plot(x,y1,'g-',lw=2,label='Sqrt(x)')

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/05/2010 for the course PHYS phy503 taught by Professor Gladden during the Spring '09 term at Ole Miss.

Page1 / 3

lec5_code - from pylab import * close('all') # Define a few...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online