Skip to content

Instantly share code, notes, and snippets.

@Xodarap
Created July 7, 2012 16:26
Show Gist options
  • Save Xodarap/3067074 to your computer and use it in GitHub Desktop.
Save Xodarap/3067074 to your computer and use it in GitHub Desktop.
Heat calculation
function q = heat(mph)
% Given a walking speed in miles per hour, returns the energy given off as heat
% in 30 degree celsius temperature with no wind.
% No simple formula for energy taken by exercise, unfortunately
if mph == 3
exCalPerH = 230;
elseif mph == 4
exCalPerH = 350;
elseif mph == 5
exCalPerH = 544;
end
calFromSun = 172;
windSpeed = mph * .447; % mph -> m/s
convection = 59.8 * sqrt(windSpeed);
convectionCals = 860.42 / 1000 * convection % 1 W = 860 Cal/h
timeTaken = (1/2) / mph; % walking half a mile
q = (exCalPerH + calFromSun - convectionCals) * timeTaken;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment