I have the following data set from cycling (recorded with GPS):
unixtime|humantime|lat|lon|ele
1375422506|2013-08-02 07:48:26|49.084247|19.308619|536.9
1375422515|2013-08-02 07:48:35|49.084076|19.308629|534.0
1375422520|2013-08-02 07:48:40|49.083944|19.308882|534.6
1375422526|2013-08-02 07:48:46|49.08375|19.309241|534.5
1375422533|2013-08-02 07:48:53|49.083517|19.309644|533.6
1375422540|2013-08-02 07:49:00|49.08327|19.310005|529.3
Where:
unixtime is time in seconds. this should be on the X axis.
humantime is for better readability only. will not be required in the equation.
lat is my latitude coordinate at that specific time
lon is my longitude coordinate at that specific time
ele is my elevation at that specific time
We can use the haversine formula to calculate the distance traveled between points using latitude and longitude as an input. We have the elevation already available.
From the distance traveled and the unix time stamps, we can get the speed of travel.
How do we calculate my power output from this data? That means: if my elevation is falling (I'm going downhill), my power output is very low, even if my speed is high. If my elevation is rising (I'm going uphill), my power output is pretty high (depending on speed, of course).
Let's ignore the speed of the wind, i.e. let's imagine there was no wind blowing = the speed of the wind was 0 km/h relative to the Earth.
P.S.: I don't know how to tag this. Can someone re-tag, please?
EDIT
I'm not sure whether it's possible to calculate my power output in something like Watts only from this data. I think a lot more data would be required -- if not my weight/height, but also some unobtainable data. If this is the case, it would probably be enough to calculate the power output in %, defining my maximum power as 100% and counting everything lower than that to lower %, where 0% is standing still (resting).
This answer will have three parts:
First, determine your path by converting your GPS data to rectangular coordinates and fitting a quadratic spline to it. Your velocity vector is the first derivative of your path; your acceleration vector is your second derivative. Your (scalar) speed is the magnitude of your velocity.
Recall the most basic law of physics: $$F = MA$$ $M$ is your mass (a scalar), $A$ is your acceleration (a vector), and $F$ is the sum of the forces acting on you (another vector). The forces acting on you come from four sources:
So,
$$F_{net} = F_G + F_A + F_R + F_Y = MA$$
where $F_G, F_A, F_R, F_Y$ represent the four factors enumerated above, respectively. Your mass is your body mass plus the mass of your bike. This together with your acceleration vector lets you determine $F_{net}$, so then if you can determine $F_G$, $F_A$, and $F_R$, you can subtract them out to get $F_Y$.
$F_G$ is force due to gravity. We only care about the component which is not counteracted by the ground. The magnitude of this component is
$$|F_G| = Mg\sin \theta$$
where $M$ is again your mass (including the bike), $g$ is $9.8 \frac{m}{s^2}$, and $\theta$ is the inclination of the ground. This vector points downhill. Note that "downhill" is not necessarily parallel to your direction of travel: you could be side-hilling.
$F_A$ is determined by the drag formula:
$$|F_A| = \frac{1}{2}\rho v^2C_DA$$
Where:
At STP (meaning, approximately room temperature and sea level), $\rho$ is approximately $1.275 \frac{kg}{m^3}$, but will be lower if you're drafting behind another rider. $C_D$ depends, among other things, on what material your bike is made out of and what you're wearing. $A$ depends on your body position (e.g., it will be lower if you're on your aero-bars). The direction of $F_A$ is opposite your direction of travel relative to the air (hence if there is no wind, opposite your direction of travel relative to the ground).
$$|F_R| = Mg\mu_k\cos \theta$$
where $M$, $g$, and $\theta$ are as above, and $\mu_k$ is your coefficient of friction, which also has to be determined experimentally. The direction of $F_R$ is opposite your direction of travel relative to the ground.
Once you have these quantities, you can multiply $|F_Y|$ by your (scalar) speed to get your power output.
Now, it's probably obvious to you by now that this equation has several empirical inputs that you, as a hobbyist, are never going to compute with sufficient accuracy that you're going to get a reasonable result. So, here's what I recommend you do instead: buy or borrow a Computrainer. It'll give you a direct measurement of your power output. Experiment with it while wearing a heart-rate monitor, and make a chart that relates your heart rate to your power output. Also wear the heart-rate monitor while you're on the road, and consult your chart to determine your power output.