Monday, April 6, 2009

Mathematica memos

Concepts:

  • Polynomial is displayed different from the "standard" math form
  • There are a number of cell types. Only input cell can be calculated.

Tips:

  • constants: Pi, I, E
  • ?var is used to inquired about the variable named var, while ?`* about all global variables
  • Clear[var1, var2, var3] (or var1=) clears variables var1, var2 and var3, while Remove[var1, var2, var3] removes variables var1, var2 and var3
  • Clear["`*"], Remove["`*"]: clears/removes all global variables
  • N[expression, n] displays numerically with n significant digits (default value is 6), N[exp] is equivalent to exp//N
  • %, %%, %%% and so on recall the previous values
  • ?cmd, ??cmd, ?*md, ?c*, ?`* (or c* Ctrl+K): help for commands
  • Plus[a,b,...] vs a+b+..., Times[a,b,...] vs a*b*..., Substract[a,b] vs a-b, Divide[a,b] vs a/b, Minus[a] vs -a, Power[a,b] vs a^b, Power[a,b,c] vs a^b^c
  • Equal[x,y] vs x==y, Uneqaul[x,y] vs x!=y, Less[x,y], Great[x,y], LessEqual[x,y], Great[x,y]
  • And[p,q], p&&q; Or[p,q], pq; Xor[p,q]; Not[p], !q; Implies[p,q]