Results 1 to 4 of 4
Like Tree2Likes
  • 2 Post By pbrockway2

Thread: Using integration in Java

  1. #1
    garnaout is offline Member
    Join Date
    Sep 2011
    Posts
    17
    Rep Power
    0

    Default Using integration in Java

    So I am trying to calculate the current position of a vehicle at a constant acceleration, referring to: Acceleration, velocity, and Position

    I am trying to get the integral of the current speed in order to get the position at time T.

    Anyone has any idea how to do it? I am not that good in Maths.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Using integration in Java

    I am trying to calculate the current position of a vehicle at a constant acceleration ... I am not that good in Maths.
    The link you give contains the formula you would use. It's the one in the second box:

    x(T) = x(0) + v(0)T + 1/2 aT^2

    As with any equation you have to get a clear idea of what each thing stands for and which of them are "known" and which are "unknown".

    T is the time. It is a variable: ie it is always some definite amount (you can regard it as "known"). Other things may depend on the value T has.

    x(T) is the position at time T. This is unknown: in fact it is the unknown with which you start your problem. "I am trying to calculate the current position..."

    x(0) is the position at time zefro. This is a known quantity (see below).

    v(0) is the velocity at time zero. This is a known quantity (see below).

    a is the (constant) acceleration. Again it is a known quantity.

    -----

    If we are trying to calculate the current position of a vehicle it is not enough to know the acceleration only. (For example I can figure out the acceleration of the moon quite easily because I know how long it takes to go around the earth and google will tell me how far away it is: but I have no clue - without looking out of the window - about its current position.) We also need to know where it was and how fast it was going when the measurements started. This is what I called position and velocity at time zero. Without those extra pieces of information we can't tell the current position. That's why I described them as "known".

    In many problems this "initial" information is given, or can be assumed. For example a drag racer has initial velocity zero (because of how drag racing works) and initial position zero (because it is convenient to define the starting line that way). Given these two facts the equation will reduce to

    x(T) = 1/2 aT^2

    and this tells us the current (at any time T) position of a drag racer which has constant acceleration a.

    -----

    What you have to do is write code that converts the equation in the second box to some Java code. Possibly it can be simplified like the drag racer if you know (or can assume or define) the initial position and/or velocity.
    Norm and Fubarable like this.

  3. #3
    garnaout is offline Member
    Join Date
    Sep 2011
    Posts
    17
    Rep Power
    0

    Default Re: Using integration in Java

    Thank you so much!

    yes my case is similar to drag racing as I am dealing with cars so I will be taking the initial position out of the equation.

    thank you!

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

Similar Threads

  1. jsf+flex integration problem
    By mervinjmicky in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 07-03-2011, 01:16 PM
  2. JavaScript Integration in NetBeans
    By chizbox in forum NetBeans
    Replies: 1
    Last Post: 03-02-2010, 11:08 AM
  3. dialer integration with java application
    By 435.mahesh in forum Java Software
    Replies: 0
    Last Post: 03-09-2009, 06:30 AM
  4. PLSQL - JAVA Integration
    By ttkong in forum JDBC
    Replies: 0
    Last Post: 04-09-2008, 08:31 AM
  5. Mergence HL7 Integration Engine 1.1
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-06-2007, 10:20 AM

Posting Permissions

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