Jump to content

Calculating acceleration


Recommended Posts

Hello,

I'm trying to compute acceleration from specified velocity, distance and time. The idea is to simulate points or particles to hit an exact destination within the given time. Right now, the initial model (to test the equations) I have only works when time is set to 4. Other numbers return unexpected acceleration values.

The distance equation I used is: distance = ( velocity * time ) + ( 1/2 * acceleration * time ^ 2 )

Here's what I came up with: acceleration = (-velocity * time - distance ) / ( (1/2) * time^2 )

p><p>Then here

( (-1) * ch("./viewVel") ) - ch("./timeToDest") / ( (1/2) * ( ch("./timeToDest") * ch("./timeToDest") ) )

The file is attached. The scene is of two points apart, popnet to generate a particle with velocity. All expressions are in the null_control node.

My questions are...

Is my translation from the equation to parameter expression correct?

Am I using the correct nodes to set velocity and acceleration?

And.. Is my algebra correct?

I would appreciate any form of help. Thank you very much!

acceleration_test.hipnc

Edited by miguelvfx
Link to comment
Share on other sites

There are a few problems here ...

First, the derivation in your image is incorrect, in the last step you're multiplying both sides by -1, but "vt-d" incorrectly becomes "-vt-d" instead of "-vt+d", or simpler, "d-vt".

The correct form of the equation is:

a = (d-vt)/(0.5 * t^2)

But even that is a little unwieldy, if you shuffle the terms a little bit you end up with:

a = 2 * ((d-vt) / (t^2))

Your expression was:

( (-1) * ch("./viewVel") ) - ch("./timeToDest") / ( (1/2) * ( ch("./timeToDest") * ch("./timeToDest") ) )

... which doesn't even match your derivation, it's missing distance on the left and is bracketed badly (BODMAS!), so in all you're not getting nearly the result you want. Worse yet, your acceleration node isn't even hooked up to your accelerationAccess channel (it's looking for "null1" instead of "null_controls").

A correct expression based on my earlier derivation is:

2 * ( ch("./measureDistance") - ( ch("./viewVel") * ch("./timeToDest") ) ) / ( ( ch("./timeToDest") * ch("./timeToDest") ) )

I gave it a few tests, and it seems to work fine for different time values ...

... except this probably isn't going to work how you expect it to for some velocities. The mechanics equation doesn't account for the fact that you (probably) want zero velocity as the particles approach the goal, so what ends up happening for high enough initial velocity (try putting your initial velocity to 10) is that the particle overshoots the goal at first, and then decelerates to return back to it at the time mark.

Here's a modified version of your scene with the corrections:

acceleration_test.hipnc

Edited by Darric
Link to comment
Share on other sites

Thanks for pointing them out, Darric.

As suggested I worked on the equation first without getting caught up in the implementation. Then I addressed the reference issues. It works for I want it do right now. Here's what I end up with for the acceleration expression:

( ( 2 * ch("./measureDistance") ) / ( ch("./timeToDest") * ch("./timeToDest") ) ) - ( ( 2 * ch("./viewVel") )/ ch("./timeToDest") )

Edited by miguelvfx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...