ThroughTheForceField Posted February 6 Share Posted February 6 You're welcome. I made that keeping in mind that people would want to go down in no lesser than multiples of 0.01mg. So, your goal might be to taper down from 25mg to 23.5 mg or 22.21mg, but not 22.237mg. If you wanted something like 22.237mg, the previous code would still work but the precise values won't be that precise. I can't see why someone would want to go down to something like 22.237mg anyway (it's a different thing if a volume you take gives that, but not the goal of tapering down). In any case, I should have raised an Exception keeping that in mind, so that a person can't use more than 2 digits after the decimal place in the drug weight they require. It'll just make the code longer and longer if I start putting every triviality in. If anyone wants that though, here it is: def voltotake(med_wt,med_needed,max_vol=120,approx=0.008): if len(str(med_needed).split('.'))>1: if len(str(med_needed).split('.')[1])>2: raise Exception("Please don't enter more than 2 digits after the decimal in the drug weight you require.") print('Precise Values:') for vol_take in range(1,max_vol+1): conc, med_rmv = med_wt/vol_take, med_wt - med_needed vol_rmv = med_rmv/conc if abs(round(vol_rmv,1) - round(vol_rmv,3))==0: med_act_wt = med_wt - (round(vol_rmv,1)*conc) print('volume_to_take:', vol_take, 'volume_to_remove:', round(vol_rmv,1), 'consumption_weight:', med_act_wt) print('\nApproximate Values:') for vol_take in range(1,max_vol+1): conc, med_rmv = med_wt/vol_take, med_wt - med_needed vol_rmv = med_rmv/conc if 0.0001<=abs(round(vol_rmv,1)-round(vol_rmv,3))<=approx: med_act_wt = med_wt - round(vol_rmv,1)*conc print('volume_to_take:', vol_take, 'volume_to_remove:', round(vol_rmv,1), 'actual_consumption_weight:', med_act_wt) voltotake(300,293) From 2015-early 2022, I was on 300mg Lamotrigine, 7.5mg Mirtazapine and 5mg Escitalopram. I started reducing dosages sometime around early 2022 in order to reduce side-effects, dependence and make tapering easier when the day comes. I'm currently on 291mg Lamotrigine, 6.2mg Mirtazapine and 3.25mg Escitalopram. I get this from diluting 300mg, 7.5mg and 5mg pills of each of the corresponding drugs in 50ml, 30ml and 34ml of water respectively. These dosages and the amount of water I dilute each of these pills in in keep changing slightly for now because I'm trying to figure out what works. I take Fish Oil capsules everyday and a capsule of Vitamin B complex + Vitamin C every few days. Link to comment Share on other sites More sharing options...
Recommended Posts