Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # vim:fenc=utf-8
  4. #
  5. # Copyright © 2015 Michael Cook <mcook@mackal.net>
  6. #
  7. # Distributed under terms of the MIT license.
  8.  
  9. """
  10.  
  11. """
  12. import sys
  13.  
  14. pmax = int(sys.argv[1])
  15. pmin = int(sys.argv[2])
  16.  
  17. shielding = 35 # set this
  18. dbdiv = (100 - shielding) / 100.0
  19.  
  20. di = (pmax - pmin) / 19.0
  21. dbshielding = pmin - di
  22. db = dbshielding / dbdiv
  23.  
  24. nmax = db + di * 20
  25. nmin = db + di
  26.  
  27. print "DI = ({} - {}) / 19 = {}".format(pmax, pmin, di)
  28. print "DB * {} = {} - {} = {}".format(dbdiv, pmin, di, dbshielding)
  29. print "DB = {} / {} = {}".format(dbdiv, dbshielding, db)
  30. print "max = {} + {} * 20 = {}".format(db, di, nmax)
  31. print "min = {} + {} * 1 = {}".format(db, di, nmin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement