- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I would like to create a loop as follows:
The only variable in my loop is the time t, which goes from 0 to 120 by an increment of 1 (t=0,120,1). With this variable, I would like to calculate:
r2=(q8*t)-(g*t*log(t))+(q9*t)-(q10/(exp(t/T2)))
All other variables (q8,g,q9,q10,T2) are known.
What should my code be like?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
log(0) is going to give you a problem...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can also be (t=1,120,1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
integer :: t
do t=1,121
r2 = (q8*t) - (g*t*log(t)) + (q9*t) - (q10/(exp(t/t2)))
enddo
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oops sorry
do t=1,120

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page