Group Abstract Group Abstract

Message Boards Message Boards

0
|
135 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Slide show preparation and presentation tips

I think these are easy questions for an experienced presenter.

  1. What are best hookup choices when using a single-screen Windows laptop to control a presentation on a classroom screen projection system that accepts both HDMI and WiFi remote display?
  2. What’s best practice for controlling a slide show on the Window laptop single display? Can the palette be concealed from the projected display. Do combination laser pointers and remote PowerPoint page turners work with Mathematica slide presentations?
  3. How is dynamic content best managed so that it animates smoothly when it is that slide’s turn and does not lock up the computer at any time during the presentation. This is the most important and most complicated of these questions. It involves options within dynamic content, options in the notebook and initializing function definitions. It may even involve things that should be done during a presentation.
  4. Related to no. 3, what is the difference in the meaning of the thick black line on dynamic content cells? Sometimes it’s not there when animation is animating and sometimes it is there when the animation is idle and the notebook is not running.
  5. In the Classic Slide Show palette, all resolution options are ¾ aspect ratio. Is there a best choice? What’s the best way to make maximum use of available display area? How is ImageSize->Full handled in dynamic content? Is there some ugly skewing or cropping that can results when a projector has a different aspect ratio from the presenter computer running Mathematica?
  6. Are there predictable pitfalls to avoid?
POSTED BY: Jay Gourley
2 Replies

º4. The cell bracket is highlighted when the Front End is waiting for the Kernel to finish a dynamic update. For instance:

Manipulate[
 If[TrueQ[y > 0],
  y = Sin[y];
  y = 1.];
 a,
 {a, 0, 1}
 ]

Because y is changed at each update, the updates continue indefinitely. It appears in the Front End that Manipulate[] is doing nothing, since the new value of y does not affect the output.

How to fix it? That's depends on the code. Adding the option TrackedSymbols :> {a} will fix this case. So does localizing y in a Module[] inside Manipulate[]. So does removing the If[] statement. In cases where this actually arises, localizing y defeats the purpose of remembering the value of y from update to update (should that be the purpose); and removing the code is usually not possible, either.


A more complicated example:

Updates indefinitely because data is changed:

Manipulate[
 SeedRandom[a];
 data = RandomReal[10, 100]; (* Mathematica treats Random*[] specially *)
 data = Sort@data^2; (* this causes the repeated updates *)
 lm = LinearModelFit[data, x, x];
 Show[
  ListPlot[data],
  Plot[lm[x], {x, 1, 100}],
  PlotRange -> {-21, 121}
  ],
 {a, 0, 1000, 1}
 ]

Minimal fix:

Manipulate[
 SeedRandom[a];
 data = Sort@RandomReal[10, 100]^2; (* data not trigger new update *)
 lm = LinearModelFit[data, x, x];  (* depends on data which does not need an update *)
 Show[
  ListPlot[data],
  Plot[lm[x], {x, 1, 100}],
  PlotRange -> {-21, 121}
  ],
 {a, 0, 1000, 1}
 ]

My better method (localized assuming I don't need to evaluate data or lm outside of Manipulate[]):

Manipulate[
 SeedRandom[a];
 With[{data = Sort@RandomReal[10, 100]^2},
  With[{lm = LinearModelFit[data, {x, x^2}, x]},
   Show[
    ListPlot[data],
    Plot[lm[x], {x, 1, 100}, PlotStyle -> Gray],
    PlotRange -> {-5, 105}
    ]
   ]],
 {a, 0, 1000, 1}
 ]

My preferred method (the extra dynamic means that data and lm won't be recomputed when the system changes $ControlActiveSetting from True to False when I let go of the a slider; only the plot needs updating when that happens):

Manipulate[
 SeedRandom[a];
 With[{data = Sort@RandomReal[10, 100]^2},
  With[{lm = LinearModelFit[data, {x, x^2}, x]},
   Dynamic@
    Show[
     ListPlot[data],
     Plot[lm[x], {x, 1, 100}, PlotStyle -> Gray],
     PlotRange -> {-5, 105}
     ]
   ]],
 {a, 0, 1000, 1}
 ]

If I need to use Dynamic[]/Manipulate[] to set a global variable such as data or lm, then I would use TrackedSymbols to expressly set the dynamic updating dependencies.

POSTED BY: Michael Rogers
Posted 8 hours ago

Thanks, Michael Rogers. As an unsophisticated user, I appreciate the examples and simplicity of your explanation. You even wrapped y > 0 in TrueQ[].

From your explanation, I expected continuous updating on the first example that iterates through Sin[] but did not see that. The cell bracket was not emphasized, and Windows Task Manager didn't show Mathematica doing much work.

I like your preferred method. I don’t have much need to set a global variable inside a Manipulate. If I needed a result outside the Manipulate, I would define the function there and invoke it inside the Manipulate.

I haven’t used With[] much, but from its documentation, it looks like Module[] accomplishes the same thing. I'm more familiar with Module[]. In fact, I didn’t immediately notice anything With[] does that Module[] doesn’t do. You helped me understand the difference between With[] and Assuming[] in an earlier thread.

If you would, I’d appreciate you expanding on the role of Dynamic[] in the last example. That might explain something that’s still not clear to me. Namely, how does activating the animation internal to Manipulate[] affect the things you said about avoiding unneeded updating.

POSTED BY: Jay Gourley
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard