The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Button operation that indicates start and finish of simulation
Replies: 1   Last Post: May 28, 2012 5:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Goyder Dr HGD

Posts: 59
Registered: 1/29/05
Button operation that indicates start and finish of simulation
Posted: May 27, 2012 4:41 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In a notebook with many dynamic modules I have a long simulation which I start with a button. I would like to give an indication that the simulation is starting and also when it is finished. Below, in a toy example, I attempt to use a simple message and also an EvaluationMonitor. Both only give results when the simulation is finished. What don't I understand and how do I fix this? Many thanks.

LongSimulation[] :=
TimeConstrained[NDSolve[{Derivative[2][x][t] + x[t] == 0,
x[0] == 1, Derivative[1][x][0] == 0}, x, {t, 0, 100000*Pi},
MaxSteps -> Infinity, Method -> {"Projection", "Invariants" ->
{x[t]^2 + Derivative[1][x][t]^2}},
EvaluationMonitor :> k++], 3]


DynamicModule[{message = " "},
Column[{Button["Start Simulation", message = "Starting Simulation";
LongSimulation[]; message = "Simulation Finished"],

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.