Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is a toy example:

currentTimeStep = 0;
Dynamic[currentTimeStep]
pfun = ParametricNDSolveValue[
          {y'[t] == a y[t], y[0] == 1}, y, {t, 0, 10000}, {a},
          StepMonitor :> (currentTimeStep = t;), MaxSteps -> 100000
       ];
pfun[1]

As you can see from the value of currentTimeStep, the variable is most of the time left without a numerical value. Is there a way to look at the current status of computation when using ParameticNDSolveValue?

share|improve this question
3  
I filed this as a bug. Thanks. – user21 May 8 '13 at 8:08
up vote 2 down vote accepted

@ruebenko confirmed that this is a bug.


Here's a workaround:

currentTimeStep = 0;

monitor[t_?NumericQ] := (currentTimeStep = t; 1)

pfun = ParametricNDSolveValue[{y'[t] == a monitor[t] y[t], y[0] == 1},
    y, {t, 0, 10000}, {a}, MaxSteps -> 100000];

Dynamic[currentTimeStep]

pfun[1]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.