Created
June 3, 2016 23:51
-
-
Save perplexes/12b01622cf883cba5bf24eecbe8b1ce2 to your computer and use it in GitHub Desktop.
Weights
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
# Given a weight, break down into buildup to work weight | |
# 45, 50, 65, 70, 75-80, 90, 100 | |
# | |
# weight sizes: 2.5, 5, 10, 15, 25, 35, 45 | |
# bar weight: 45 | |
# | |
# example: final weight 155 | |
# | |
# 45%: 69.75 - 45 = 24.75 / 2 = 12.375. we can choose 15 (for 75lbs or 48%), or 10 + 2.5 for something close but more weights | |
# TODO: choose less weights | |
PLATES = [2.5, 5, 10, 15, 25, 35, 45] | |
BAR_WEIGHT = 45 | |
def weight_warmup(final) | |
[45, 50, 65, 70, 75, 80, 85, 90, 100].map do |pct| | |
target = final * (pct / 100.0) | |
side_target = (target - BAR_WEIGHT) / 2 | |
plates = [] | |
while plates.sum < side_target | |
sort = PLATES.map{|p| [p, (side_target - plates.sum) - p]}.sort_by{|p, m| m.abs} | |
plates << sort.first.first | |
end | |
weight = plates.sum * 2 + 45 | |
[pct, plates, weight, ((weight / final.to_f) * 100).round] | |
end | |
end | |
def print_weights(weights) | |
weights.map { |pct, plates, weight, real_pct| "#{pct}%: #{plates.join(", ")} (#{weight}lbs/#{real_pct}%)" } | |
end | |
# I'm moving from 155 -> +10% | |
weights = weight_warmup(155 * 1.1) | |
weights_a = print_weights(weights) | |
puts weights_a | |
# 45%: 15, 2.5 (80.0lbs/47%) | |
# 50%: 25 (95lbs/56%) | |
# 65%: 35 (115lbs/67%) | |
# 70%: 35, 2.5 (120.0lbs/70%) | |
# 75%: 45 (135lbs/79%) | |
# 80%: 45, 2.5 (140.0lbs/82%) | |
# 90%: 45, 10 (155lbs/91%) | |
# 100%: 45, 15, 2.5, 2.5 (175.0lbs/103%) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment