Question: Storing value in matrix error

I am currently receiving the following error: Error, (in UpdateTrueVelocities) unable to store '100*cos(20)' when datatype=float[8].  I'm not exactly sure why the Maple is complaining about this.  100*cos(20) definitely evaluates to a float.  Any help would be greatly appreciated. Thank you.  EDIT: for some reason, it won't let me add tabs in my code.  Sorry about that.

vel := Matrix(4, 241, datatype = float[8]);

accel := Matrix(3, 241, datatype = float[8]);

initialVelocity := 100;

initialThetaDeg := 35;

initialThetaRad := (1/180)*angleDeg*Pi;

initialXVel := initialVelocity*cos(initialThetaRad);

initialYVel := -100;

initialZVel := initialVelocity*sin(initialThetaRad)

UpdateTrueVelocities := proc (i, vel::Matrix, accel::Matrix, initialXVel, initialYVel, initialZVel)

if 1 < i then

vel(1, i) := vel(1, i-1)+accel(1, i-1);  #Clearly my error is right here.

vel(2, i) := vel(2, i-1)+accel(2, i-1);

vel(3, i) := vel(3, i-1)+accel(3, i-1);

else

vel(1, 1) := initialXVel;

vel(2, 1) := initialYVel;

vel(3, 1) := initialZVel

end if;

vel(4, i) := sqrt(vel(1, i)^2+vel(2, i)^2+vel(3, i)^2);

NULL;

end proc;

 

for i to 241 do

UpdateTheta(i, relVel, theta1, initialTheta)

end do;

Please Wait...