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
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
to something more readable
|dw:1407312009931:dw|
well velocity * time = distance try to convert the miliseconds to hours. like have them have the same common denominator. i think
how do you do the difference between the twoo though?
so if it was 1 number, you could do 15miles / hour * 3600000 milliseconds, i think
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?
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)
so you basically have to convert the 2 input data points, which are miles/hour into just miles right?
then use the given time period to figure out total distance
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)}\]
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
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
oh dang loll
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
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
thank you for helping btw
\[\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
wouldn't it be v(t2)-v(t1)?
since there are 2 velocities?
oh well nm, i guess it could be an average of the velocities, which would be accurate enough
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
ah yah, ok perfect thank you so much
so the above values would come out to be something like
0.0566666
where 1600 milliseconds = 0.000444444 hours
so \[\int\limits_{0}^{0.0004444444}127.5dt\]
\[D=\int_0^T\sqrt{\left(\frac{\delta \vec{r(t)}}{dt}\right)^2}\]
(15 + 17) / 2 = 127.5
oh man, that looks crazy lol. ok so i think it means the magnitude of the vector delta per time?
oh yah and integrated over total time
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}\]
where D is the time you want in hrs
more generally: \[\Delta v= \frac{\sum_{n=1}^n k(n)}{n}\] \[\Delta v \times t=distance\]
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
yarp. what are you coding it in?
tons of programming languages but this part is in javascript
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
I don't really know a lot of jscript
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
you should try :) it is powerful stuff. A lot of oldddddd coding but still the most powerful clientside coding available for web imo
what languages do you know?
yah, it is 2 inputs [miles/hour] and 1 input for each [date]
My research is in Computational Molecular Biology... I do a lot in UNIX shells (bash etc) and iterative python coding
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
other than basic html markup, i dont know much about web stuff lol
almost all websites hosted via, minus the consumer market
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
you say research, are you a grad student or phd?
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
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
mr Alan Jonathan Quentin Greenea
lol
lol
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.
no
haha well the best to you :) thank you so much for you help
though, in that search all the sciencey diagrams are part of my work
pretty cool that quintin tarentino comes up in your search lol
Join our real-time social learning platform and learn together with your friends!