Ask your own question, for FREE!
Mathematics 17 Online
OpenStudy (anonymous):

if you had two points, say 15mph and 17mph, and a time of traveling, say 1600 milliseconds, how do you know how much total distance is traveled

OpenStudy (anonymous):

I am writing a program and need to calculate total distance traveled, given 2 points miles/hour and a given time in milliseconds, which i will later convert

OpenStudy (anonymous):

to something more readable

OpenStudy (anonymous):

|dw:1407312009931:dw|

OpenStudy (anonymous):

well velocity * time = distance try to convert the miliseconds to hours. like have them have the same common denominator. i think

OpenStudy (anonymous):

how do you do the difference between the twoo though?

OpenStudy (anonymous):

so if it was 1 number, you could do 15miles / hour * 3600000 milliseconds, i think

OpenStudy (anonymous):

which would give you just 15 miles right? then you have distance over time, which you could use (y2-y1)/(x2-x1) to get distance?

OpenStudy (jack1):

assume its accelerating smoothly, average the speed, multiply by the time speed = distance / time so speed x time = distance as @ksmith197 said though, these equations only work if everything's in the same units of measurement (miles, hours, etc)

OpenStudy (anonymous):

so you basically have to convert the 2 input data points, which are miles/hour into just miles right?

OpenStudy (anonymous):

then use the given time period to figure out total distance

OpenStudy (agreene):

what they are saying, is: Assuming that acceleration is linear \[\frac{\delta x_1}{\delta t_1}~~;~~\frac{\delta x_2}{\delta t_2}\] are the two inputs. \[D=\sqrt{(x_2-x_1)+(t_2-t_1)}\]

OpenStudy (anonymous):

yah, we are using an arduino, which doesn't measure acceleration. It's pulling miles/hour from the car, so it shouldn't be an issue

OpenStudy (agreene):

So, if this is a real world type thing, as you are making me think it is, the problem is much more complex than you think

OpenStudy (anonymous):

oh dang loll

OpenStudy (anonymous):

basically the arduino pulls the miles/hour from the car and then transmits it to a website. it does this at random intervals (1-2 minutes). So basically, what i want to do is get 2 of these points and figure out an estimated distance traveled

OpenStudy (anonymous):

for example, 15mph are sent at 1 point in time, and then 17mph are sent 1600 milliseconds later. what is the estimated distance traveled between these 2 points

OpenStudy (anonymous):

thank you for helping btw

OpenStudy (agreene):

\[\int_{T_1}^{T_2}v(t)dt\] would be what you're looking for, where \(T_1,T_2\)are start and end time and \(v(t)\) is the velocity

OpenStudy (anonymous):

wouldn't it be v(t2)-v(t1)?

OpenStudy (anonymous):

since there are 2 velocities?

OpenStudy (anonymous):

oh well nm, i guess it could be an average of the velocities, which would be accurate enough

OpenStudy (agreene):

Well, really you're looking at two points on an unknown function, so probably the easiest thing to do would be the avg the velocities and such

OpenStudy (anonymous):

ah yah, ok perfect thank you so much

OpenStudy (anonymous):

so the above values would come out to be something like

OpenStudy (anonymous):

0.0566666

OpenStudy (anonymous):

where 1600 milliseconds = 0.000444444 hours

OpenStudy (anonymous):

so \[\int\limits_{0}^{0.0004444444}127.5dt\]

OpenStudy (agreene):

\[D=\int_0^T\sqrt{\left(\frac{\delta \vec{r(t)}}{dt}\right)^2}\]

OpenStudy (anonymous):

(15 + 17) / 2 = 127.5

OpenStudy (anonymous):

oh man, that looks crazy lol. ok so i think it means the magnitude of the vector delta per time?

OpenStudy (anonymous):

oh yah and integrated over total time

OpenStudy (agreene):

the easiest way to do this would be: input 1: 15mph input 2: 17mph \[\Delta v=\frac{15+17}2\] \[\Delta v=16 \frac{mi}h\] \[16\frac{mi}{hr} \times D {hr}==16\frac{mi}{\cancel{hr}}\times D\cancel{hr}\]

OpenStudy (agreene):

where D is the time you want in hrs

OpenStudy (agreene):

more generally: \[\Delta v= \frac{\sum_{n=1}^n k(n)}{n}\] \[\Delta v \times t=distance\]

OpenStudy (anonymous):

hrm, yah, i mean it doesn't have to be the most accurate system but basically use this and then you have to multiply by the time that it will travel over the distance

OpenStudy (agreene):

yarp. what are you coding it in?

OpenStudy (anonymous):

tons of programming languages but this part is in javascript

OpenStudy (anonymous):

all languages used are jsp/java, javascript/jquery, sql, arduino (basically c++/c), php, and html/css, if you want to call them languages lol

OpenStudy (agreene):

I don't really know a lot of jscript

OpenStudy (agreene):

if you know there is only going to be 2 inputs it should be really easy to code. If you can have more than that, you'll need to use arrays which could get a bit messy

OpenStudy (anonymous):

you should try :) it is powerful stuff. A lot of oldddddd coding but still the most powerful clientside coding available for web imo

OpenStudy (anonymous):

what languages do you know?

OpenStudy (anonymous):

yah, it is 2 inputs [miles/hour] and 1 input for each [date]

OpenStudy (agreene):

My research is in Computational Molecular Biology... I do a lot in UNIX shells (bash etc) and iterative python coding

OpenStudy (anonymous):

oh wow nice, yah, i've done a bunch of bash for the company i interned at. Shell's are really useful for web development

OpenStudy (agreene):

other than basic html markup, i dont know much about web stuff lol

OpenStudy (anonymous):

almost all websites hosted via, minus the consumer market

OpenStudy (anonymous):

it's fun stuff, highly recommend. you definitely are a smart guy. you could pick it up really fast, and, to be honest, almost all companies are using web ui for their software nowadays, internally

OpenStudy (anonymous):

you say research, are you a grad student or phd?

OpenStudy (agreene):

lol, i plan on keeping on doing what I do... most recently (from my username you can probably figure out which author is me): http://pubs.rsc.org/en/Content/ArticleLanding/2014/MB/C4MB00239C#!divAbstract

OpenStudy (anonymous):

oh man nice. you are way out of my reach. I have only taken chemistry 1, but tons of physics courses, thought hey only pertain to electrical engineering

OpenStudy (anonymous):

mr Alan Jonathan Quentin Greenea

OpenStudy (anonymous):

lol

OpenStudy (agreene):

lol

OpenStudy (agreene):

keep doing your thing, and i'm sure you'll get where you want to go.. as for me... i still have another 5ish years to finish my PhD... and then you know... forever until I finish researching things that are interesting.

OpenStudy (agreene):

no

OpenStudy (anonymous):

haha well the best to you :) thank you so much for you help

OpenStudy (agreene):

though, in that search all the sciencey diagrams are part of my work

OpenStudy (anonymous):

pretty cool that quintin tarentino comes up in your search lol

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!