Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Manipulate, Opacity, slow down

23 views
Skip to first unread message

janos

unread,
May 12, 2009, 5:43:47 AM5/12/09
to
I wonder if you can give me some hints without a code.
I have a program using Manipulate[ParametricPlot[f[a]]].
1. If I define outside the function f used in ParametricPlot, and then
insert the function name into ParametricPlot, then the program slows
down extremely compared to the version when the formula of the
function is inserted.
2. If I add Opacity to the Directives, again the timing increases
tremendously.

If you think you could help seeing the (long) code I'll be ready to
show it.

Thank you,

J=E1nos

Jens-Peer Kuska

unread,
May 13, 2009, 5:05:47 AM5/13/09
to
Hi,

adding transparency will slow down an any hardware accelerated
rendering system.

And with
f1[t_] := {Cos[t], Sin[t], t}


AbsoluteTiming[
ParametricPlot3D[f1[t], {t, 0, 2 Pi}, PlotPoints -> 4096]][[1]]

gives
0.1110000

but
AbsoluteTiming[
ParametricPlot3D[f1[t] // Evaluate, {t, 0, 2 Pi},
PlotPoints -> 4096]][[1]]

gives
0.075

and this is nearly the same as

AbsoluteTiming[
ParametricPlot3D[{Cos[t], Sin[t], t}, {t, 0, 2 Pi},
PlotPoints -> 4096]][[1]]

with
0.079

Regards
Jens

Sjoerd C. de Vries

unread,
May 13, 2009, 5:07:25 AM5/13/09
to
Janos,

I don't see much difference between

Manipulate[
ParametricPlot[{Sin[a u], Cos[ u/a]}, {u, 0, 4 Pi}], {a, 1, 5}]

and

f[a_] := ParametricPlot[{Sin[a u], Cos[ u/a]}, {u, 0, 4 Pi}]
Manipulate[f[a], {a, 1, 5}]

What is it precisely you did?

Cheers -- Sjoerd

Alexei Boulbitch

unread,
May 15, 2009, 4:16:33 AM5/15/09
to
Hi, Janos,

Without the code it is not quite clear, why the 2D parametric plot is
noticeably slowed down in your case. I met such situations only in 3D
cases. Probably your function is too heavy for whatever reason.
Anyway, if you need the result for a presentation (for what else?), you
may be quite sutisfied with timing of the discrete Manipulate version,
instead of the continuous one, like the following:

f[a_] := ParametricPlot[{Sin[a u], Cos[u/a]}, {u, 0, 4 Pi}]

Manipulate[f[a], {a, 1, 5, 0.5}]

If this is still too slow in your case, try the FlipView like below:

tab = Table[
ParametricPlot[{Sin[a u], Cos[u/a]}, {u, 0, 4 Pi}], {a, 1, 5, 0.5}];
FlipView[tab]

This must be fast.

Alexei


n May 12, 11:43 am, janos <janostothmeis... at gmail.com> wrote:
> I wonder if you can give me some hints without a code.
> I have a program using Manipulate[ParametricPlot[f[a]]].
> 1. If I define outside the function f used in ParametricPlot, and then
> insert the function name into ParametricPlot, then the program slows
> down extremely compared to the version when the formula of the
> function is inserted.
> 2. If I add Opacity to the Directives, again the timing increases
> tremendously.
>
> If you think you could help seeing the (long) code I'll be ready to
> show it.
>
> Thank you,
>
> J=E1nos


--
Alexei Boulbitch, Dr., habil.
Senior Scientist

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg

Phone: +352 2454 2566
Fax: +352 2454 3566

Website: www.iee.lu

This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.

0 new messages