In user defined variables how does the MAX function work?

JoJa15
Posts: 12
Joined: Mon Oct 22, 2007 2:19 am

In user defined variables how does the MAX function work?

Postby JoJa15 » Mon Nov 12, 2007 1:21 am

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

Applejack
Posts: 53
Joined: Mon Apr 16, 2007 2:00 am
Location: White Lake, MI

Postby Applejack » Mon Nov 12, 2007 11:15 am

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

JoJa15
Posts: 12
Joined: Mon Oct 22, 2007 2:19 am

Postby JoJa15 » Mon Nov 12, 2007 12:52 pm

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

Applejack
Posts: 53
Joined: Mon Apr 16, 2007 2:00 am
Location: White Lake, MI

Postby Applejack » Mon Nov 12, 2007 1:07 pm

John,

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

Don't you get the max lateral accel?
Jason Kolk
Autocross - ESP Camaro Z28

Michael
Posts: 81
Joined: Mon Nov 21, 2005 6:01 pm

Postby Michael » Fri Nov 16, 2007 11:42 pm

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.


Return to “General software support”

Who is online

Users browsing this forum: No registered users and 14 guests