Skip to main content
1-Visitor
January 19, 2011
Solved

Meaningful Error Messages

  • January 19, 2011
  • 2 replies
  • 21332 views

Hello,

allow me to explore if Mathcad V15 will bring me some relief in cosntrast to V14 M020.

I'm struggling with a 4p long code (programm). It had started to claim that units were different that they should be. After killing the (correct) expression and replacing it by "1", the complete code turned red....

So I'm searching for an imprveenet of the situation, which might be caused by sheer size of the program or list of variables and functions handed over?

Attached the version I started from and got deeper into trouble...

thanks

Best answer by RichardJ
Does Mathcad ignore the units because the numerical value is zero?

That's exactly why it does it. When Mathcad sees 0*anything, it doesn't bother to check what "anything" is, and just returns 0. I was told, many years ago, that this was because 0*anything is always 0, and so not calculating "anything" (which could be a complicated expression), saves time. I wouldn't argue about the time savings, but 0*anything is not always 0. The example above is only one nasty side effect. Consider this function (name chosen quite deliberately!)

BS(x):=x/x

evaluate that for x=0, and you get the answer 0, which is wrong (it is of course undefined).

2 replies

19-Tanzanite
January 19, 2011

The size of the program shouldn't make any difference. It's hard to say anything based on a pdf with most of the worksheet erased.

You have a large number of return variables at the end. Does it work if you remove all but one of them?

Efried1-VisitorAuthor
1-Visitor
January 19, 2011

Hi,

many thanks for your endevour.

Sorry neither solutions worked

- complying to the error mesages turned the whole code into red finally

- deleting output variables

- reducing output vestor by one row

uploading the file alone will not help since there are other mathcad files embedded.

Interestingly the calling code says variable not existing meaning the function, so the programm itself is rotten...

best regrads

19-Tanzanite
January 19, 2011
- complying to the error mesages turned the whole code into red finally

Sorry, but I don't know what you mean.

- deleting output variables

- reducing output vestor by one row

Did you try deleting all of them except for one? i.e. replace the vector with only, for example, W.Sp.

Interestingly the calling code says variable not existing

You mean "Variable Undefined"? You said in your first post that the error was about units.

1-Visitor
January 19, 2011

No worksheet = No help

Mike

Efried1-VisitorAuthor
1-Visitor
January 20, 2011

Thanks for offering help- the programm is that complex that I would have to pay you for wading through it 😉

1-Visitor
January 20, 2011

Thanks for offering help- the programm is that complex that I would have to pay you for wading through it 😉

Shame.


The thing is, if a worksheet would have been posted in the first place a solution might have been found.


Mike