MathGroup Archive 2009

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

Search the Archive

Dynamic changing of variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96314] Dynamic changing of variables
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Wed, 11 Feb 2009 05:22:24 -0500 (EST)

Hi,

assume the following code lines:

DynamicModule[{a, b = 0}, 
  a = Dynamic[Sin[b]]; 
  Column[{
    Dynamic[a], 
    Slider[Dynamic[b], {0, 2*Pi}]
   }]
]

In order to update "a" with the actual value of Sin[b] I need 
Dynamic around it. Unfortunately, now the variable "a" is invisibly
wrapped and completely useless for further calculations. I'm not able to
calculate even a+1 inside the DynamicModule.

DynamicModule[{a, b = 0}, 
  a = Dynamic[Sin[b]]; 
  Column[{
    Dynamic[a+1], 
    Slider[Dynamic[b], {0, 2*Pi}]
   }]
]

If I'm not just too stupid and this behaviour is intended, then I'm
wondering whether this doesn't lead to problems when you have more
complex constructs with several dynamic variables.

Cheers
Patrick

PS: I was just pointed by another person on this and I found a way
around it. So cannot provide a real problem I'm having. Nevertheless, I
would be glad to know what you think since I couldn't really find the
point in the documentation where this is explained.



  • Prev by Date: Re: Log[x]//TraditionalForm
  • Next by Date: Re: Printing (v7)
  • Previous by thread: Re: Custom label for a slider in Manipulate
  • Next by thread: Re: Dynamic changing of variables