I have been trying to plot those specific recursively defined functions p1 and q1 in Mathematica:
Δt = 10^(-1);
q1[j_] := q1[j] = q1[j - 1] + Δt*p1[j - 1];
p1[j_] := p1[j] = p1[j - 1] - Δt*Sin[q1[j - 1]];
q1[0] = π/12;
p1[0] = 0;
graph1q = ListPlot[Table[{j, q1[j]}, {j, 0, 20}], PlotStyle -> Green];
graph1p = ListPlot[Table[{j, p1[j]}, {j, 0, 20}], PlotStyle -> Green];
If you set jmax = 10, it's really fast, however the times raises too much when calculating more points. I have tried to put jmax = 50 and left for lunch. After an hour it didn't finish. Doing the same algorithm in Excel take less than a second!
Anybody got an idea why Mathematica has been taking so long to calculate the points?
q1[0] = Pi/12.;p1[0] = 0.;– Daniel Lichtblau Nov 05 '14 at 16:41