2010年11月13日土曜日

maximaで使用する数式の関数f(x):=x+1などをlisp内で定義する

(setf (symbol-plist $f) '(MPROPS (NIL MEXPR ((LAMBDA) ((MLIST) $x) (MPLUS $x 1)))))
maximaで
f(x):=x+1;
としたことと同義。

下記のようにすれば、maximaの表示上は定義してように見えるが、その関数を呼び出すことはできない。
(list `(mdefine simp) func2 (mul2 ini (pow '%e ($intstyle e2 y))))


メモ
(setq func1 (concat x n))
(setq func2 (list `(,func1 simp) y))
(setf result1 (mul2 ini (pow '%e ($intstyle e2 y))) )
(setf result2 `(MPROPS (NIL MEXPR ((LAMBDA) ((MLIST) ,y) ,result1))) )
(setf (symbol-plist func1) result2)

0 件のコメント:

コメントを投稿