Mathematica workshop

October 2, 2014

Presenter: Gautam Dasgupta
dasgupta@columbia.edu

Topics

0 to 5 minutes: Resources

5 to 10 minutes: Computer Mathematics

10 to 15 minutes : Replacement rules

15 to 20 minutes : Basic structures

20 to 30 minutes : Linear Algebra

30 to 35 minutes : Modifying system rules

35 to 45 minutes : Research Application

45 to 55 minutes : Q & A

Mathemaics vs. Computer Mathematics

Traditional Mathematics

y = y (x); y(a)

Computer Mathematics

yValue = yFunction[x]

FullForm[a * b]

a {b,c,d}

a + {b,c,d}

User  defined functions can have any
system function property.

SetAttributes[f, Listable]

f[a , {b,c,d}]

Integral examples:

Integrate[ArcTan[x], x]

Integrate[Exp[-x] ArcTan[x], x]

Integrate[Sqrt[ArcTan[x]], x]

Replacement rules

solution1=Solve[x^2==a, x]

solution2=Solve[{x^2==a, x* y ==b}, {x,y}]

z=x* y^2

z/. solution1

z/. solution2

Sin[θ] /. Sin -> Cos

Basic structures

Expressions of symbols

special symbols: numbers: 1, 2, ..., π, ...

operational symbols: Times, Plus, f...

recursive relations between symbols and operators

Linear Algebra

inner product

a={{p1, q1, r1},{p2, q2, r2}}

MatrixForm[a]

b={{x}, {y},{z}}

MatrixForm[b]

a . b

MatrixForm[a . b]

Outer product

a={p,q,r}

b={x,y}

Outer[f,a,b]

MatrixForm[%]

Jacobian

a={p[x,y],q[x,y]}

Outer[D, a,b]

TableForm[%]

Pseudoinverse

?PseudoInverse

m={{1,2,3},{4,5,6},{7,8,9}}

Det[m]

PseudoInverse[m]

Modifying system rules

m={{1,2,3},{4,5,6},{7,8,9}}

Inverse[m]

Unprotect[Inverse]

Inverse[m_/; Det[m]==0]:=PseudoInverse[m]

n=Inverse[m]

verify

m . n

n.m

Inverse[n]

(m .n) .m

(n.m).n

(n.m).n-n

a few more steps

a few more steps

MatrixForm[n.m]

(n.m)-Transpose[(n.m)]

Clear[a,b];mm={a,b}

PseudoInverse[mm]

mm={{a,b}}; MatrixForm[mm]

mm={{a},{b}}; MatrixForm[mm]

PseudoInverse[mm]

for real values

nn=PseudoInverse[mm]/. Conjugate[x_]->x

Simplify[nn.mm]

pp=Simplify[mm.nn]

Det[pp]

Research Application