Question: unable to convert to an explicit first-order system

Hello

I tried to modelise the move of a pendulum. I have this equation:

eq := (1/2)*m*((l+r)^2+(1/5)*r^2)*(diff(theta(t), t))^2-m*g*(l+r)*(cos(theta(t))+cos(angleInitial)) = 0;

 

I tried this programme:

pend := proc (a0, l, r, m,nbpoints)
local eq, sol, valeurstheta, x, y, plotseq, g;
g := 9.81;
eq := (1/2)*m*((l+r)^2+(1/5)*r^2)*(diff(theta(t), t))^2-m*g*(l+r)*(cos(theta(t))+cos(angleInitial)) = 0;
sol := dsolve({theta(0) = a0, eq}, theta(t), numeric);
valeurstheta := seq(rhs(sol((1/30)*i)[2]), i = 1 .. nbpoints);
x := seq(l*sin(valeurstheta[i]), i = 1 .. nbpoints);
y := seq(l*(1-cos(valeurstheta[i])), i = 1 .. nbpoints);
plotseq := [seq(plot([[x[i], y[i]]], style = point), i = 1 .. nbpoints)];
plots:-display(plotseq, insequence = true)
end proc;

 

But it does not work.

It is written: Error, (in DEtools/convertsys) unable to convert to an explicit first-order system

I see that Maple can't solve my diff equation but I don't know what I have to do.

 

Thank for your help.

Please Wait...