Page 1 of 1

Value Decreases

PostPosted: Thu Feb 25, 2010 9:21 am
by Sqiushy
Hi there,

I hope you can help me.
I am trying to create a expression that only plots an decrease in a value. eg. Lets say for example that i want to plot the movement of suspension only if the travel is moving in a negative direction.

I know i have to start with a 'choose' statement but i am not sure how to 'get' the position of the suspension if it is moving in a particular direction. Just to clarify, I dont want the suspension position between two values, i want the suspension plotted if it moves in X direction.

I know that might not make perfect sense

Any thoughts would be welcome.
Take Care

SQ

Re: Value Decreases

PostPosted: Sun Feb 28, 2010 1:15 am
by Fermin
Maybe it is your solution (v1.05 i2pro):

SuspPosFLSuav20: smooth('Susp Pos FL' [mm],20)

SuspPosFLSuav20_travel_positive_direction: (1/(derivative(smooth('Susp Pos FL' [mm],20)) > 0)) * smooth('Susp Pos FL' [mm],20)

SuspPosFLSuav20_travel_negative_direction: (1/(derivative(smooth('Susp Pos FL' [mm],20)) < 0)) * smooth('Susp Pos FL' [mm],20)

or if you prefer the function choose:

SuspPosFLSuav20_travel_positive_direction:choose(derivative(smooth('Susp Pos FL' [mm],20)) > 0, smooth('Susp Pos FL' [mm],20),1/0)

SuspPosFLSuav20_travel_negative_direction:choose(derivative(smooth('Susp Pos FL' [mm],20)) < 0, smooth('Susp Pos FL' [mm],20),1/0)

Re: Value Decreases

PostPosted: Fri Mar 05, 2010 12:28 am
by Sqiushy
Perfect, thanks a lot.

Good stuff there, got me thinking

Thanks again.

-SQ