Wolfram Computation Meets Knowledge

How do I define variables with subscripts or superscripts using the Notation Package?

In the Wolfram Language, attempting to define variables with subscripts can lead to errors. You can resolve any issues with defining such variables by using the function Symbolize in the Notation Package.

The Wolfram Language uses various syntactic rules to interpret input. In particular, expressions with subscripts are treated as functions of their components and not independent symbols. This can lead to recursion errors or other undesired behavior.

Example 1:

In[1] := p = 2 p0

$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of 
Subscript[p, 0].

Out[1] = Hold[2 p0]

Example 2:

In[2] := {x, xn} /. x->8
Out[2] = {8, 8n}

Expressions containing subscripts, superscripts or more general symbols can be specified as variables using the Symbolize function in the Notation Package.

  1. Load the Notation Package into your Wolfram Language session using the command:
    <<Notation`

    A window opens containing a truncated version of the Notation palette.

  2. Click the Symbolize button. The Symbolize function template is inserted into the current notebook, and the placeholder square is selected.

  3. Type or paste the expression you would like to use as a variable into the highlighted placeholder square.
  4. Evaluate the Symbolize expression with Shift+Enter.

The Symbolized expression is now interpreted as an atomic expression and not a function of its components.

In[3] := p = 2 p0

Out[3] = 2 p0

In[4] := p2

Out[4] = 4 p02

Please note that when using the Notation Package and the Symbolize function, it is necessary to insert the function template from the relevant palette.

この項目は役に立ちましたか?
はい
いいえ

ご意見・ご提案がおありでしたらお書きください.

フィードバックをありがとうございました.

送信

サポートへのお問合せ

お支払い,アクティベーションに関する質問から技術的な質問まで,お気軽にお問い合せください.

販売代理店 (ライセンスをお持ちの方は、ご購入された代理店にお問い合わせください)

Hulinks

電話:03-5642-8380
Fax:03-5642-8381

soft.sales@hulinks.co.jp
Webサイト

日本電子計算株式会社

電話:03-5210-0184
Fax:03-5210-0229

math_info@cm.jip.co.jp
Webサイト

亘香通商株式会社

電話:045-320-2711
Fax:045-320-9342

sales@senko-corp.co.jp
Webサイト

株式会社シーエムディーラボ

電話:03-3408-8406
Fax:03-3408-8406

info@cmdlab.co.jp
Webサイト