MathGroup Archive 2008

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

Search the Archive

Manipulate with specified step size

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90872] Manipulate with specified step size
  • From: J Davis <texasAUtiger at gmail.com>
  • Date: Sun, 27 Jul 2008 02:31:41 -0400 (EDT)

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: Re: Export into Excel Worksheets
  • Next by Date: Re: Re: Function Programming Problems
  • Previous by thread: Re: ParametricPlot precision problem
  • Next by thread: bug? f'[x]'