Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulate with specified step size

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91045] Re: Manipulate with specified step size
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Mon, 4 Aug 2008 03:25:35 -0400 (EDT)
  • References: <g6h5em$h1k$1@smc.vnet.net>

Hi,

on your t-slider is on the left side a little minus, you may call the 
slider with
Manipulate[
   ___,
{t, 0, 8, 1, Appearance -> "Open"}
]

and than you see the animation control.

And

DynamicModule[{convolved},
  convolved[z_] = conv[x, y, z] // PiecewiseExpand;
  Manipulate[
    Show[
      Plot[{Tooltip[x[s], "f(s)"], Tooltip[y[t - s], "g(t-s)"]}, {s,
      0,
          8}, PlotRange -> {{-.01, 8}, {-.4, 2}},
        PlotStyle -> {{GrayLevel[.85]}, {GrayLevel[.85]}},
        Exclusions -> None],
      Plot[Tooltip[x[s] y[t - s], "f(s)g(t-s)"], {s, t, 8.1},
        PlotRange -> {{0, 8.1}, {0, 16}}, PlotStyle -> Black,
        Exclusions -> None],
      Plot[Evaluate[x[s] y[t - s]], {s, -.01, t}, Filling -> Axis,
        PlotRange -> {{0, 8.1}, {0, 16}}, PlotStyle -> Black,
        Exclusions -> None],
    Plot[Evaluate[Tooltip[convolved[ z], "(f*g)(t)"]], {z, -.01, t},
        PlotRange -> {{-.01, 8}, {0, 16}}, PlotStyle -> Blue,
        Exclusions -> None],
      Graphics[{Dashed, Line[{{t, -6}, {t, convolved[t]}}]}],
      Graphics[
        Text[Style["t", Italic, Bold, Blue, 14], {t - .1, -6 + .2}]]
      ]
    , {t, 0, 8, 1, Appearance -> "Open"}]
  ]

should be faster.

Regards
  Jens

J Davis wrote:
> I wanted to revisit the issue in this thread:
> 
> http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/4e94adfcb4cd4491/303f37e538bcd6e1?lnk=gst&q=manipulate+play#303f37e538bcd6e1
> 
> I have the following:
> 
> conv[f_, g_, t_] = \!\(
> \*SubsuperscriptBox[\(\[Integral]\), \(0\), \(t\)]\(f[s]
>     g[t - s] \[DifferentialD]s\)\);
> 
> x[t_] = UnitStep[t - 2] - UnitStep[t - 3];
> y[t_] = UnitStep[t - 2] - UnitStep[t - 3];
> 
> 
> Manipulate[
>  Show[
>   Plot[{Tooltip[x[s], "f(s)"], Tooltip[y[t - s], "g(t-s)"]}, {s, 0,
>     8}, PlotRange -> {{-.01, 8}, {-.4, 2}},
>    PlotStyle -> {{GrayLevel[.85]}, {GrayLevel[.85]}},
>    Exclusions -> None],
>   Plot[Tooltip[x[s] y[t - s], "f(s)g(t-s)"], {s, t, 8.1},
>    PlotRange -> {{0, 8.1}, {0, 16}}, PlotStyle -> Black,
>    Exclusions -> None],
>   Plot[Evaluate[x[s] y[t - s]], {s, -.01, t}, Filling -> Axis,
>    PlotRange -> {{0, 8.1}, {0, 16}}, PlotStyle -> Black,
>    Exclusions -> None],
>   Plot[Evaluate[Tooltip[conv[x, y, z], "(f*g)(t)"]], {z, -.01, t},
>    PlotRange -> {{-.01, 8}, {0, 16}}, PlotStyle -> Blue,
>    Exclusions -> None],
>   Graphics[{Dashed, Line[{{t, -6}, {t, conv[x, y, t]}}]}],
>   Graphics[
>    Text[Style["t", Italic, Bold, Blue, 14], {t - .1, -6 + .2}]]
>   ]
>  , {t, 0, 8, 1}
> 
> When I move the slider the dynamics are slow to evaluate. I would be
> content to simply "play" the animation at the discrete values t=0 to
> t=8 in increments of 1. However, I have been unable to obtain that
> result.
> 
> Suggestions?
> 
> Thanks,
> John
> 
> PS I am also surprised that these computations are slow since these
> are rather simple functions involved in the convolution.
> 


  • Prev by Date: Re: help with "no more memory" at mathematica
  • Next by Date: Re: Manipulate with specified step size
  • Previous by thread: Re: Sending Objects from Java - Mathematica
  • Next by thread: Re: Manipulate with specified step size