Skip to main content
12-Amethyst
April 18, 2022
Question

live, in-process output from a program in Mathcad 11

  • April 18, 2022
  • 3 replies
  • 1885 views

I'm setting up a program that will loop through a large # of trials (random process), and recording the result of each trial. Is there a mechanism that will allow monitoring of the output as the program progresses - say each time a loop is complete - rather than waiting for the program to complete its full complement of trails? This way I can see how the resulting statistics accumulate. I'm too impatient to wait for the whole thing to finish before getting an idea of what the results look like.

 

Lou

3 replies

25-Diamond I
April 19, 2022

One way I could think of is to use WRITE... statements in the program to write status messages to a file.

One other way could be to use the "trace" command and turn on debugging (I am not absolutely sure if trace and debug are available in MC11)

Both methods will slow down the calculations, especially the debug mode, I guess.

23-Emerald IV
April 19, 2022

Hi Lou,

 

I've done this often using one WRITEPRN (to start the file and write out the headers for the columns, followed by an APPENDPRN for every iteration/loop/repetition. Since WRITE/APPENDPRN create/append a text file, you can watch progress by opening it from time to time with notepad. Afterwards you can read in the result as a single Matrix using READPRN and process the results.

Another option could be to use MathConnex. That should even allow you to make a feedback system.

 

Success!
Luc

 

 

LouP12-AmethystAuthor
12-Amethyst
April 20, 2022

Thanks to both for the responses. Write functions will give an in-progress output, although it still leaves the issue of how to view that resulting output with an automatic update, rather than requiring continued manual viewing - e.g., a graph that automatically updates every second.

Is there anything that can be programmed to show intermediate results outside a program while the program is still running? (Update a graph or image).

 

FYI - there is no urgency, as I already have the specific results I was looking for. Turned out not to take that long a time. knowing a general mechanism would be useful.

 

Lou

25-Diamond I
April 20, 2022

Is there anything that can be programmed to show intermediate results outside a program while the program is still running? (Update a graph or image).

"trace" and "debug" will show the progress without manual interaction but its not a graph or picture. It just shows the text and variables you decide to output in the debug window.

Otherwise I could only think of a solution outside of Mathcad. Using WRITEPRN and APPENDPRN in your MC program and write a program (not in Mathcad) which checks the file written every second, analyses its content and outputs a graph or picture as desired. Quite some effort and slows down Mathcads calculation.

23-Emerald V
April 20, 2022

@LouP wrote:

I'm setting up a program that will loop through a large # of trials (random process), and recording the result of each trial. Is there a mechanism that will allow monitoring of the output as the program progresses - say each time a loop is complete - rather than waiting for the program to complete its full complement of trails? This way I can see how the resulting statistics accumulate. I'm too impatient to wait for the whole thing to finish before getting an idea of what the results look like.

 


If you can convert your program into a function that runs one or more trials, then you might be able to use a Component (eg, Text Box or Picture) to provide an update.   

 

I vaguely recall creating a "sort of live" updating display using a 3D Plot component, with a Mathcad program controlling the execution, and using the timer function to control the rate.   Sadly,  I no longer have a working copy of Mathcad 11 (or, if I do, no idea where the installation medium is) to check which of my M11..15 files contain it, and the few messages I've found in the Community refer to no-longer-extant worksheets on the old Mathcad Collaboratory forums.

 

Stuart