Quit[]

(* Evaluate the following to see NDSolve at work // Notice how StepMonitor grabs the data and Dynamic updates the plot *)

data={{0,1}};
k=0;
ProgressIndicator[Dynamic[k],{0,30}]
Dynamic[ListPlot[data,Frame->True,PlotRange->{{0,31},{0,1.2}}]]
NDSolve[{y'[x]==y[x]Cos[x+y[x]],y[0]==1},y,{x,0,30},StepMonitor:>(Pause[.01];Set[k,x];AppendTo[data,{x,y[x]}])];