Top Mathematica Tips
Started by: elishapetersonelishapeterson
On: 1221071955|%e %b %Y, %H:%M %Z|agohover
Number of posts: 4
rss icon RSS: New posts
Summary:
Some Mathematica tips to help get you started. Submit your own for bonus points!
Top Mathematica Tips
elishapetersonelishapeterson 1221071955|%e %b %Y, %H:%M %Z|agohover

Here are some Mathematica tips… reply with your own, or email me, and I'll award some bonus points!

The Three Most Common Errors

  1. Did you use square brackets for functions?
  2. Did you capitalize function names?
    • Example: use "Cos[t]", not "cos[t]" or "Cos(t)" or "Cos t"
    • If its blue, Mathematica will treat it as a variable
  3. Do you have spaces or "*" whenever you multiply two variables?
    • Example: "xy" is the variable named "xy" whereas "x y" and "x*y" represent the product of "x" and "y".
mma-sections.png

Brackets, Braces, etc.

  • Use parentheses for order of operations, e.g. "(1+x)^2"
  • Use square brackets for functions, e.g. "Plot3D[ ]" or "Sin[t]"
  • Use curly braces for vectors, e.g. "{3,4,5}" represents the vector \langle3,4,5\rangle
  • Use curly braces for lists also, e.g. defining plot parameters as "{t,-5,5}"

Section Titles and Cell Formatting

Use formatting commands to add in section headings, problem statements, and notes to your workbooks. The easiest way to do this is to highlight a cell (click on the bracket on the righthand side of the window) and then hit Alt+1, Alt+2, etc. I cycle through these until I find what I want.

last edited on 1221249622|%e %b %Y, %H:%M %Z|agohover by elishapeterson + show more
unfold Top Mathematica Tips by elishapetersonelishapeterson, 1221071955|%e %b %Y, %H:%M %Z|agohover
Re: Top Mathematica Tips
Anonymous (134.240.241.x) 1221449805|%e %b %Y, %H:%M %Z|agohover

CDT PVT Burdick- Make sure you capitalize the first letter of pi if you are just typing it in a constant: use "Pi", not "pi".

last edited on 1221766284|%e %b %Y, %H:%M %Z|agohover by elishapeterson + show more
unfold Re: Top Mathematica Tips by Anonymous (134.240.241.x), 1221449805|%e %b %Y, %H:%M %Z|agohover
Re: Top Mathematica Tips
Anonymous (134.240.241.x) 1222342999|%e %b %Y, %H:%M %Z|agohover

When graphing Plot3D, make sure you specify possible values for x and y. When just using Plot, only specify values for x.
CDT PVT BAKER

unfold Re: Top Mathematica Tips by Anonymous (134.240.241.x), 1222342999|%e %b %Y, %H:%M %Z|agohover
Re: Top Mathematica Tips (partial derivatives)
elishapetersonelishapeterson 1223305405|%e %b %Y, %H:%M %Z|agohover

A common error when calculating partial derivatives at a point is to define "f[x_,y_]:=" and then (assuming for now (x,y)=(1,2)) to try "\partialxf[1,2]". This doesn't work! Mathematica evaluates "f[1,2]" first and then takes the derivative, so the value is ALWAYS 0. Instead, type "\partialxf[x,y]/.{x->1,y->2}". Alternately, you can define "fx[x_,y_]:=\partialxf[x,y]" and then type "fx[1,2]".

last edited on 1223305674|%e %b %Y, %H:%M %Z|agohover by elishapeterson + show more
unfold Re: Top Mathematica Tips (partial derivatives) by elishapetersonelishapeterson, 1223305405|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License