Thread: advanced math problem

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    291

    advanced math problem

    At the moment this is a rather theoretical problem that Im trying to figure out if it's possible to calculate. Actually this is more of a math problem than a c++ problem but I figured that there might be one or two math wizards lurking around this forum

    Here is the scenario, you have a squared area with one ultrasonic receiver in each corner, the sides of the square has a fixed size which for the time beeing is 10 meters. Then an object is place inside this area with a ultrasonic sender. At a random time the object will send out a pulse which depending on the location of the object inside the square the four receivers will receive at different times. During this process there will a timer running that is unique for all the receivers, at the moment the recievers picks up the pulse sent the time will be registered.

    So to recap, the object sends out a signal, the four receivers register the time it received the signal. Just like to add here that the receivers do not know when this signal was sent by the object, this is unknow. Im wondering if using these four registered times I can figure out the location of the object ?

    From what I've been reading about ultrasonic waves it travels at the speed of approximately 344 meters/second. We know that the area is 10*10 meters.

    The first registered time will not tell us much since we dont know when the pulse was originally sent, thats distance X. We do however know the difference between the first time-registered and the second time-registered, this also goes for third and fourth time-registered. So we could multiply the difference with the speed of the ultrasonic waves and we have part of the distance between the object and the corner, but we're still missing distance X.

    Anyway, Ive been rambling on about this now for quite a while now. Hope this text is understandable. If anyone has any suggestion Im all ears

    Thank you for taking the time to read this and sorry if this might not be suited question in a c++ forum.

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    If you know the speed, and the time, you can get the distance from each reciever, and then you can find the point quite easily.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Certainly possible. Speed is constant for the wave, so time is directly located to distance. Draw a circle around each reciever with a radius proportional to the time (not too hard to calculate if you have a couple data points) The circles will intercept at one point...

    I left some stuff out there, but I don't want to think too hard right now.
    Away.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    254
    look out for destructive interference...

  5. #5
    Registered User
    Join Date
    Sep 2003
    Posts
    17

    A guess

    I think you should be able to figure it out by looking at the difference between the times on opposite corners.

    If you number the recievers in a clockwise direction then take the time difference between reciever 1 and 3 you will get a whole line of possible outcomes.

    If you then also do the difference between 2 and 4 you will get another line of possible outcomes.

    Where those two lines intersect should be your output point.

    Hope that helps.

  6. #6
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    You should only need to find the distance from 3 points in order to calculate the midpoint.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  7. #7
    Registered User
    Join Date
    Sep 2003
    Posts
    17

    more

    Correct XSquared. I was too tired to see that.

    Knowing the time differential between any of the two nodes should give you a unique line which the solution would have to lie on. Do it with either of the first two nodes and a third node and find where the lines cross. These lines will be straight and give only one possible answer.

  8. #8
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Originally posted by XSquared
    You should only need to find the distance from 3 points in order to calculate the midpoint.

    yes, only three corners are actually needed...the problem is quite simple.

    axon

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  9. #9
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Would I be right in saying that a circle should be drawn around each sensor, and the radius of each would be somehow determined by the delay in reception? I had a go with using trig before, and equations of motion, but I got nowhere.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  10. #10
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Hmmm. If you order the sensors from first received to last received (let's say A, B, and C) then you know the DIFFERENCE in distance between A B and C. You don't however yet know any distances. Ie:

    'a' is the distance between object and A
    'b' is the distance between object and B
    'c' is the distance between object and C

    ∆AB is the time difference between A and B reception

    so, b=a+(344*∆AB)

    This means that distance 'b' is distance 'a' plus 344 times the time difference (assuming time is in seconds).

    You could make a whole lot of those equations, but I don't think they could ever tell you a concrete distance, just a bunch of relations.

    Does anyone think otherwise?
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  11. #11
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I've been doing a lot of mucking around with this stuff, and I don't think it's possible if we only know the DIFFERENCE in time between receptions. Using pythagorous to find the relation for the object in terms of 2 receivers, I ran into this problem:

    root( (x1-x2)^2+(y1-y2)^2)=root( similar ) + (344*∆AB)

    The last part, + (344 * ∆AB), makes it is impossible to extract x2 and y2, the object coordinates, from the equation. The reason we have that last part is because we only have the time difference between pulse receptions. If we knew the time the pulse was sent out, we would be alright.

    I really don't think this is possible. But then again, I haven't done any uni maths yet. Maybe there's some formulas I don't know that could work here.
    Last edited by bennyandthejets; 09-16-2003 at 11:13 PM.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  12. #12
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    you could try this top to buttom....set an arbitrary point for the sender...lets say middle of the square (have this either at 0,0,0 or 5,5,5) I;m assuming that this is in 3 space? ie, hight of the sender matters, right? anyways....you know the speed, you certainly know the distances...get the times, which of course will equal.

    set a few more points, see if there is a patter, and derive at an equation that works everywhere in the cube....haha...easy enough.

    Or you can set a matrix, but that would have 8 variables with only 4 equations (ah) so some parametrization would have to be done which would only give linear answers....which is probably not what you are looking for.

    axon

    p.s. have we considered that velocity is a vector quantity....so three components i, j ,k.............but its a wave so

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  13. #13
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    Originally posted by XSquared
    If you know the speed, and the time, you can get the distance from each reciever, and then you can find the point quite easily.
    Im afraid you are over simplifying the problem. You do not know when the sender sends the pulse, the four registered times only tell you the relationship between when the four sensors receive the pulse.

  14. #14
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    Originally posted by axon
    yes, only three corners are actually needed...the problem is quite simple.

    axon
    I find it very difficult myself.

  15. #15
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    Originally posted by axon
    you could try this top to buttom....set an arbitrary point for the sender...lets say middle of the square (have this either at 0,0,0 or 5,5,5) I;m assuming that this is in 3 space? ie, hight of the sender matters, right? anyways....you know the speed, you certainly know the distances...get the times, which of course will equal.

    Sender and sensors should be at the same hight so it should be 2 space.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cube rotation math problem
    By n3v in forum Game Programming
    Replies: 6
    Last Post: 08-03-2007, 05:41 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. Math Problem....
    By NANO in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 11-11-2002, 04:37 AM
  4. math problem
    By unixOZ in forum Linux Programming
    Replies: 4
    Last Post: 10-19-2002, 12:17 AM
  5. Little math problem
    By Thantos in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-27-2001, 07:44 PM