 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
colt1954
Joined: 21 Dec 2010 Posts: 81
|
Posted: Fri Oct 07, 2011 4:34 pm Post subject: Hi again! |
|
|
Yes the save command alot more elegant....
Thanks again. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2621 Location: Sydney
|
Posted: Sun Oct 09, 2011 2:17 am Post subject: |
|
|
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 |
|
 |
colt1954
Joined: 21 Dec 2010 Posts: 81
|
Posted: Sun Oct 09, 2011 5:41 pm Post subject: Re: |
|
|
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 |
|
 |
|
|
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
|