Results 1 to 16 of 16

Thread: Calculus problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008

    Calculus problem

    I remember this problem from school and I have mucked around with solutions.

    The problem is: You are crossing a railway line that is x feet across, your speed is y, there is a train approaching at speed z. What is the optimal angle to cross the railway at to maximize the time available to cross?

    Any ideas,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You need to know where both you and the train is initially positioned as well.
    As time needs to be maximized, the train will pass by as you are across, that is final position and time are equal
    Y = you
    T= train
    .p intial position vector
    .v velocity vector
    .t time scalar
    the equation is as follows:

    Y.p+Y.v*Y.t=T.p+T.v*T.t


    substitute your velocity vector with the angle (a) and length (l):

    Y.p+(cos(a)*l*j+sin(a)*l*k)*Y.t=T.p+T.v*T.t

    j and k are unit vectors. Solve a
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Yep - but whats the equation? - I was being lazy and doing it on the train on the way home. I'll bowdlerize yours

    Somehow I knew you'd answer this one.

    Tx.

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  4. #4
    Lively Member
    Join Date
    Jun 2001
    Location
    Banana Republic
    Posts
    115
    You are really sick.

    or what would you call a person who relies on calculus at death's door ?

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    |(Y.p+(cos(a)*l*j+sin(a)*l*k)*Y.t)-(T.p+T.v*T.t )|
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    RobIII
    Guest
    Code:
        /|
      a/ |b
      /  |
     /   |
    /    |
    -----
      c
    I always learned "b" was the shortest route So fastest....?

    Pseudo code:

    Code:
    If Train = NOT NEAR
      Walk
    Else
      If Train = NOT Really NEAR
        Run(Fast)
      else
        If You = NOT Stupid
          Wait(TrainPassed)
        else
          Run(Screaming AND Hope_Not_To_Get_Hit)
        end if
    End If

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Hmmm. I think Kedaman's help is a little more concrete...

    Cheers,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  8. #8
    Addicted Member
    Join Date
    Mar 2001
    Posts
    157
    The max. time to cross means that the train will be level with you just as you reach the other side of the tracks.

    When you have crossed the tracks, at angle a, then you have also travelled x * y * t * tan a along the track
    While the train will have travelled z * (d + y * tan a) * t along the track.

    Where d is the starting distance down the track of the train.
    Angle a is the angle of crossing from perpendicular to ther tracks.

    This gives:

    tan a = z * d / (x * y - z * y)

    with no calculus.

  9. #9
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Well apparently paulw insisted on having it, so he changed the issue into maximize distance between self and train, I would never spoil the chance to avoid calculus
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  10. #10
    Addicted Member
    Join Date
    Mar 2001
    Posts
    157
    I have a degree in avoiding calculus.

  11. #11
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357
    *chuckle*
    There are 10 types of people in the world - those that understand binary, and those that don't.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Sadly, I have a degree in Mathematics and I can't remember this

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  13. #13
    Hyperactive Member DavidHooper's Avatar
    Join Date
    Apr 2001
    Posts
    357

    degree...

    where did you read ure degree??
    There are 10 types of people in the world - those that understand binary, and those that don't.

  14. #14
    Addicted Member
    Join Date
    Mar 2001
    Posts
    157

    Re: degree...

    Originally posted by DavidHooper
    where did you read ure degree??
    Mostly from the comfort of my bed, with occasional days out to the Anti-Calculus University of Anti-Hard-Workingshire.

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    King's College, London.

    but it was a long time ago, and I was very young...

    Cheers,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  16. #16
    New Member
    Join Date
    May 2001
    Location
    Atlanta, GA USA
    Posts
    12
    I have to question chrisf's solution based on dimensional analysis. Looking at his denominator (x * y - z * y), we have ft * ft/s - ft/s * ft/s. That I have problems with subtracting unlike units. One of the items this problem is missing is how far away is the train at time zero.

    _W_|
    \ |
    \ | X
    \ |
    \|_________Wo___________

    So we have (y*t)^2 = W^2 + X^2
    and W + Wo = z*t

    This can be viewed as maximizing W, or t or the angle.

    I'll leave this to the calculus experts to do the rest.

    Enjoy life,

    Parke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width