Results 1 to 10 of 10
Like Tree2Thanks
  • 1 Post By ebaines
  • 1 Post By CakeSpear

Math Help - Predicting Movement Time

  1. #1
    Junior Member
    Joined
    Jun 2012
    From
    Drammen
    Posts
    31
    Thanks
    2

    Predicting Movement Time

    Hi
    I have a moving Ball
    - The Ball moves at speed V
    - The Ball has an InitialSpeed V_i
    - The Ball has a TargetSpeed V_t

    Every second:
    - Ball is displaced V number of pixels
    - V is multiplied by deacceleration D ( D is a number between 0 - 1 )

    ...
    I need an expression, returning how many seconds it takes before V reaches TargetSpeed V_t ( V_t is allways lower or equal to V_i )
    ( Time is integer only )

    ...
    Im quite rusty when it comes to math, but i think i know where to start with this:

    V_i * ( D )^x <= V_t

    Now i need to isolate the X?
    However im not sure how to do that, or if this is what i need to do at all.
    Pleace correct me if im wrong.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,527
    Thanks
    773

    Re: Predicting Movement Time

    Quote Originally Posted by CakeSpear View Post
    i think i know where to start with this:

    V_i * ( D )^x <= V_t
    This is correct. If V_i and V_t are positive, then this inequality is equivalent to D^x\le\frac{V_t}{V_i}, and the first integer x for which this holds is \left\lceil\log_D\left( \frac{V_t}{V_i}\right) \right\rceil where \lceil\cdot\rceil is the ceiling function. Note that \log_D\left(\frac{V_t}{V_i}\right)=\log_D V_t-\log_D V_i and \log_D z=\frac{\log_bz}{\log_bD} for any positive z and base b. For b = e you get natural logarithm ln(), and for b = 10 you get common logarithm often denoted by lg().
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor ebaines's Avatar
    Joined
    Jun 2008
    From
    Illinois
    Posts
    1,065
    Thanks
    296

    Re: Predicting Movement Time

    cakespear - you asked this exact same question 2 days ago and it was answered then - see:

    Predicting Tartget Speed.

    If you need any clarification regarding the answer provided then please ask about it with follow-up on the original thread.
    Thanks from emakarov
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Junior Member
    Joined
    Jun 2012
    From
    Drammen
    Posts
    31
    Thanks
    2

    Re: Predicting Movement Time

    Ebaines
    First of all, thank you for helping me with the other problem i had "Predicting Target Speed", much appreciated.

    However this is clearly not the same question although the formulation of the problem is similar.
    The Topics are not the same, the question i ask in the posts are not the same.
    Time is not the same as Speed.
    Theese are two different questions.

    Im not sure about the posting culture around here, but since i had a different question, i created a new Thread.

    ...
    Emakarov
    I cant believe i got that correct, i hope im slowly getting the right mindset for this stuff!
    Ah i see, so by multiplying with Log on both sides, the exponential x is removed.

    Im not sure how or why the Tall Pins come into play however...?
    As a programmer i do know what a Ceiling function is ( rounds a decimal number up ), but i dont know if this is the same as the Tall Pins.

    "This is correct. If V_i and V_t are positiv"
    The equation needs to work for two different situations

    1
    V_i and V_t are both positive

    2
    V_i and V_t are both negative

    ...
    Anyways, ill play around whith this and post back how it turns out
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,527
    Thanks
    773

    Re: Predicting Movement Time

    Quote Originally Posted by CakeSpear View Post
    Ah i see, so by multiplying with Log on both sides, the exponential x is removed.
    To put it correctly, we apply (not multiply by) logarithm on both sides.

    Quote Originally Posted by CakeSpear View Post
    Im not sure how or why the Tall Pins come into play however...?
    As a programmer i do know what a Ceiling function is ( rounds a decimal number up ), but i dont know if this is the same as the Tall Pins.
    The equality D^x=V_t/V_i is equivalent to x = \log_D(V_t/V_i) without rounding. But you said that in your situation x is an integer, and the right-hand side does not have to be an integer. For example, if \log_D(V_t/V_i)=3.2, then D^3 is still greater than V_t/V_i, but D^4 is already smaller than V_t/V_i (since 0 < D < 1). That's why I said that the first x such that D^x\le V_t/V_i is obtained by rounding up the logarithm.

    Quote Originally Posted by CakeSpear View Post
    The equation needs to work for two different situations

    1
    V_i and V_t are both positive

    2
    V_i and V_t are both negative
    This way of finding x works if both V_i and V_t are negative. In this case, multiplying V_i by D makes it larger, though it makes its absolute value smaller. Therefore, you are looking for the first x such that V_iD^x\ge V_t. After dividing by a negative  V_i, which changes the direction of the inequality, we get the same D^x\le V_t/V_i.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor ebaines's Avatar
    Joined
    Jun 2008
    From
    Illinois
    Posts
    1,065
    Thanks
    296

    Re: Predicting Movement Time

    OK, I missed the nuance that you are asking for the time to reach target speed, as opposed to distance covered. But actually in the other post I provided that calculation, as I used it to derive the distance. If you check the other post you'll see that the formula is:

     T = \frac {\ln (V_T/V_i)} {ln D}
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Junior Member
    Joined
    Jun 2012
    From
    Drammen
    Posts
    31
    Thanks
    2

    Re: Predicting Movement Time

    I did end up with alsmost the same solution as you:

    V_i * ( D )^x <= V_t
    ( divide by V_i )
    ( D )^x <= V_t / V_i
    ( apply Log )
    Log( D )*x <= Log( V_t / V_i )
    ( divide by Log )
    x <= Log( V_t / V_i ) / Log

    Log( V_t / V_i ) / Log is the answer and gives the correct output, both for possitive and negative V_i V_t, in my test application!

    Im guessing i could just do the exact same thing with Ln as i did with Log, not sure what the difference is.
    Im guessing inverse of ^ is both Log and Ln...?

    Anyways, Emakarov and Ebainese, thank you for getting me this far!
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,527
    Thanks
    773

    Re: Predicting Movement Time

    Quote Originally Posted by CakeSpear View Post
    V_i * ( D )^x <= V_t
    ( divide by V_i )
    ( D )^x <= V_t / V_i
    ( apply Log )
    Log( D )*x <= Log( V_t / V_i )
    ( divide by Log )
    x <= Log( V_t / V_i ) / Log
    Two remarks about this solution. First, Log is a function while, e.g., Log( V_t / V_i ) is a number (the result of applying Log to V_t / V_i). As a programmer, you should appreciate the difference between values of different types. The type of Log is something like (float -> float), while the type of Log(D) is float. In particular, you can't divide by Log, but you can divide by Log(D).

    Second, since D < 1, Log(D) is negative. I am guessing that this is logarithm to base 10. See its graph here. Logarithms to other bases are obtained by multiplying this function by a constant. So, since Log(D) < 0, when you divide Log( D )*x <= Log( V_t / V_i ) by Log(D), the direction of the inequality reverses to give x >= Log( V_t / V_i ) / Log(D). That's why the first integer solution x is Ceiling(Log( V_t / V_i ) / Log(D)).

    Quote Originally Posted by CakeSpear View Post
    Im guessing i could just do the exact same thing with Ln as i did with Log, not sure what the difference is.
    Im guessing inverse of ^ is both Log and Ln...?
    Yes, \log_b(x^p) = p \log_b (x), which is the identoty you used in your solution, holds for all bases b (of course, logarithm is only defined when the base is positive and different from 1). If Log is logarithm to base 10, then Log(y) is the inverse of y = 10^x, and Ln(y) is the inverse of y = e^x where e ≈ 2.718 is Euler's number.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Junior Member
    Joined
    Jun 2012
    From
    Drammen
    Posts
    31
    Thanks
    2

    Re: Predicting Movement Time

    Emakarov, most of your sentances are like bullets burning holes straight through my brain.
    Im not saying i dont appreciate the bullets.

    Two remarks about this solution. First, Log is a function while, e.g., Log( V_t / V_i ) is a number (the result of applying Log to V_t / V_i). As a programmer, you should appreciate the difference between values of different types. The type of Log is something like (float -> float), while the type of Log(D) is float. In particular, you can't divide by Log, but you can divide by Log(D).

    Out of curiosity, are you saying Log is an undefined float( 10^x ? ) existing somewere within a specific range?
    I know i can easily google Log and find out what it is, but i ask anyway ( i see you have explained it below already ).

    And sorry about the typo, i meant to say i divided by Log( D ) and not Log alone.

    V_i * ( D )^x <= V_t
    ( divide by V_i )
    ( D )^x <= V_t / V_i
    ( apply Log )
    Log( D )*x <= Log( V_t / V_i )
    ( divide by Log( D ) )
    x <= Log( V_t / V_i ) / Log( D )

    Second, since D < 1, Log(D) is negative.
    So, since Log(D) < 0, when you divide Log( D )*x <= Log( V_t / V_i ) by Log(D), the direction of the inequality reverses to give x >= Log( V_t / V_i ) / Log(D).


    However, and to my surprise, the solution to my problem was solely the right side of the inequality.
    What i mean is it didnt matter at all if it was x <=, x= or x>=, the right side of the equation/ inequation was what mattered and gave the correct return.
    In a pure mathematical context i do understand that this matters much, and i vaugely remember now how an inequation sometimes(?) switches sides when multiplying or dividing ( from early school ).

    Yes, \log_b(x^p) = p \log_b (x), which is the identoty you used in your solution, holds for all bases b (of course, logarithm is only defined when the base is positive and different from 1). If Log is logarithm to base 10, then Log(y) is the inverse of y = 10^x, and Ln(y) is the inverse of y = e^x where e ≈ 2.718 is Euler's number.

    Ah, im starting to remember this, Log is 10 based, Ln is e based, thanks for explaining
    And ill have to read about this Euler and his number ( e ), gave it a quick look and sounds crazy
    Thanks from emakarov
    Follow Math Help Forum on Facebook and Google+

  10. #10
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,527
    Thanks
    773

    Re: Predicting Movement Time

    Quote Originally Posted by CakeSpear View Post
    Out of curiosity, are you saying Log is an undefined float( 10^x ? ) existing somewere within a specific range?
    No, Log is not of type float. The type of functions from float to float is distinct from the type of float, and values of different types are not directly comparable (without coercing one value to a different type); they are different entities, just like apples and oranges.

    Quote Originally Posted by CakeSpear View Post
    However, and to my surprise, the solution to my problem was solely the right side of the inequality.
    What i mean is it didnt matter at all if it was x <=, x= or x>=, the right side of the equation/ inequation was what mattered and gave the correct return.
    If you are solving the equation V_i * ( D )^x = V_t, then the answer is x = Log( V_t / V_i ) / Log( D ). If you are solving the inequality V_i * ( D )^x <= V_t, then the answer is x >= Log( V_t / V_i ) / Log( D ). This matters if you need to find an integer x. The equation may not have an integer solution. If you round the right-hand side to an integer, you need to understand how this rounded value relates to the original problem. In the case of inequality you know that any x >= Log( V_t / V_i ) / Log( D ) satisfies the original inequality, so you can round Log( V_t / V_i ) / Log( D ) up. If you round it to the nearest integer (which may round it down sometimes), it will still be an approximate solution, but it won't answer the original question: "How many seconds it takes before V reaches TargetSpeed V_t?" (the speed at moment x may still be greater that V_t).
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Predicting Movement Time
    Posted in the Math Forum
    Replies: 0
    Last Post: May 2nd 2013, 04:16 PM
  2. Predicting Running Time
    Posted in the Math Forum
    Replies: 1
    Last Post: November 19th 2012, 07:32 AM
  3. Predicting Values
    Posted in the Math Forum
    Replies: 1
    Last Post: September 11th 2012, 04:20 AM
  4. Replies: 1
    Last Post: April 20th 2009, 05:53 AM
  5. First movement about the mean
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: September 24th 2008, 01:19 PM

Search Tags


/mathhelpforum @mathhelpforum