- ;;; 求大神指教: 下面是螺杆泵的抽速公式,要怎样调用程序才能求出最后的sth
- (defun qiu_acos (num);;定义arccos
- (if (= num 0) (atan 1 0)
- (atan (/ (sqrt (- 1 (* num num))) num))))
- (defun tan(mm) ;;定义tan
- (/ (sin mm) (cos mm)))
- (defun chousu (r r0 r1 R3 n p / s2 s4 s1 s3 c)
- (setq aaa (/ r0 R3))
- (setq bbb (/ r1 R3))
- (setq cc (qiu_acos aaa))
- (setq dd (qiu_acos bbb))
- (setq ee (tan cc))
- (setq s2 (* (/ (* R3 R3) 2) (- pi (- (/ pi 3) (sqrt 3)) (- ee cc))))
- (setq s4 (* (/ (* r r) 2) (+ pi (- (/ pi 3) (sqrt 3)) (- ee cc))))
- (setq s1 (* (/ 1 6) (* r0 r0) (expt ee 3)))
- (setq f dd)
- (setq s3 (- (+ (* (+ (* 2 r1 r1) (* R3 R3)) f) (* (* r1 r1) (sin (* 2 f))) (* (/ 1 4) (* R3 R3) (sin (* 4 f)))) (+ (* 3 r1 R3 (sin f)) (* r1 R3 (sin (* 3 f))))))
- (setq c (- 1 (/ (- (+ s1 s2 s4) s3) (* pi R3 R3))))
- (setq sth (* 2 n c p pi R3 R3))
- )
- (setq qq 30 ww 30 tt1 60 yy 90 uu 3000 ii 35)
- (chousu qq ww tt1 yy uu ii)
- (princ sth)
- ;;; (setq f dd)要放到(setq s3 ... 之前
- ;;; 现可以计算其结果= 1.23464e+025 你自己核算一下公式.
|