From 530b870a94e6ed4174a5d4172e07331cf790880a Mon Sep 17 00:00:00 2001 From: rearman Date: Wed, 10 Sep 2025 16:27:14 -0400 Subject: [PATCH] Better names and formatting --- plc.lisp | 12 ++++++------ refrigeration.lisp | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/plc.lisp b/plc.lisp index 277ea5f..344b44e 100644 --- a/plc.lisp +++ b/plc.lisp @@ -2,13 +2,13 @@ (defparameter *resolution* 16) (defparameter *impedance* 249) -(defun 13B () (setq *resolution* 13 *volt-max* 10.0)) -(defun 16B () (setq *resolution* 16 *volt-max* 10.0)) +(defun 13-bit! () (setq *resolution* 13 *volt-max* 10.0)) +(defun 16-bit! () (setq *resolution* 16 *volt-max* 10.0)) -(defalias P3K 16B) -(defalias SLC 16B) -(defalias P1K 13B) -(defalias DL4 13B) +(defalias p3k! 16-bit!) +(defalias slc! 16-bit!) +(defalias p1k! 13-bit!) +(defalias dl4! 13-bit!) (defun max-counts (resolution) (- (^ 2 resolution) 1)) diff --git a/refrigeration.lisp b/refrigeration.lisp index c5cad72..ac025e2 100644 --- a/refrigeration.lisp +++ b/refrigeration.lisp @@ -1,20 +1,21 @@ (defun cfm-circ (fpm radius) (float (* pi fpm (square (/ radius 12))))) -(defun cfm-rect (fpm width height) (float (* fpm (/ width 12) (/ height 12)))) +(defun cfm-rect (fpm width height) + (float (* fpm (/ width 12) (/ height 12)))) (defun sat-water-press (temp) - (+ 0.0182795 - (* temp 0.001029904) - (* (square temp) 2.579408e-05) - (* (cube temp) 2.400493e-07) - (* (^ temp 4) 8.100939e-10) - (* (^ temp 5) 3.256805e-11) - (* (^ temp 6) -1.001922e-13) - (* (^ temp 7) 2.44161e-16))) + (+ 0.0182795 + (* temp 0.001029904) + (* (square temp) 2.579408e-05) + (* (cube temp) 2.400493e-07) + (* (^ temp 4) 8.100939e-10) + (* (^ temp 5) 3.256805e-11) + (* (^ temp 6) -1.001922e-13) + (* (^ temp 7) 2.44161e-16))) (defun hum-ratio (humidity swp) - (let ((hum-press (* (/ humidity 100.0) swp))) - (/ (* hum-press 0.62198) (- 14.7 hum-press)))) + (let ((hum-press (* (/ humidity 100.0) swp))) + (/ (* hum-press 0.62198) (- 14.7 hum-press)))) (defun gn-water-per-lb (humidity temp) - (* 7000 (hum-ratio humidity (sat-water-press temp)))) + (* 7000 (hum-ratio humidity (sat-water-press temp)))) -- 2.39.5