Created
July 16, 2022 11:01
-
-
Save sunsided/f5628292ac17ba68df8da7b58c2a0766 to your computer and use it in GitHub Desktop.
Naismith's rule with Aitken-Langmuir corrections in Matlab, units in km and h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [w, t, slope] = naismith_al(length, ascend, base_speed) | |
if ~exist('base_speed', 'var') | |
base_speed = 4; % km/h | |
end | |
slope = ascend/length; | |
t = length*(1/base_speed); | |
if slope >= 0 | |
t = t + ascend*(1/0.6); | |
elseif atand(slope) <= -5 && atand(slope) >= -12 | |
t = t - abs(ascend)*((10/60)/0.3); | |
elseif atand(slope) < -12 | |
t = t + abs(ascend)*((10/60)/0.3); | |
end | |
w = length./t; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment