Shawn J. Goff wrote: > I wish to plot I = I0*(exp(q*V/n/k/T)-1) as a function of V for > several different values of n. > > I realize I can do something like this: > I1 = I0*(exp(q*V/n[0]/k/T)-1) > I2 = I0*(exp(q*V/n[1]/k/T)-1) > I3 = I0*(exp(q*V/n[2]/k/T)-1) > plot((I1, I2, I3, ...), (V, 0, 1)) >
How about: Ifuncs=[I0*(exp(q*V/n/k/T)-1) for n in [0,1,2,3,4,5]] plot(Ifuncs, (V,0,1)) Replace the list [0,1,2,3,4,5] with whatever list you want for the values of n. You might read about list comprehensions: http://docs.python.org/tutorial/datastructures.html#list-comprehensions or google for python list comprehension Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
