-
Notifications
You must be signed in to change notification settings - Fork 0
/
fluid-mechanics.lisp
66 lines (46 loc) · 1.18 KB
/
fluid-mechanics.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;;; commands that can be useful in the context of fluid mechanics formulas
;;; TODO implement these functions natively
(in-package #:clisptex)
(defun avg (arg)
(tex-cmd 'overbar arg))
(defun u (i)
(make-index "U" i))
(defun urot (i)
(make-index "V" i))
(defun um (&rest i)
(cond
((= 1 (length i)) (make-index (tex-cmd "mean" "U") i))
(t (make-index 'H i))))
;; (defun um (&rest i)
;; (tex-cmd "um" i))
(defun umrot (&rest i)
(make-index (tex-cmd "mean" "V") i))
(defun uf (&rest i)
(tex-cmd "uf" i))
(defun ufrot (&rest i)
(make-index "v" i))
(defun ua (&rest i)
(tex-cmd "ua" i))
(defun uarot (&rest i)
(make-index (tex-cmd "frak" "V") i))
(defun ud (&rest i)
(wrap-parens (concat-space (apply #'ua i) "-" (apply #'um i))))
(defun p ()
"the pressure"
"P")
(defun pm ()
(tex-cmd "pm"))
(defun x (i)
(make-index 'x i))
(defun xi (i)
(make-index (tex-symbol 'xi) i))
(defun xa (i)
(make-index (tex-cmd 'frak 'x) i))
(defun xd (i)
(wrap-parens (concat-space (xa i) "-" (x i))))
(defun angular-velocity (&optional index)
(if index
(make-index (tex-cmd "Omega") index)
(tex-cmd "Omega")))
(defun mixing-length ()
(make-index "L" "m"))