Question: When to use '()' and '[]'.

de := diff(theta(t), `$`(t, 2))+c*(diff(theta(t), t))+9.8*sin(theta(t))/L = 0; c := 2; L := 2;
init := theta(0) = 0, (D(theta))(0) = 4;
sol := dsolve({de, init}, theta(t), numeric, output=listprocedure);
Theta := subs(sol, theta(t));
plots[animate](plots[arrow],[[0,0],[L*sin(Theta(t)),-L*cos(Theta(t))],colour=red],t=0..5, axes=none,scaling=constrained);

these lines of codes were posted by robert Israel in one of his posts.

my question is after solving the ODE the results (t,th(t),dth(t)) are stored in a list called sol...so if i want to access theta at time 1..i will have to use sol[2](2)...why not sol(2)(2)....what diff dus these two brackets make anyway?..

thanks.

 

Please Wait...