| View previous topic :: View next topic |
| Author |
Message |
JoJa15
Joined: 22 Oct 2007 Posts: 12
|
Posted: Mon Nov 12, 2007 1:21 am Post subject: In user defined variables how does the MAX function work? |
|
|
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 |
|
 |
Applejack
Joined: 16 Apr 2007 Posts: 53 Location: White Lake, MI
|
Posted: Mon Nov 12, 2007 11:15 am Post subject: |
|
|
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 |
|
 |
JoJa15
Joined: 22 Oct 2007 Posts: 12
|
Posted: Mon Nov 12, 2007 12:52 pm Post subject: |
|
|
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 |
|
 |
Applejack
Joined: 16 Apr 2007 Posts: 53 Location: White Lake, MI
|
Posted: Mon Nov 12, 2007 1:07 pm Post subject: |
|
|
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 |
|
 |
Michael
Joined: 21 Nov 2005 Posts: 79
|
Posted: Fri Nov 16, 2007 11:42 pm Post subject: |
|
|
| 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 |
|
 |
|