FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

In user defined variables how does the MAX function work?

 
Post new topic   Reply to topic    race-technology.com Forum Index -> How do I...
View previous topic :: View next topic  
Author Message
JoJa15



Joined: 22 Oct 2007
Posts: 12

PostPosted: Mon Nov 12, 2007 1:21 am    Post subject: In user defined variables how does the MAX function work? Reply with quote

I was trying the user defined variables and I was wondering if there was a way to find the maximum value of a set of data? For example I want to create a custom variable that checks to see if the current throttle position is maximum when the lateral acceleration is 90% of the maximum value. In order to do that I need to know the maximum value for the lateral acceleration and that maximum value may change run to run. I would like to do MAX (Lateral_Acceleration) but when I try to do that the software is expecting MAX(some number, some number). So at any one point it can evaluate which channel has the maximum number but it cannot evaluate the maximum number for a single channel over a run. Any ideas on how I can achieve this?

Thanks,
John
Back to top
View user's profile Send private message
Applejack



Joined: 16 Apr 2007
Posts: 53
Location: White Lake, MI

PostPosted: Mon Nov 12, 2007 11:15 am    Post subject: Reply with quote

John, I think you could do this with IF functions. Another user pointed these out after I was looking for them.

Try this:
VAR_004 = Lat Accel
IF (VAR_004 > 0.98, 1,0)

This way if Lat g's are 0.98 this function will return 1. If g's are below 0.98 it will return 0.

Have you tried using the Max function? The example in the equation editor is:
MAX (2, 3)
This will return a 3.

Perhaps you could combine them into:
IF (VAR_004 > (0.98*(MAX(VAR_004,0))), 1,0)

You may also need to do a MIN function to look at corners in the other direction. You could do this with two functions. I'm not sure how to combine them.
_________________
Jason Kolk
Autocross - ESP Camaro Z28
Back to top
View user's profile Send private message
JoJa15



Joined: 22 Oct 2007
Posts: 12

PostPosted: Mon Nov 12, 2007 12:52 pm    Post subject: Reply with quote

I did use the IF function but it requires me to know what the maximum lateral G is ahead of time. It would be nice if there was a function that could return the MAX value for a channel over an entire run. It would also be nice to have a function to return the MIN, and AVERAGE value.

I did not see it in the documentation but does the equation editor support AND and OR functions? Those would also be helpful. Maybe when you get at that level they expect you to use a VB script to do your function?

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



Joined: 16 Apr 2007
Posts: 53
Location: White Lake, MI

PostPosted: Mon Nov 12, 2007 1:07 pm    Post subject: Reply with quote

John,

What happens if you try:
MAX(VAR_004,0)

Don't you get the max lateral accel?
_________________
Jason Kolk
Autocross - ESP Camaro Z28
Back to top
View user's profile Send private message
Michael



Joined: 21 Nov 2005
Posts: 79

PostPosted: Fri Nov 16, 2007 11:42 pm    Post subject: Reply with quote

There must be a max value of each channel somewhere as the summary statistic (greek Sigma in the icon bar) can show you easily all mins and max.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    race-technology.com Forum Index -> How do I... All times are GMT
Page 1 of 1

 
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