cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Way to Implement a TimeOut (limit calculation time) for a Solve Block?

alitch
1-Newbie

Way to Implement a TimeOut (limit calculation time) for a Solve Block?

In MathCad 15, is there a way to limit the calculation time, or implement a time out, for a solve block? 

I have a parameterized solve block in which there are some values of the inputs that cause the solve block to run continuously (or at least longer than I'm willing to wait).

I'd like to skip over those instances where it does this in the looping of the parametrized solve block and continue on to the next set of inputs in the loop.

Thank You

1 ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald II
(To:alitch)

ANDREW LITCH wrote:

In MathCad 15, is there a way to limit the calculation time, or implement a time out, for a solve block?

I have a parameterized solve block in which there are some values of the inputs that cause the solve block to run continuously (or at least longer than I'm willing to wait).

I'd like to skip over those instances where it does this in the looping of the parametrized solve block and continue on to the next set of inputs in the loop.

Typically, now that I want one to, I can't get a solve block to take more than a couple of seconds.  Nor can I find one on the Community.

However, I was wondering if were possible to pass the start time to a solve block, create an auxiliary function that simply looks at the time and raises an error if t > start time + n seconds, and then make that function part of the dependencies?

Stuart

View solution in original post

4 REPLIES 4
StuartBruff
23-Emerald II
(To:alitch)

ANDREW LITCH wrote:

In MathCad 15, is there a way to limit the calculation time, or implement a time out, for a solve block?

I have a parameterized solve block in which there are some values of the inputs that cause the solve block to run continuously (or at least longer than I'm willing to wait).

I'd like to skip over those instances where it does this in the looping of the parametrized solve block and continue on to the next set of inputs in the loop.

Typically, now that I want one to, I can't get a solve block to take more than a couple of seconds.  Nor can I find one on the Community.

However, I was wondering if were possible to pass the start time to a solve block, create an auxiliary function that simply looks at the time and raises an error if t > start time + n seconds, and then make that function part of the dependencies?

Stuart

Stuart,

You propose an approach by using the "time()" function?

StuartBruff
23-Emerald II
(To:VladimirN)

VladimirN. wrote:

Stuart,

You propose an approach by using the "time()" function?

Hi Vladimir,

Yes.

Ideally, of course, it should be a user-definable parameter of a solve block (with a default of eternity or until we get caught in the cross-fire a Kardashev Type II civilization bar fight).

Stuart

Stuart,

Your suggestion worked very nicely.  Thank You.

Announcements