I'm trying to plot this:
i = 0.01;
ListLinePlot[Table[Cos[x]^p, {x, 0, π/2, i}, {p, 0, 1, i}],
ImageSize -> 400, PlotRange -> {{0, 100}, {0, 1}}]
ListLinePlot[Table[Cos[p x], {x, 0, π/2, i}, {p, 0, 1, i}],
ImageSize -> 400, PlotRange -> {{0, 100}, {0, 1}}]
When i = 0.001, it takes a lot of time to render and my computer become unusable. Is there something I can do for rendering it faster or at least making the process slower so I can use my computer normally?
I have a Nvidia GTX460 video board and I know about the CUDA link, but if it's not asking too much, I'd like to get advice from someone who has more experience than me at such matters.
i=.001it takes about one minute on my Mac, no freeze or slowdown. What are you times? – A.G. Dec 31 '13 at 05:40i = 0.001;ListLinePlot[Table[Cos[x]^p, {x, 0, [Pi]/2, i}, {p, 0, 1, i}], ImageSize -> 400, PlotRange -> {{0, 100}, {0, 1}}, MaxPlotPoints -> 100]` :D – Dr. belisarius Dec 31 '13 at 06:00TablebyToPackedArray@Tablemore than doubles the speed. (usingNeeds["Developer"]`) – A.G. Dec 31 '13 at 06:13Interpolate@Table[Cos[p x], {x, 0, π/2, i}, {p, 0, 1, i}]and then plot it usingPlot. This is much better if you plan to export it as vector graphics, such as EPS because the file size will be much smaller. – C. E. Dec 31 '13 at 10:41m1 =andm2 =steps:m1 = RandomInteger[100, {4000, 1000, 100}]; f[x_] := x^2; m2 = MapThread[(f /@ #) #2 &, {m1, Range@Length@m1}];. The memory usage jumps up 3-4x for me. Now you might know why this happens, but most people don't. You can imagine that if you're working on a machine with low resources or iffwere more time consuming, there's a good chance your system is going to slow down a lot. – rm -rf Dec 31 '13 at 15:29Nestor equivalent) etc. they never think to check their system's vitals so it's hard to tell them what the issue is. – C. E. Dec 31 '13 at 15:50fwere more time consuming" hits the nail on the head in regards to what I don't understand. For me, I can calculate something that will take one minute or 24 hours, it still won't take up more than about a quarter of my processing power. Why do time consumption matter for slow downs? And even on computers with low resources, can MMA really use up the entire CPU power even if the code isn't parallelized? Or does time consumption up the amount of memory used? – C. E. Dec 31 '13 at 18:12RandomInteger's extra arguments instead ofTable, usedMap,MapThreadinstead ofForloops... butMapThreadunpacks, which blows up the memory usage. My example only unpacks 1 level, so it could be much worse. – rm -rf Dec 31 '13 at 18:27fwas to point out that during the map thread operation, the peak memory usage might be high enough that iffis slow, you're not going to free up that resource until the computation is finished (or you get a chance to repack it). Also see Are there guidelines for avoiding the unpacking of a packed array? – rm -rf Dec 31 '13 at 18:27