Next: Package rducon, Previous: Package functs, Up: simplification [Contents][Index]
ineq
パッケージは不等式の整理規則を含みます。
セッション例:
(%i1) load("ineq")$ Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. Warning: Putting rules on '+' or '*' is inefficient, and may not work. (%i2) a>=4; /* a sample inequality */ (%o2) a >= 4 (%i3) (b>c)+%; /* add a second, strict inequality */ (%o3) b + a > c + 4 (%i4) 7*(x<y); /* multiply by a positive number */ (%o4) 7 x < 7 y (%i5) -2*(x>=3*z); /* multiply by a negative number */ (%o5) - 2 x <= - 6 z (%i6) (1+a^2)*(1/(1+a^2)<=1); /* Maxima knows that 1+a^2 > 0 */ 2 (%o6) 1 <= a + 1 (%i7) assume(x>0)$ x*(2<3); /* assuming x>0 */ (%o7) 2 x < 3 x (%i8) a>=b; /* another inequality */ (%o8) a >= b (%i9) 3+%; /* add something */ (%o9) a + 3 >= b + 3 (%i10) %-3; /* subtract it out */ (%o10) a >= b (%i11) a>=c-b; /* yet another inequality */ (%o11) a >= c - b (%i12) b+%; /* add b to both sides */ (%o12) b + a >= c (%i13) %-c; /* subtract c from both sides */ (%o13) - c + b + a >= 0 (%i14) -%; /* multiply by -1 */ (%o14) c - b - a <= 0 (%i15) (z-1)^2>-2*z; /* determining truth of assertion */ 2 (%o15) (z - 1) > - 2 z (%i16) expand(%)+2*z; /* expand this and add 2*z to both sides */ 2 (%o16) z + 1 > 0 (%i17) %,pred; (%o17) true
不等式の回りで括弧を使うことについて注意してください;
ユーザーが(A > B) + (C = 5)
と入力した時、
結果はA + C > B + 5
ですが、A > B + C = 5
は構文エラーであり、
(A > B + C) = 5
は完全に何か他のものです。
規則定義の完全なリストを見るには、
disprule (all)
を実行してください。
Maximaが不等式に掛けられる量の符号を決定できない時、 ユーザーは問い合わせを受けるでしょう。
最もありふれた仕様の欠陥を以下に例示します:
(%i1) eq: a > b; (%o1) a > b (%i2) 2*eq; (%o2) 2 (a > b) (%i3) % - eq; (%o3) a > b
別の問題は0掛ける不等式です;
これを0にするデフォルト動作はそのままです。
しかし、
もしX*some_inequality
とタイプして、
MaximaがX
の符号を尋ね、
zero
(またはz
)と答えたなら、
プログラムはX*some_inequality
を返し、
X
が0という情報を使いません。
そんな時は、
データベースは、決定の際、X
を評価する目的ではなく、比較目的のためだけに使われるので、
ev (%, x: 0)
を実行すべきです。
パッケージがロードされた時、
整理器が、パッケージなしよりたくさんの規則を検証するよう強制されるので、
ユーザーはより遅い応答に気がつくかもしれません。
だから、これらを利用した後、規則を取り除きたいかもしれません。
(あなたが定義したかもしれないものすべてを含み)規則すべてを消すには、
kill (rules)
してください;
もしくは、もっと選択的にそれらのうちのいくつかだけ消すかもしれません;
もしくは、特定の規則にremrule
を使ってください。
もし自分の規則を定義した後、このパッケージをロードするなら、
同じ名前を持つあなたの規則をつぶすでしょう。
このパッケージの規則は以下の通りです:
*rule1
, ..., *rule8
,
+rule1
, ..., +rule18
,
そして、それを参照するには、
"+"
に関する最初の規則を限定して取り除くためのremrule ("+", "+rule1")
とか、
二番目の乗法規則の定義を表示するためのdisprule ("*rule2")
とか、
規則名を引用符で囲まなければいけません。
Next: Package rducon, Previous: Package functs, Up: simplification [Contents][Index]