Question: Need help to animate a pendulum

 

 

Hello,

I would like to create a model of a sinngle pendulum with Maple 13

I began but I cannot manage to animate it

Here is what i have already written:

 

pendulum:=proc(l,initialAngle,initialSpeed)

local eq,sol,angledata,x,y,plotseq

eq:=diff(θ(t),t,t) + 9.81/l sin(θ(t)) = 0;

sol:=dsolve({eq,θ(0)=initialAngle,D(θ)(0)=initialSpeed},θ(t),numeric);

thetadata:=seq(rhs(sol(i/30)[2]),i=0..500);

x:=seq(l*sin(angledata[i]),i=1..500):

y:=seq(l*cos(angledata[i]),i=1..500):

plotseq:=[seq(plot([[x[i],y[i]]],style=point),i=1..500):

display(plotseq,insequence=true);

end proc;

 

What's wrong with that?

I would like to see the pendulum moving.

Thank for your help

Please Wait...