replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Array definition and write problem
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Array definition and write problem
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Fri Oct 07, 2011 4:34 pm    Post subject: Hi again! Reply with quote

Yes the save command alot more elegant....

Thanks again.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2621
Location: Sydney

PostPosted: Sun Oct 09, 2011 2:17 am    Post subject: Reply with quote

In your original post, a more robust approach to finding the best values from the array GENG could be:
Code:
! defind for NRPM
!
DO J=1,8
! find best value for M in the range 2:512
 m = 2
 x = RPM*J/120
 DO n=3,512
  IF( ABS(THETA(2,n)-x) < ABS(THETA(2,M)-x) )  M = n
 end do
 FX(J,NRPM) = ABS(GENG(31,M))
 FY(J,NRPM) = ABS(GENG(32,M))
 FZ(J,NRPM) = ABS(GENG(33,M))
 MX(J,NRPM) = ABS(GENG(34,M))
 MY(J,NRPM) = ABS(GENG(35,M))
 MZ(J,NRPM) = ABS(GENG(36,M))
ENDDO


I assume that NRPM steps from 1 to 11 outside this slice of code, so that all values of the arrays have been defined

John
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Sun Oct 09, 2011 5:41 pm    Post subject: Re: Reply with quote

JohnCampbell wrote:
In your original post, a more robust approach to finding the best values from the array GENG could be:
Code:
! defind for NRPM
!
DO J=1,8
! find best value for M in the range 2:512
 m = 2
 x = RPM*J/120
 DO n=3,512
  IF( ABS(THETA(2,n)-x) < ABS(THETA(2,M)-x) )  M = n
 end do
 FX(J,NRPM) = ABS(GENG(31,M))
 FY(J,NRPM) = ABS(GENG(32,M))
 FZ(J,NRPM) = ABS(GENG(33,M))
 MX(J,NRPM) = ABS(GENG(34,M))
 MY(J,NRPM) = ABS(GENG(35,M))
 MZ(J,NRPM) = ABS(GENG(36,M))
ENDDO


I assume that NRPM steps from 1 to 11 outside this slice of code, so that all values of the arrays have been defined

John


Hi John,

Not sure I follow above my code is merely stepping through to assign array values at discrete intervals that coinicide with 1/2,1,1.5,2,..etc from the 512 frequency spectra geng variables
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group