Recitation on Sept. 8 2011

This will be nearly incomprehesible...

Cos[orange]

DateString[]

bond = DateString[]

Sin[bond]

orange = Pi/2 + shift

Sin[orange]

aplot = Plot[Sin[x],{x,0,4 Pi}]

corner[1] = {0,0,1};

corner[2] = {1,0,0};

p1 =Permutations[{0,0,1}]

p2 =Permutations[{0,1,1}]

p0 = {0,0,0}

pfinal = {1,1,1}

corners = Join[p1,p2,{p0},{pfinal}]

corners[[4]]

radius = 1/4

cornerSpheres =Table[Sphere[corners[[i]],radius],{i,1,8}]

centerSphere= Sphere[{1/2,1/2,1/2},(1/4)]

bccGraphic = Graphics3D[{Yellow,centerSphere}]

cornersGraphic =Graphics3D[cornerSpheres]

Show[cornersGraphic,bccGraphic]

THere are three types of equals....

direct (or immediate) assignemt: =

aVariable = Sin[Pi/2]

theTime = DateString[]

theTime

Table[Pause[1];theTime,{i,1,3}]

Delayed assignment--don’t anything until I ask for it later....

aTime := DateString[]

aTime

Table[Pause[1]; aTime,{i,1,3}]

One more kind of “=”, and this logical equality----- ==

what = 0 Sin[1];

when = Sin[Pi];

what == when

what == WHEN

1 == 2

Solving equations

lhs = x^2 + 4 x + b

rhs = 0

theEquation = (lhs== rhs)

xRule =Solve[theEquation,x]

this is a list of two lists.  Each of the two lists contains a “rule”

bRule = Solve[theEquation,b]

The operator /. which means “appy the following rule” and a rule is structured like this a->anothervalue

lhs/.bRule

lhs/.xRule

Simplify[lhs/.xRule]

lhs = Log[1/x]

rhs= Log[x^2]

theEq = rhs == lhs

Solve[theEq,x]

Numerical solutions to equations

lhs = Log[1/x]

rhs= Exp[x^2]

theEq = rhs == lhs

Solve[theEq,x]

Plot[{(E^(x^2)), Log[(1/x)]},{x,0,1}]

theEq

FindRoot[theEq,{x,1/2}]