# Dynamic macro targets with constant protein

The CM dynamic targets are cool but seem to miss USDA guidelines.

The following website offers physicians a handy calculator for determining the macro and nutrient targets for each of their patients.
https://fnic.nal.usda.gov/fnic/dri-calculator/results.php

The supporting documentation seems voluminous so I back calculated the results of the DRI Calculator. That site appears to use the common formula 0.8 grams per kilogram of body weight for determining the DRI for protein.
The site also uses the formula of 60% of total calories from carbohydrates.

The simple solution/feature for dynamic targets would include a fixed setting for protein in grams or calories and a fixed setting for carbohydrates as a percentage of total calories (same as the current CM dynamic feature). The fat target would not be set by the user but would float as needed. For my particulars and a reasonable range of total calory intakes running from 1719 to 3289 gives a range for the fat percentage of total calories of 25 to 33% respectively.

Here is a quick Python program that calculates the equivalent CM dynamic percentage input values for protein, carbohydrates and fat to effect the above feature. It calculates the CM dynamic percentage inputs based on current total calories burned:

The following three values are coded for my ease. I wrote this in an iphone app so little effort was applied to pretty it.
dc=249 # Delta calories to reach weight goal
pg=57   # Protein grams constant for weight
cp=60  # Carbohydrate constant percentage

cb=1
while(1):
cb=input('\nCalories burned:  ')
if(cb==0):
break
tc=cb-dc; tcr=round(tc, 0)
print('Target calories:  {:4.0f}'.format(tcr))

pc=pg4
ppr=round(pc/tc
100, 0)
cronopc=ppr/100tc
print('Protein:  {:4.0f} cal   {:5.1f}g  {:3.0f}%   {:5.1f}g  {:4.0f} cal'.format(pc, pg, ppr, cronopc/4, round(cronopc,0)))

cc=tc
cp/100
cpr=round(cc/tc100, 0)
cronocc=cpr/100
tc
print('Carbs:   {:4.0f} cal  {:5.1f}g  {:3.0f}%  {:5.1f}g {:4.0f} cal'.format(cc, cc/4, cpr, cronocc/4, round(cronocc,0)))

fc=tc - pc - cc
fpr = 100 - ppr - cpr
cronofc=fpr/100*tc
print('Fat:        {:4.0f} cal   {:5.1f}g  {:3.0f}%   {:5.1f}g  {:4.0f} cal'.format(fc, fc/9, fpr, cronofc/9, round(cronofc,0)))
cronot = cronopc + cronocc + cronofc
print('                                                        Total: {:5.0f} cal'.format(cronot))