Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Function to calculate valve motion velocity 4

Status
Not open for further replies.

motorsportsdesign

Automotive
Jul 23, 2003
90
0
0
US
I am trying to write some functions to calculate the velocity, acceleration, and jerk (change in acceleration) of some valve motion data.

The data is typically about 220 points
The x axis is evenly spaced with an increment of 1
The y axis is provided in a list of "position data"


I would like to know the best way to accuratly calculate the
velocity, acceleration, and jerk of the y axis at each increment
along the x axis.


Below are two methods I have tried to calculate velocity at EXACTLY the point along the X axis of the distance measurment, obviouslyat least one of them is wrong.

Note: Calculating the velocity between two points is easy, the problem is finding the velocity on the point.


X Increment, Y Position, Velocity, Avg Velocity,

1 ------------- 1
>----------- 1
2 ------------- 2 >----------- 4.5 (velocity at 2)
>----------- 8
3 ------------- 10




X Increment, Y Position, Avg Position, Velocity,

1 ------------- 1
>----------- 1.5
2 ------------- 2 >---------- 3.75 (velocity at 2)
>----------- 6
3 ------------- 10


Is there a better way to do this?

Jonathan T. Schmidt
 
Replies continue below

Recommended for you

Yes, I have another tip.

A star to someone who really helped you is always a good move.

Regards

eng-tips, by professional engineers for professional engineers
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips Fora.
 
motorsportdesign: If you use excel i have put a file up at
that contains the (hopefully) correct formulas.
Plug your data in and redo the charts and you should be away.
I haven't used any particular units so you will probably need to scale them to suit.

Another point is that by the time you get to the third derivative (jerk) the cumulative error might be getting to a point where it is significant. But at least you will have a general idea where things are headed.

HTH
 
You could connect the position points using a Cubic Spline Interpolation. This has the advantage that third order equations exist continously which can be differentiated to give smoothed values for velocity, acceleration and jerk.
 
sried "You could connect the position points using a Cubic Spline Interpolation. This has the advantage that third order equations exist continously which can be differentiated to give smoothed values for velocity, acceleration and jerk."

I think you are on to something, the more I look at this, it becomes clear that using 3 points isn't enough to find the slope at point two.

I would like to do the Cubic Spline Interpolation (or maybe Quintic) but I don't know how to write the formula for either. I ordered a book on splines, any pointers would be appriciated.





Jonathan T. Schmidt
 
Numerical Recipes in C has a decent explanation of Cubic Spline Interpolation.


I'd suggest that you try to find a Math Package that does a Cubic Spline Interpolation. You are correct that you may need a higher order function as a Cubic Spline connects acceleration at points to be equal in direction but not in magnitude.
 
How about if I use a general conic equation from five points?

x y
0.0 0.1
0.25 0.2
0.5 0.3
0.75 0.7
1.0 0.9

(32 * x^2)+(-120* x*y)+(100*y^2)+(12*x)+(1) = 0

Can someone show me how to write an equation to get the:

velocity in y axis
acceleration in y axis
jerk (change in acceleration) in y axis

at 0.5 (the third point)?

Jonathan T. Schmidt
 
You differentiate the equation. Go to


However with a second order equation, you will have a velocity equation, the acceleration will be a constant and the jerk will be zero.

The cubic spline is an improvement since third order equations are strung together (there is a new cubic equation between every two points). You can differentiate every equation to give

First derivative = Second Order Equation for velocity.

Second derivative = First order equation for acceleration.

Third derivative = A constant Jerk in the interval.
 
sried,

Thanks for the link, it does have a good spreadsheet to learn from but the code is buried in an xll and dll file.
The dll has two functions

ddydx

Returns the second derivative of the interpolated curve at the given X using the defaults of Interpolate

dydx

Returns the first derivative of the interpolated curve at the given X using the defaults of Interpolate


I guess I can use the functions but would prefer to code them myself if possible.

My cam handbook just arrived in the mail, maybe it has some functions.


Jonathan T. Schmidt
 
Status
Not open for further replies.
Back
Top