Re: [Tutor] Do loop in Python

2011-11-30 Thread stm atoc
Yes. Actually, I have changed it to this kine od script: # == model loop == #Optione1 if True: z=zeros( (numlayers,) ) thickness= (thickness*1.0) for l in layers: z = arange ((-thickness - h * l),0,dz) ##z= t -h * l nu = num+ (0.001*exp(-0.005*(z+200.))*dz) #Option2 if False: thicknes

Re: [Tutor] Do loop in Python

2011-11-29 Thread Steven D'Aprano
stm atoc wrote: Thank you so much for your reply. It was very helpful information and I used it in order to improve the program Here is the new version of the program: zvalues = [-200] # starting value hvalues = [10] # starting value increments = [1, 1, 1, 1, 1, 1, 1, 1] for N in incremen

Re: [Tutor] Do loop in Python

2011-11-29 Thread stm atoc
Thank you so much. This script and all information was totally helpful and actually helped me for the next step of my work as well. Have a great time. Sue On Fri, Nov 25, 2011 at 10:44 PM, Andreas Perstinger wrote: > On 2011-11-25 14:46, stm atoc wrote: >> >> Here is the new version of the p

Re: [Tutor] Do loop in Python

2011-11-25 Thread Andreas Perstinger
On 2011-11-25 14:46, stm atoc wrote: Here is the new version of the program: zvalues = [-200] # starting value hvalues = [10] # starting value increments = [1, 1, 1, 1, 1, 1, 1, 1] for N in increments: h = hvalues[-1] - N hvalues.append(h) z = zvalues[-1] + h zv

Re: [Tutor] Do loop in Python

2011-11-25 Thread stm atoc
Thank you so much for your reply. It was very helpful information and I used it in order to improve the program Here is the new version of the program: zvalues = [-200] # starting value hvalues = [10] # starting value increments = [1, 1, 1, 1, 1, 1, 1, 1] for N in increments: h = hva

Re: [Tutor] Do loop in Python

2011-11-25 Thread Steven D'Aprano
stm atoc wrote: Hi there, I am a new python user. I have a question regarding do loop. This is a simple program that I have written: - N=10 h=10.0 # [micrometer] z=-200.0 # [micrometer] You define N, h and z here, but later on you use them as loop variables. So these t

Re: [Tutor] Do loop in Python

2011-11-25 Thread stm atoc
regarding to the last email: what I am trying to do is seeing the variation of 'nu' over (changes of) 'z'. My concern is how to arrange this! Basically, I am not able to define the variation of nu by z ( 1 to 200). I am looking for a statement to show the changes of 'nu' for each step of z (

Re: [Tutor] Do loop in Python

2011-11-25 Thread Charles Becker
Sue, I'm not familiar with FORTRAN, and since I'm not completely sure what you're trying to accomplish please take this simply as an 'educated guess'. My guess is that you're not getting the curve because Z is only defined to one decimal location (1/10th) precision and probably needs higher p

[Tutor] Do loop in Python

2011-11-25 Thread stm atoc
Hi there, I am a new python user. I have a question regarding do loop. This is a simple program that I have written: - N=10 h=10.0 # [micrometer] z=-200.0 # [micrometer] num = 0.05 #m**2/s dz = 1.0 nuh=[] tmax=3600 dt=20. nu=[]height = arange(z*dz,0,dz) outfile=open('nu.da