Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
2

Nice naming of variables with subscript or superscript, avoiding variable names like phi_jm1_np1 (ϕn+1j1)

asked 12 years ago

boyfarrell gravatar image

updated 12 years ago

In my worksheets I have many variables with subscripted/superscripted names like phi_jm1_np1, where the mathematical notation is simple, ϕn+1j1. Is there a compact notation, or simply a better way, of dealing with subscripts and superscripts using sage?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

slelievre gravatar image

You might want to combine your variables into a tuple of tuples, or into a dictionary, and write

phi[j-1][n+1]

or

phi[j-1,n+1]
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 12 years ago

Seen: 3,511 times

Last updated: Apr 15 '13