超級撒亞人三型態

A: 明明追到佢之前係善解人意,又剛強獨立,又唔會亂發小姐脾氣,咩都可以攤開黎講,以為自己搵到 the one 。

追到之後反而成日都體虛體弱,成日頭暈唔舒服,借啲易又發脾氣,咩都要人哄,又收收埋埋,性格變得快過天氣,上午可以無咩事,下午就哭住咁話你做咩無做咩咩咩,講嘢大聲啲又話你做咩兇佢…….

我都係想要同一個正常少少既女仔,有一段正常少少既戀愛啫……點解咁難:~(

.

B: 你以為咁就完?

結埋婚嘅話, 啲女人仲識得二段變身, 好似超級撒亞人咁, 所有嘢都會再升級

生埋小朋友就係超西3

利申: 俾超西3屈埋牆角撳住砌緊:-(:-(:-(

.

.

2023.09.01 Friday ACHK

守時 6.2

這段改編自 2010 年 4 月 24 日的對話。

.

通常而言,遲到並非單一事件,而是習慣。背後牽涉了,大量的心結。所以,並不是說他想改,就立刻改到。例如,習慣把超出那一格時段,所能負荷的事件份量,放於時間表的該格之中。

反過來說,如果你遇到一位,「次次也守時」的朋友,他背後一定有,一堆過人之處。生活整體系統而言,運行得不錯。他的優點,絕對不只「守時」一個。

一般人以為,「守時」是一件簡單而容易的事,有心做就會做到。「守時」其實需要刻意經營,成本很高。「守時」既不簡單,亦不容易。

如果你打算「準時」的話,你就會遲到。除了極端巧合的例外,從來只有「早到」或「遲到」,並沒有所謂的「守時」。你要打算「早到」,才有機會「守時」。你願意付出的「早到」時間越多,「守時」的成功機會,就越大。

除了「個別事件要做到守時」的成本很高外,這個難題還有一個,高一個層次的版本:要訓練到一個的人,變到有「守時」的功力,本身的成本亦很高。

— Me@2023-08-29 11:52:56 AM

.

.

2023.08.30 Wednesday (c) All rights reserved by ACHK

Euler problem 15.1

— Poorly Drawn Lines

.

(defun factorial (n)
  (labels
      ((f-iter (m acc)
         (cond ((= m 0) acc)
               ('t (f-iter (1- m)
                           (* m acc))))))
    (f-iter n 1)))

(defun binomial (n r)
  (labels
      ((b-iter (m acc)
         (cond ((< m (1+ (- n r))) acc)
               ('t (b-iter (1- m)
                           (* m acc))))))
    (/ (b-iter n 1) (factorial r))))

.

— Me@2023-08-26 11:27:59 AM

.

.

2023.08.27 Sunday (c) All rights reserved by ACHK

Ex 1.30 Driven spherical pendulum, 1

Structure and Interpretation of Classical Mechanics

.

A spherical pendulum is a massive bob, subject to uniform gravity, that may swing in three dimensions, but remains at a given distance from the pivot.

Formulate a Lagrangian for a spherical pendulum, driven by vertical motion of the pivot.

~~~

How come [the equations]?

Maybe just using the above equation but set the r constant. But I have
to add a something in order to realize the moving center.

— Me@2006

.

[guess]

(define (KE-particle m v)
  (* 1/2 m (square v)))

(define ((extract-particle pieces) local i)
  (let* ((indices (apply up
                         (iota pieces
                               (* i pieces))))
         (extract (lambda (tuple)
                    (vector-map
                     (lambda (i) (ref tuple i))
                     indices))))
    (up (time local)
        (extract (coordinate local))
        (extract (velocity local)))))

(define (U-constraint R qs q lambd)
  (* lambd
     (- (square (- q qs))
        (square R))))

(define ((U-gravity g m) q)
  (let ((z (ref q 2)))
    (* m g z)))

(define ((L-rect m R qs U) local)
  (let* ((extract (extract-particle 3))

         (p (extract local 0))
         (t (time p))
         (q (coordinate p))
         (v (velocity p))

         (lambd (ref (coordinate local) 3)))

    (- (KE-particle m v)
       (U q)
       (U-constraint R (qs t) q lambd))))

(let* ((U (U-gravity 'g 'm))
       (xs (lambda (t) 0))
       (ys (lambda (t) 0))
       (zs (literal-function 'z_s))
       (qs (up xs ys zs))
       (L (L-rect 'm 'R qs U))
       (q-rect (up (literal-function 'x)
                   (literal-function 'y)
                   (literal-function 'z)
                   (literal-function 'lambda))))
  (show-expression
   ((compose L (Gamma q-rect)) 't)))
(+ (* (expt R 2) (lambda t))
   (* -1 g m (z t))
   (* 1/2 m (expt ((D x) t) 2))
   (* 1/2 m (expt ((D y) t) 2))
   (* 1/2 m (expt ((D z) t) 2))
   (* -1 (lambda t) (expt (z_s t) 2))
   (* 2 (lambda t) (z_s t) (z t))
   (* -1 (lambda t) (expt (z t) 2))
   (* -1 (lambda t) (expt (y t) 2))
   (* -1 (lambda t) (expt (x t) 2)))

\displaystyle{  L_r = \frac{1}{2} m \left| \dot {\vec r} (t) \right|^2  - mg z(t)  - \lambda(t) \left( \left| \vec r(t) - \vec r_s(t) \right|^2 - R^2 \right)  }

(define ((sf->rf qs) state-with-force)
  (let* ((extract (extract-particle 3))

         (p (extract state-with-force 0))
         (t (time p))
         (q (coordinate p))

         (lambd (ref (coordinate
                      state-with-force) 3))

         (r (ref q 0))
         (theta (ref q 1))
         (phi (ref q 2))

         (xs (ref qs 0))
         (ys (ref qs 1))
         (zs (ref qs 2))

         (x (+ (xs t)
               (* r (sin theta) (cos phi))))
         (y (+ (ys t)
               (* r (sin theta) (sin phi))))
         (z (+ (zs t)
               (* r (cos theta)))))

    (up x y z lambd)))

(let* ((xs (literal-function 'x_s))
       (ys (literal-function 'y_s))
       (zs (literal-function 'z_s))
       (qs (up xs ys zs))
       (q (up (literal-function 'r)
              (literal-function 'theta)
              (literal-function 'phi)
              (literal-function 'lambda))))
  (show-expression
   ((compose (sf->rf qs) (Gamma q))
    't)))

(define ((F->C F) local)
  (->local (time local)
           (F local)
           (+ (((partial 0) F) local)
              (* (((partial 1) F) local)
                 (velocity local)))))

(define (L-driven m R qs U)
  (compose
   (L-rect m R qs U)
   (F->C (sf->rf qs))))

[guess]

— Me@2023-08-20 05:02:09 PM

.

.

2023.08.23 Wednesday (c) All rights reserved by ACHK

未來騙局, 2

山盟海誓 2.3 | 離婚 3.2.2

這段改編自 2023 年 06 月 20 日的對話。

.

只有本來,沒有未來。

本來無未來。

承諾皆廢話,未來皆騙局。

除非,那潛在的未來事件,化成了現在,有法律效力的合約,即是未來如果任何一方不遵守,另一方會獲得賠償。亦即是話,所謂的「未來事件」,透過合約,「翻譯」成了現在事件。

.

「我如今鄭重承認你作我的妻子,並許諾從今以後,無論環境順逆,疾病健康,我將永遠愛慕尊重你,終生不渝。」

— 結婚誓言

「結婚誓言」沒有意思,因為不遵守的話,並沒有任何後果。

承諾 = 騙局

真正有意思的是「離婚協議」,因為它有法律效力,列明了雙方的權利與責任;在婚姻再運行不到時,可立刻啟動操作。

離婚協議,在感情還好時,即是結婚之前,才可以達成。正如人壽保險,在一個人還健康時,才可以買到。

— Me@2023-06-20 12:47:31 PM

.

.

2023.08.12 Saturday (c) All rights reserved by ACHK

Sequential speed



--recurse-paths
-r

recurse into directories


--symlinks
-y

store symbolic links as the link instead of the referenced file

.

zip -r -y /dest_folder/the_zip_file.zip /source_folder/

source_folder is the folder to be zipped.

dest_folder is the destination folder for storing the zip file.

After zipping, the resulting file is the_zip_file.zip, which is a zipped version of the source_folder.

— Me@2023-08-03 09:41:29 AM

.

.

2023.08.07 Monday (c) All rights reserved by ACHK

3.5 Calculating the divergence in higher dimension

A First Course in String Theory

.

Let \displaystyle{\vec f = f(r) \hat{\mathbf{r}}} be a vector function in \displaystyle{\mathbb{R}^d}.

Derive a formula for \displaystyle{\nabla \cdot \vec f} by applying the divergence theorem to a spherical shell of a radius \displaystyle{r} and width \displaystyle{dr}.

~~~

Volume and sphere area of an \displaystyle{n}-ball:

\displaystyle{    \begin{aligned}  V_{n}(R)&={\frac {\pi ^{\frac {n}{2}}}{\Gamma \left({\frac {n}{2}}+1\right)}}R^{n} \\    S_{n-1}(R)&={\frac {2\,\pi ^{\frac {n}{2}}}{\Gamma \left({\frac {n}{2}}\right)}}R^{n-1}  \end{aligned} \\     }

Divergence theorem:

\displaystyle{  \int_V \nabla \cdot \vec f dV   = \int_S \vec f \cdot \hat n dS   }

.

Let \displaystyle{V} be a spherical shell of radius \displaystyle{r} and width \displaystyle{dr}. Then

\displaystyle{    \begin{aligned}    \int_V \nabla \cdot \vec f dV     &= \left. \nabla \cdot \vec f \right|_r \int_V  dV \\     &= \left. \nabla \cdot \vec f \right|_r \left( S_{n-1}(r) dr \right) \\    \end{aligned} \\   }

and

\displaystyle{    \begin{aligned}    \int_S \vec f \cdot \hat n dS     &= f(r+dr) S_{n-1}(r+dr) - f(r) S_{n-1}(r) \\    \end{aligned} \\   }

.

So

\displaystyle{    \begin{aligned}    \left. \nabla \cdot \vec f \right|_r S_{n-1}(r) dr     &= f(r+dr) S_{n-1}(r+dr) - f(r) S_{n-1}(r) \\    \end{aligned} \\   }

\displaystyle{    \begin{aligned}    \left. \nabla \cdot \vec f \right|_r     &= \frac{1}{S_{n-1}(r)} \frac{f(r+dr) S_{n-1}(r+dr) - f(r) S_{n-1}(r)}{dr} \\    &= \frac{1}{S_{n-1}(r)} \frac{d}{dr} \bigg( f(r) S_{n-1}(r) \bigg) \\    &= \frac{1}{r^{n-1}} \frac{d}{dr} \bigg( r^{n-1} f(r) \bigg) \\      \end{aligned} \\   }

— Me@2023-08-02 09:28:32 AM

.

.

2023.08.02 Wednesday (c) All rights reserved by ACHK

A Lie

The Lucifer Effect, 2

.

gringoDan on June 11, 2018

This is a fascinating article about how much of the famous Stanford Prison Experiment was a sham.

The appeal of the Stanford prison experiment seems to go deeper than its scientific validity, perhaps because it tells us a story about ourselves that we desperately want to believe: that we, as individuals, cannot really be held accountable for the sometimes reprehensible things we do. As troubling as it might seem to accept Zimbardo’s fallen vision of human nature, it is also profoundly liberating. It means we’re off the hook. Our actions are determined by circumstance. Our fallibility is situational. Just as the Gospel promised to absolve us of our sins if we would only believe, the SPE offered a form of redemption tailor-made for a scientific era, and we embraced it.

It seems that we fell for the narrative fallacy every time this “research” was used as an explanation for behavior in the real world.

— The Lifespan of a Lie – Why can’t we escape the Stanford Prison Experiment?

— Hacker News

.

.

2023.07.30 Sunday ACHK

反情感勒索 2

人格堤壩 8 | 眾害取其輕 | The least of all evils, 12

這段改編自 2021 年 12 月 16 日的對話。

.

在那愚善的年代,我受到誤導,以為「任何情況下,不可令人不開心」。

那是十分荒謬的。

如果他人的不開心,不是我引起的話,那樣,我就沒有責任要,做些什麼事情,令到他開心。

— Me@2022-08-20 11:27:16 PM

.

一個人做一件事時,往往有超過一個原因。除了「主要原因」外,往往還有「其他原因」。情況許可的話,最好把「主要原因」講出來。那樣處事,會乾淨俐落,而自己的感受,亦會是最舒服的。情況不許可把「主要原因」,給人知道的話,你可以把「其他原因」講出來,而毋須講假話。

記住,千萬不要說假話,除非遇上極端的情形。「極端的情形」是指,如果當時不立刻直接說假話,別人或自己就會,受到嚴重的傷害。但是,既然稱得上是「極端的情形」,即是很少會發生。所以,在絕大部分情況下,你是不需要說假話的。

— Me@2010.10.03

.

十多年前我教了你,在不方便講「真正主要原因」時,可以改為用「真正次要原因」。

現在,內容大方向仍然正確,但細節方面,有一點補充。年青時,我以為的「不方便」,有部分時候,其實是幻覺。

.

有時候,我有權不給任何原因,甚至不理睬。

.

十多年前我教你時,所用的例子是,我讀物理碩士時,有一份功課習作,需二人一組合作。後來意見不合,我就不想再合作,所以刻意包裝成,我的錯誤:

「對於達不到你的要求,我不太好意思。為免影響你的成績,不如我們跟教授提議,分開習作,各自評分?」

那時已是凌晨,在電話中拖拖拉拉後,他終於同意。

.

現在的話,我處理同類事件的方法,則會終極直接。

合作要兩個人的同意,分開則只需一個。

請求對方的准許,只是客氣之辭。需要不要,則視乎個別情況。而在這件事,其實毋須那拍檔的准許。我只需要直接了當:

「我覺得繼續合作,不利雙方,所以,我決定了拆伙。」

在自己一人有權,做決定的事情上,千萬不要企圖,問准他人。

.

記住,和解、道歉 和 解釋 等,只適用於,還要相處的人。

.

別離沒有對錯 要走也解釋不多

— 現代愛情故事

— Me@2023-07-26 05:25:08 PM

.

.

2023.07.29 Saturday (c) All rights reserved by ACHK

Euler problem 14.2

import Data.Array ( listArray, (!) )
import Data.List ( elemIndex )

collatzLengthList m = collatzLengthArray
  where
    collatzLengthArray
      = listArray (1,m) $ 1:map collatzLength [2..m]
      where
        collatzLength n
          | b<=m = 1 + collatzLengthArray ! b
          | otherwise = 1 + collatzLength b
          where
            b
              | even n = n `div` 2 
              | otherwise = 3*n+1

e14 :: (Maybe Int, Integer)
e14 = (n, m)
  where
    m = maximum cArray
    cArray = collatzLengthList p
    p = 1000000
    n = elemIndex m cList
      where
        cList = 0:[cArray ! x | x <- [1..p]]

λ> :set +s
λ> e14
(Just 837799,525)
(1.74 secs, 2,193,219,920 bytes)

— Me@2023-07-25 11:55:41 PM

.

.

2023.07.26 Wednesday (c) All rights reserved by ACHK

Ex 3.1 State Derivatives

Functional Differential Geometry

.

Newton’s equations:

\displaystyle{  \begin{aligned}  D^2 X(t) &= A_x(X(t), Y(t)) \\  D^2 Y(t) &= A_y(X(t), Y(t))  \end{aligned}  }

Coordinate path \displaystyle{\sigma}:

\displaystyle{  \begin{aligned}  \sigma &= \chi \circ \gamma \\  \chi &= (\text{t}, \text{x}, \text{y}, \text{v}_x, \text{v}_y) \\  \end{aligned}  }

What is \chi?

It is a coordinate system on the manifold \mathbf{M}.

What is \gamma?

It is a parametric path.

(p.29) The integral curve of \mathbf{v}

\displaystyle{  \begin{aligned}  \gamma_\mathbf{m}^\mathbf{v}&: \mathbf{R} \to \mathbf{M} \\  \end{aligned}  }

is a parametric path on \mathbf{M} satisfying

\displaystyle{  \begin{aligned}  D(\text{f} \circ \gamma_\mathbf{m}^\mathbf{v})(t)  &= \mathbf{v}(\text{f})(\gamma_\mathbf{m}^\mathbf{v}(t))  = (\mathbf{v}(\text{f}) \circ \gamma_\mathbf{m}^\mathbf{v})(t) \\  \gamma_\mathbf{m}^\mathbf{v}(0) &= \mathbf{m} \\  \end{aligned}  }

What is \mathbf{m}?

(p.22) Let \mathbf{m} be a point on a manifold, \mathbf{v} be a vector on the manifold, and \mathbf{f} be a real-valued function on the manifold.

(define R5 (make-manifold R^n 5))
 
(define U5 (patch 'origin R5))
 
(define R5-rect
  (coordinate-system 'rectangular U5))

(define R5-rect-chi-inverse
  (point R5-rect))

(define R5-rect-point
  (R5-rect-chi-inverse
   (up 't 'x 'y 'v_x 'v_y)))
 
(define-coordinates
  (up t x y v_x v_y) R5-rect)
 
(define v5
  (literal-vector-field 'b R5-rect))
 
(show-expression
 ((v5 (literal-manifold-function
       'f_rect
       R5-rect))
  R5-rect-point))

(show-expression
 ((v5 (chart R5-rect)) R5-rect-point))

(p.29) We can recover the differential equations satisfied by a coordinate representation of the integral curve by letting \mathbf{f}=\chi.

\displaystyle{\begin{aligned}  D(f \circ \gamma_\mathbf{m}^\mathbf{v})(t)  &= \mathbf{v}(f)(\gamma_\mathbf{m}^\mathbf{v}(t))  = (\mathbf{v}(f) \circ \gamma_\mathbf{m}^\mathbf{v})(t) \\  \gamma_\mathbf{m}^\mathbf{v}(0) &= \mathbf{m} \\  \end{aligned}}

(p.29)

\displaystyle{\begin{aligned}  D \sigma(t) &= D(\chi \circ \gamma) (t) \\  &= ... \\  &= (b \circ \sigma)(t), \\  \end{aligned}}

where \displaystyle{  b = \mathbf{v}(\chi) \circ \chi^{-1}} is the coefficient function for the vector field \displaystyle{  \mathbf{v}} for the coordinates \displaystyle{  \chi} (see equation 3.7).

(define R5->R
  (-> (UP Real Real Real Real Real) Real))

(print-expression
 ((literal-function 'f (-> (X Real Real) Real))
  'x 'y))

(define v5
  (components->vector-field
   (up (lambda (b) 1)
       (lambda (b) (ref b 3))
       (lambda (b) (ref b 4))
       (lambda (b)
         ((literal-function 'A_x
                            (-> (UP Real Real) Real))
          (up (ref b 1) (ref b 2))))
       (lambda (b)
         ((literal-function 'A_y
                            (-> (UP Real Real) Real))
          (up (ref b 1) (ref b 2)))))
   R5-rect))

(show-expression
 ((v5 (chart R5-rect)) R5-rect-point))

(series:for-each
 print-expression
 (((exp (* 't v5)) (chart R5-rect))
  ((point R5-rect) (up 't 'x 'y 'v_x 'v_y)))
 3)

(series:for-each
 show-expression
 (((exp (* 't v5)) (chart R5-rect))
  ((point R5-rect) (up 't 'x 'y 'v_x 'v_y)))
 4)

(define ((((evolution order) delta-t v) f) m)
  (series:sum
   (((exp (* delta-t v)) f) m)
   order))

(show-expression
 ((((evolution 1) 'Delta_t v5) (chart R5-rect))
  ((point R5-rect)
   (up 't_0 'x_0 'y_0 'v_x0 'v_y0))))

(show-expression
 ((((evolution 2) 'Delta_t v5) (chart R5-rect))
  ((point R5-rect) 
   (up 't_0 'x_0 'y_0 'v_x0 'v_y0))))

— Me@2023-07-21 08:12:30 PM

.

.

2023.07.23 Sunday (c) All rights reserved by ACHK

Posted in FDG

Counting of identical bosons

Two bosons (non-composite) can occupy the same state, including the same spatial location. When they do, they are identical.

[guess]

So, for a particular system, you cannot know the number of bosons by counting. Counting does not work when you have no way to avoid double-counting.

To distinguish among different total numbers of identical bosons, you need to check, for example, the total energy of the system.

[guess]

— Me@2015-10-12 06:16:15 PM

— Me@2023-07-19 12:11:16 PM

.

.

2023.07.19 Wednesday (c) All rights reserved by ACHK

The Animatrix

Diary
[]
02[.]11[.]2003

I read "The Now Habit". I experienced the emotional 
downs yesterday again. But after 8 hours of sleep, 
my mind is much clearer now and can [has] start[ed] 
to work again, thank God J! 

05072003

just read animatrix, very deeply

06122002 
[]
One month ago, I had to construct a circuit to 
control the remote car. I was nervous and confused. 
I didn't know where to start. 
[]
    (I had told Ng zh ho and Chris Lau 
my nervousness on the Electronics.)
[]
    One cause of my nervous[ness] is due to 
the failure of the signal generator project 
in Year 1 Basic Electronics. And the cause 
of the failure, as I have found now, 
is that I am timid. The thing itself was not 
and is not difficult. It is my timidity, 
my indecision, and [my] inaction [that] 
make every simple thing difficult. 

(I have made my circuit work today, or tonight.)

Thank Spacetime!

.

.

2023.07.18 Tuesday (c) All rights reserved by ACHK

Memoize

Euler problem 14.1.2

.

(defun range (max &key (min 0) (step 1))
  (loop :for n :from min :below max :by step
        collect n))

(defun max-item (lst)
  (loop :for item :in lst
        :maximize item))

(defmacro r-nth (n lst)
  `(nth (- (length ,lst) ,n) ,lst))

(defun collatz-length (n c)
  (cond ((= n 1) c) 
        ((evenp n) (collatz-length (/ n 2) (1+ c)))
        ('t (collatz-length (1+ (* 3 n)) (1+ c)))))

(defun memoize (fn)
  (let ((cache (make-hash-table :test #'equal)))
    #'(lambda (&rest args)
        (multiple-value-bind (val win)
            (gethash args cache)
          (if win
              val
              (setf (gethash args cache)
                    (apply fn args)))))))

(setf (fdefinition 'collatz-length)
      (memoize #'collatz-length))

(time (max-item (mapcar #'(lambda (x)
                            (collatz-length x 1))
                        (range 1000001 :min 1))))

;; Heap exhausted (no more space for allocation).
;; 109314048 bytes available, 171127632 requested.

;; PROCEED WITH CAUTION.
;;    [Condition of type
;;       SB-KERNEL::HEAP-EXHAUSTED-ERROR]

(time (max-item (mapcar #'(lambda (x)
                            (collatz-length x 1))
                        (range 250001 :min 1))))

;; Evaluation took:
;; 1.380 seconds of real time

(time (max-item (mapcar #'(lambda (x)
                            (collatz-length x 1))
                        (range 250001 :min 1))))

;; Evaluation took:
;; 0.068 seconds of real time

— Me@2023-07-14 02:54:38 PM

.

.

2023.07.14 Friday (c) All rights reserved by ACHK

Ex 1.29 A particle of mass m slides off a horizontal cylinder, 2.2

Structure and Interpretation of Classical Mechanics

.

A particle of mass m slides off a horizontal cylinder of radius R in a uniform gravitational field with acceleration g. If the particle starts close to the top of the cylinder with zero initial speed, with what angular velocity does it leave the cylinder?

~~~

(define ((KE m g R) local)
  (let ((t (time local))
        (thetadot (velocity local)))    
    (* 1/2 m (square R) (square thetadot))))

(define ((PE m g R) local)
  (let ((t (time local))
        (theta (coordinate local))
        (thetadot (velocity local)))    
    (- (* m g R (- 1 (cos theta))))))

(define L (- KE PE))

(show-expression
 ((L 'm 'g 'R)
  (->local 't
           'theta
           'thetadot)))

(show-expression
 (((Lagrange-equations
    (L 'm 'g 'R))
   (literal-function 'theta))
  't))


This derivation is wrong, because the constraint force is missing.

.

(define ((F->C F) local)
  (->local (time local)
           (F local)
           (+ (((partial 0) F) local)
              (* (((partial 1) F) local)
                 (velocity local)))))

(define (q->r local)
  (let ((q (coordinate local)))
    (let ((r (ref q 0))
          (theta (ref q 1))
          (lambd (ref q 2)))
      (let ((x (* r (sin theta)))
            (y (* r (cos theta))))
        (up x y lambd)))))

(show-expression
 (q->r
  (->local 't
           (up 'r 'theta 'lambda)
           (up 'rdot 'thetadot 'lambdadot))))

(define (KE m vx vy)
  (* 1/2 m (+ (square vx) (square vy))))

(define ((T-rect m) local)
  (let ((q (coordinate local))
        (v (velocity local)))
    (let ((xdot (ref v 0))
          (ydot (ref v 1)))
      (KE m xdot ydot))))

(show-expression
 ((T-rect 'm)
  (up 't
      (up 'x 'y 'lambda)
      (up 'xdot 'ydot 'lambdadot))))

(show-expression
 ((T-rect 'm)
  ((F->C q->r)
   (->local 't
            (up 'r 'theta 'lambda)
            (up 'rdot 'thetadot 'lambdadot)))))

(define ((U-rect g m) local)
  (let* ((q (coordinate local))
         (y (ref q 1)))
    (* g (+ (* m y)))))

(define (L-rect g m)
  (- (T-rect m) (U-rect g m)))

(define (L g m)
  (compose
   (L-rect g m) (F->C q->r)))

(show-expression
 ((L 'g 'm)
  (->local 't
           (up 'r 'theta 'lambda)
           (up 'rdot 'thetadot 'lambdadot))))

(show-expression
 (((Lagrange-equations
    (L 'g 'm))
   (up
    (literal-function 'r)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

(define ((U-constraint R) local)
  (let* ((q (coordinate local))
         (x (ref q 0))
         (y (ref q 1))
         (lambd (ref q 2))
         (r_sq (+ (square x) (square y))))
    (* lambd (- r_sq (square R)))))

(define ((U2-constraint R) local)
  (let* ((q (coordinate local))
         (x (ref q 0))
         (y (ref q 1))
         (lambd (ref q 2))
         (r_sq (+ (square x) (square y))))
    (* lambd (- (sqrt r_sq) R))))
(define (L-rect-constraint g m R)
  (- (T-rect m) (+ (U-rect g m) (U-constraint R))))

(define (L2-rect-constraint g m R)
  (- (T-rect m) (+ (U-rect g m) (U2-constraint R))))

(show-expression
 ((L-rect-constraint 'g 'm 'R)
  ((F->C q->r)
   (->local 't
            (up 'r 'theta 'lambda)
            (up 'rdot 'thetadot 'lambdadot)))))

(show-expression
 ((L2-rect-constraint 'g 'm 'R)
  ((F->C q->r)
   (->local 't
            (up 'r 'theta 'lambda)
            (up 'rdot 'thetadot 'lambdadot)))))

(show-expression
 (((Lagrange-equations
    (compose (L-rect-constraint 'g 'm 'R) (F->C q->r)))
   (up
    (literal-function 'r)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

(show-expression
 (((Lagrange-equations
    (compose (L2-rect-constraint 'g 'm 'R) (F->C q->r)))
   (up
    (literal-function 'r)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

(show-expression
 (((Lagrange-equations
    (compose (L-rect-constraint 'g 'm 'R) (F->C q->r)))
   (up
    (lambda (t) 'R)
    (literal-function 'theta)
    (literal-function 'lambda)))
  't))

— Me@2023-07-12 10:00:19 PM

.

.

2023.07.13 Thursday (c) All rights reserved by ACHK

Russell’s paradox

Universal set, 2 | For all, 4.2 | Alfred Tarski, 1.3

.

The universal set is the set that contains everything, including itself.

Since it contains everything, it should be the biggest set. However, according to the power set theorem, for any set A, its power set P(A) has more elements. So the power set of the universal set should have more elements than the universal set. This is the paradox of universal set.

The cause of the paradox is the mixing of language levels. That is exactly what the word “paradox” means. A logical error (dox) due the mixing of the language and its meta-language (para-language).

The cause of the language level mixing is the meaninglessness of the word “everything”. “Everything” (or “all”) is meaningful only if within a context, such as:

All the people in this house.

When you use “everything” without a context, it will include itself, thus the mixing of language levels.

— Me@2015-12-27 02:12:12 PM

— Me@2023-07-11 10:57:17 AM

.

.

2023.07.12 Wednesday (c) All rights reserved by ACHK