|
-
Jun 17th, 2013, 05:47 AM
#1
Thread Starter
New Member
Re: For Loop issues
Doogle, thank you so much!
So I didn't put limits on X before because those limits will depend on the ERange (range of the electron), and I will have to integrate (using the trapezoidal rule). I had written as follows:
Function CalculatePhi(T As Double, S As Double) As Double
Dim X As Long, Phi() As Double, i As Double, Combo() As Double
ReDim Phi(S, T), Combo(T, S, X, Rc, Rn)
X = 0
Phi(T, S) = 0
For i = 0 To nmax
X = i * 1 / 1000 'step size is 1 nm(everything else is in micrometers)
Phi(T, S) = Phi(T, S) + ((X + 1 / 100) - X) * (Combo(i + 1 / 1000) - Combo(i)) / 2
Next i
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|