Question: Error, index out of bounds

I have a problem with writing this equation in maple.

the equation is: 

I want to write this equation in maple, so I write it in this way:

for k from 1 to 7 do tau[k] := add*(d(k, j)*(diff(theta[j](t), t, t)), j = 1 .. 7)+add(add(c[i, j, k]*(diff(theta[i](t), t))*(diff(theta[j](t), t)), j = 1 .. 7), i = 1 .. 7)+phi[k] end do:

but I see this error: Error, index out of bounds 

I appriciate if you help me find the problem.

Please Wait...