My first Manipulate program. Simulate of a pendulum which is being pulled up as it swings.

Remove["Global`*"];

maxLength=1000;
u=Manipulate[Module[{g,r,simRate=0.001},
r=l-α t;
eq=r θ''[t]-2 α θ'[t]+g Sin[θ[t]];
g=9.8;
maxTime=(l/α);
s=θ/.First[NDSolve[{eq==0,θ[0]==θ0*Pi/180,θ'[0]==v0},θ,{t,0,maxTime-0.001},MaxSteps->200000,MaxStepFraction->0.0001]];


getNormalizedAngle[θ_]:=Module[{q=θ},
{
If[q>=0,q=Mod[q,2 Pi],{q=-q;q=Mod[q,2 Pi];q=-q;q=q+2 Pi}];
q*180/Pi
}
];

getQuadrent[a_]:=Module[{q},
{
If[a≥0&&a≤Pi/2,q=1];
If[a>Pi/2&&a≤Pi,q=2];
If[a>Pi&&a≤(3/2)Pi,q=3];
If[a>(3/2)Pi&&a≤2Pi,q=4];
q
}
];
coordinates[s_,t_,l_,α_]:=Module[{θ,p=False,q},
{θ=s[t];
If[p,Print["t=",t," θ=",θ*180/Pi]];
If[θ>=0,θ=Mod[θ,2 Pi],{θ=-θ;θ=Mod[θ,2 Pi];θ=-θ;θ=θ+2 Pi}];
q=First[getQuadrent[θ]];
If[p,Print["after mod t=",t," θ=",θ*180/Pi]];
If[p,Print["q=",q]];

r=l-α t;
If[p,Print["r=",r]];
If[q==1,{x=r Sin[θ],y=-r Cos[θ]}];
If[q==2,{θ=θ-Pi/2;x=r Cos[θ],y=r Sin[θ]}];
If[q==3,{θ=θ-Pi;x=-r Sin[θ],y=r Cos[θ]}];
If[q==4,{θ=θ-(3/2)Pi;x=-r Cos[θ],y=-r Sin[θ]}];
If[p,Print["x=",x," y=",y]];
If[p,Print["******"]];
{x,y}
}
];
d=coordinates[s,ts,l,α];
Graphics[ {  {Gray,Dashed ,Line[{{-maxLength,0},{maxLength,0}}]}, {Gray,Dashed ,Line[{{0,-maxLength},{0,maxLength}}]},Text["θ= "<>ToString[First[getNormalizedAngle[ s[ts] ] ]],{.4 l,.9 l}],
Text["current string length L(t)=(Subscript[L, 0])-α t="<>ToString[r],{.4 l,.8 l}],
Text["current time t (sec)="<>ToString[ts],{.4 l,.7l}],
Text["L[t] θ''[t]-2 α θ'[t]+g Sin[θ[t]]=0",{.4 l,.6 l}],
Line[{ {0,0},First[d]} ],
PointSize[.03],Red,Point[First[d]]},PlotRange->{{-l-.1l,l+.1 l},{-l-.1 l,l+.1 l}},ImageSize->{450,325}]
],
{{l,0.9 maxLength,"(Subscript[L, 0]), Initial string"},1,maxLength,1,Appearance->"Labeled"},
{{α,1,"α (rate of string shrinkage)"},0.1,10,0.1,Appearance->"Labeled"},
{{θ0,45,"initial position in degrees θ(0)"},0,360,1,Appearance->"Labeled"},
{{v0,0,"initial angular speed in rad/sec θ'(0)"},0,100,1,Appearance->"Labeled"},
{{ts,0,"current simulation time (sec)"},0,(l/α)-0.001,(0.0001(l/(α ))),Appearance->"Labeled"},ContinuousAction->True,AutorunSequencing->{{5,60}},FrameLabel->"A shrinking Pendulum. by Nasser Abbasi, July 2007"]

(*Export["shrink_pendulum3.swf",u];*)