home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p067 / 2.img / HD / HDD83.LSP < prev    next >
Encoding:
Text File  |  1994-01-31  |  5.2 KB  |  149 lines

  1. (defun calcu()
  2. (setvar "cmdecho" 0)
  3.        (setq at "c")
  4.        (while (and (/= at "S2") (/= at "s2"))
  5.               (setq c (getstring "\nunit <U> or nonunit <N>: "))
  6.                (cond ((or (= c "n") (= c "N")) (setq z "nonunit"))
  7.                      ((or (= c "u") (= c "U")) (progn (command "vslide" "\\house1\\sld\\s705") (getstring "\npress RETURN to continue: ") (setq z "unit")))
  8.                )
  9.         (setq a "0")
  10.        (while (and (/= a "S1") (/= a "s1"))
  11.        (command "vslide" "\\house1\\sld\\s706")
  12.               (cond ((= z "nonunit") (setq cc (getstring "\ndevice No. <nonunit (1,2,3,4,5)>: ")))
  13.                     ((= z "unit") (setq cc (getstring "\ndevice No. <unit > (1,2,4,6,): ")))
  14.               )
  15.               (setq fname (strcat z cc))
  16.               (cond ((= fname "nonunit1") (nonunit1))
  17.                     ((= fname "nonunit2") (nonunit2))
  18.                     ((= fname "nonunit3") (nonunit3))
  19.                     ((= fname "nonunit4") (nonunit4))
  20.                     ((= fname "nonunit5") (nonunit5))
  21.                     ((= fname "unit1") (unit1))
  22.                     ((= fname "unit2") (unit2))
  23.                     ((= fname "unit4") (unit4))
  24.                     ((= fname "unit6") (unit6))
  25.               )
  26.           (setq a (getstring "\nContinue or End<c/s1>: "))
  27.        )
  28.           (setq at (getstring "\nenter continue or end<c/s2>: "))
  29. )
  30.  (check 'hd70 "hd70")
  31. )
  32. (defun nonunit1()
  33.        (setq y (getstring "\nR=0 ? <Y/N>: "))
  34.        (setq sj (getreal "\nsj="))
  35.        (cond ((or (= y "n") (= y "N")) (setq dpd (getreal "\ndpd="))))
  36.        (setq se (getreal "\nse="))
  37.        (setq ud% (getreal "\nud="))
  38.        (cond ((or (= y "n") (= y "N")) (setq Rnb (* dpd 0.001 (/ sj se se))))
  39.              ((or (= y "y") (= y "Y")) (setq Rnb 0)))
  40.        (setq Znb (/ (* ud% sj) (* 100 se)))
  41.        (setq Xnb (sqrt (- (* Znb Znb) (* Rnb Rnb))))
  42.        (setq Q "Xnb= ")
  43.        (setq Xnb (strcat Q (rtos Xnb 2 4)))
  44.        (print Xnb) (setq res Xnb) (w)
  45.        (setq Q1 "Znb= ")
  46.        (setq Znb (strcat Q1 (rtos Znb 2 4)))
  47.        (print Znb) (setq res Znb) (w)
  48. )
  49. (defun nonunit2()
  50.        (setq Ij (getreal "\nIj="))
  51.        (setq Ue (getreal "\nUe="))
  52.        (setq Ie (getreal "\nIe="))
  53.        (setq Up (getreal "\nUp="))
  54.        (setq Xk% (getreal "\nXk%="))
  55.        (setq Xnk (/ (* Xk% Ue Ij)
  56.                     (* 100 Ie Up)
  57.                  ))
  58.        (setq Q "Xnk= ")
  59.        (setq Xnk (strcat Q (rtos Xnk 2 4)))
  60.        (print Xnk) (setq res Xnk) (w)
  61.   )
  62. (defun nonunit3()
  63.        (setq Sj (getreal "\nsj="))
  64.        (setq R (getreal "\nR= "))
  65.        (setq Up (getreal "\nup="))
  66.        (setq X (getreal "\nx="))
  67.        (setq Xn (/ (* X Sj) (* Up Up)))
  68.        (setq Rn (/ (* R Sj) (* Up Up)))
  69.        (setq Q "Xn= ") (setq Q1 "Rn= ")
  70.        (setq Rn (strcat Q1 (rtos Rn 2 4)))
  71.        (setq Xn (strcat Q (rtos Xn 2 4)))
  72.        (print Rn) (print Xn) (setq res Rn) (w) (setq res Xn) (w)
  73. )
  74. (defun nonunit4()
  75.        (setq sj (getreal "\nsj="))
  76.        (setq sdx (getreal "\nsdx="))
  77.        (setq xnx (/ sj sdx))
  78.        (setq Q "Xnx= ")
  79.        (setq Xnx (strcat Q (rtos Xnx 2 4)))
  80.        (print Xnx) (setq res Xnx) (w)
  81. )
  82. (defun nonunit5()
  83.        (setq xn1 (getreal "\nxn1="))
  84.        (setq sj (getreal "\nsj="))
  85.        (setq sj1 (getreal "\nsj1="))
  86.        (setq xn (/ (* xn1 sj) sj1))
  87.        (setq Q "Xn= ")
  88.        (setq Xn (strcat Q (rtos Xn 2 4)))
  89.        (print Xn) (setq res Xn) (w)
  90. )
  91. (defun unit1()
  92.        (setq ue (getreal "\nue="))
  93.        (setq se (getreal "\nse="))
  94.        (setq dpd (getreal "\ndpd="))
  95.        (setq ud% (getreal "\nud%="))
  96.        (setq rb (/ (* dpd ue ue 0.001)
  97.                    (* se se)
  98.                 ))
  99.        (setq zb (/ (* ud% ue ue) (* se 100)))
  100.        (setq xb (sqrt (- (* zb zb) (* rb rb))))
  101.         (setq Q "Rb= ")
  102.         (setq Q1 "Zb= ")
  103.         (setq Q2 "Xb= ")
  104.         (setq Rb (strcat Q (rtos Rb 2 4)))
  105.         (setq Xb (strcat Q2 (rtos Xb 2 4)))
  106.         (setq Zb (strcat Q1 (rtos Zb 2 4)))
  107.         (print Rb) (print Xb) (print Zb)
  108.         (setq res Rb) (w) (setq res Xb) (w) (setq res Zb) (w)
  109. )
  110. (defun unit2()
  111.        (setq ue (getreal "\nue="))
  112.        (setq ie (getreal "\nie="))
  113.        (setq xk%(getreal "\nxk%="))
  114.        (setq xk (/ (* xk% ue)
  115.                    (* 100 ie (sqrt 3))))
  116.        (setq Q "xk= ")
  117.        (setq xk (strcat Q (rtos xk 2 4)))
  118.        (print xk) (setq res xk) (w)
  119. )
  120. (defun unit4()
  121.        (setq up (getreal "\nup="))
  122.        (setq sdx (getreal "\nsdx="))
  123.        (setq xx (/ (* up up)
  124.                     sdx
  125.                 ))
  126.         (setq Q "xx= ")
  127.         (setq xx (strcat Q (rtos xx 2 4)))
  128.         (print xx) (setq res xx) (w)
  129. )
  130. (defun unit6()
  131.        (setq x1 (getreal "\nx1="))
  132.        (setq up1 (getreal "\nup1="))
  133.        (setq up2 (getreal "\nup2="))
  134.        (setq R2 (getreal "\nR1= "))
  135.        (setq x2 (/ (* x1 up2 up2) (* up1 up1)))
  136.         (setq R2 (/ (* R2 up2 up2) (* up1 up1)))
  137.         (setq Q "R2= ") 
  138.         (setq Q1 "X2= ") 
  139.         (setq R2 (strcat Q (rtos R2 2 4)))
  140.         (setq X2 (strcat Q1 (rtos X2 2 4)))
  141.         (print R2) (print X2) (setq res R2) (w) (setq res X2) (w)
  142. )
  143. (defun w ()
  144.           (command "redraw")
  145.           (setq p (getpoint "enter write table of point: "))
  146.           (command "text" p 2 0 res)
  147. )
  148. (calcu)
  149.