Recitation 15 September (recitation 1)

DSolve[D[x[t],t]== x[t]^2,x[t],t]

Manipulate[
Plot[Sin[a + Sin[x a]],{x,0,10}],
{a,.1,20}
]

This is an active object

A question in the lab ambigous about the “length of vector”

Random vector in three dimensions of magnitude 10

myVec[nDims_,range_, myMag_] := 
Module[{currentMag, randomVec},
randomVec=RandomReal[{-range,range},{nDims}];
currentMag = Sqrt[randomVec.randomVec];
((myMag randomVec)/currentMag)

]

myVec[4,10000,10]

Numerical solutions

lhs = a x^5 + b x^4 + c x^3 + d x^2 + e x + f

asol = Solve[lhs== 0,x]

bsol = asol/.{a-> Pi, b -> 12, c-> 19, d-> -2, e-> 11, f-> 22}

thesols =x/.bsol

N[thesols]

odeLHS =-D[y[x],{x,2}]^2 + Exp[Sin[x]]

odeRHS = 0

DSolve[odeLHS == odeRHS,y[x],x]

NDSolve[{odeLHS == odeRHS,y[0] == 1,y'[0]==0}, y[x], {x,0,50}]

temp=y[x]/.{NDSolve[{odeLHS == odeRHS,y[0] == 1,y'[0]==0}, y[x], {x,0,1}]}

Plot[Log[temp/.x-> xx],{xx,0,50}]