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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Indicate errors in file

mathcadswiss
3-Visitor

Indicate errors in file

Hi everybody,

 

I have very large scripts (150 pages) in Mathcad 15 and it is sometimes very hard to find the error in the script. Moreover, some calculated values do not influence the rest of the calculations and I might not even notice that there is an error somewhere. Is there a value that I could read out which indicates that an error has occured somewhere in the script? Preferably, I would like to have an indication at the end of the script which shows that no calculation ended in an error. Is that possible?

 

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:mathcadswiss)

See if this helps you:

LM_20190116_ErrorCheck.png

 

Essentially what it does is make sure that in the end, the variable ERRORS depends on all variables that you select. And if you only have errors that you can trap by reasoning (such as the examples with p1 through m2) it will tell you how many errors there are:

LM_20190116_ErrorCheck_.png

Note that you can place all Error checking to the right of the right margin, so that you don't need to print them.

 

Success!
Luc

View solution in original post

4 REPLIES 4
LucMeekes
23-Emerald III
(To:mathcadswiss)

That is not supported. You will have to check all pages for red items.

Another way is to have every result checked by a function (which you have to define!) that results in a value that you could check at the end.

Note that writing that function is not trivial. I can imagine what it might look like, but see enough problems that might occur, such as the problem where the check function itself returns an error....

 

Success!
Luc

LucMeekes
23-Emerald III
(To:mathcadswiss)

See if this helps you:

LM_20190116_ErrorCheck.png

 

Essentially what it does is make sure that in the end, the variable ERRORS depends on all variables that you select. And if you only have errors that you can trap by reasoning (such as the examples with p1 through m2) it will tell you how many errors there are:

LM_20190116_ErrorCheck_.png

Note that you can place all Error checking to the right of the right margin, so that you don't need to print them.

 

Success!
Luc

Thank you, well, it doesn't really help since the file is really large and I am not willing to make an error request for every single variable. So, I guess, it is not possible but might be a good idea for a future release. Most of the competition has something for this.

 

Cheers,

mathcadswiss

@mathcadswiss wrote:

I have very large scripts (150 pages) in Mathcad 15 and it is sometimes very hard to find the error in the script.

 

So, I guess, it is not possible but might be a good idea for a future release. Most of the competition has something for this.

 

Cheers,

mathcadswiss


You have a Mathcad script that runs 150 pages?  WOW!!

 

I chose Mathcad as a computation engine over MatLab (and FORTRAN, BASIC, and EXCEL) for several primary reasons:

  1. When I'm done the sheet looks like a page of mathematical expressions.  I used to describe it as a self-calculating hand-written page.
  2. I didn't have to learn and remember programming rules and grammar.
  3. Mathcad handles and tracks units and unit conversions.

Years ago I saw an attempt to pull an old FORTRAN program into Mathcad by coding.  Rather than start from basic principles and write the math as function definitions, this "translation" was attempting to convert the old computer code to Mathcad script line by line.

 

My I (respectfully) suggest that MatLab (or one of its free clones) might better suit you?  You are correct, most of those programming softwares have excellent debugging packages.

Top Tags