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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Weird error messages in a formerly calculating Mathcad sheet

davidsnelling
1-Newbie

Weird error messages in a formerly calculating Mathcad sheet

I now get error messages (Mathcad 15 M10) in a complex Mathcad sheet with many symbolic numeric expressions that prieviously calculated with no problem.

One is: A numeric term involving the sin function now shows error "this value must be a function but has the form R unitless"

The second occurrs in symbolic evaluations which no longer calculate with the message "pattern match exception"

If I cut and paste the expression to a blank worksheet it evaluates without error

Has any one else seen these error statements? So far technical support has not been able to help other than to suggest updating Mathcad 15 to M20.

Dave Snelling

10 REPLIES 10

It would help if you could post the worksheet so we can see if we see those errors, too.

It looks to me as if you had added or changed something (maybe unintended) in your worksheet which is now responsible for the errors. This would explain why copying the expressions to a new sheet cures the problem.

Werner I am embarrassed to admit I can't figure out how to attach Mathcad files to my message.

Dave

Click "Use advanced editor" in the upper right corner of the editor window. At the end you then get the opportunity to attach files.

Another way is to first post normally and then edit that post. This brings up advanced editor. It was demanded by many user that advanced editor should be the default from the very beginning, but to no avail.

Here is the main file that shows the problems I described

Modulated LII theory use me PTC support..xmcdz

and two reference files

constant3_DRS.xmcdz\Useful_2001.xmcdz

I don't experience any of the errors you reported, but this could be because some functions are not defined (Cp.air and Cv.air) and so are all deduced functions and variables.

I attach what I see in a pdf-file.

Thanks Werner, That suggests the problems are perhaps confined to my 2 computers at home.

It is strange you got the Cp.air and Cv.air not defined because they are defined in constant3_DRS.xmcdz, which I see you included as a reference. I have seen that problem before with Mathcad 15 and I forget how I solved it.

I don't want to take up too much more of your time, but if you go to constant3_DRS.xmcdz you will see they are defined there.

PTC technical support have been no help so far - like you the do not see the problem. I reinstalled Microsoft Network4 and updated Mathcad 15 to M020 at their request, but that did not help. The PTC tecnician working on the problem has gone on vaccation and left me with a supervisors e-mail address that does not work.

Did you produce your clean PDF file with Mathcad 15?

Thanks again for your help. I will at least press PTC technical support to come up with an explanation of

this value must be a function but has the form R unitless

since that is surely a Mathcad generated error

Dave Snelling

Me again Werner Our exchnge prompted me to look at the reference file constants3_DRS.xmcdz with some care and I found a careless piece of coding. I had used the variable name sin in in that file to represent an index variable. When I changed that variable name to vin and eliminated all references to sin as anything other than the sine function my main sheet calculates with no problem.

Your version of Mathcad seems to have rejected that reference file somehow (hence your Cp.air etc not defined) whereas mine did not and that avalanche of weird errors in the main file ensued. Does that explanation seem reasonable to you?

I wish Mathcad had more usefull error statements.

Thanks for your help.

Dave

Yes, I used Mathcad 15 M020, the current release.

It seems that you sent a wrong file - you sent "constant3_DRS.xmcdz" (not constants3...) and I just had a look at it - it really doesn't contain definitions for cp.air() or cv.air. Furthermore I couldn't find any "sin" in that file. So the reference file wasn't rejected by my MC version.

"Useful_2001.xmcdz" is referenced twice in your sheet at different locations. Don't think these files should be different, so I referenced the same file twice just for consistency.

The error message you mentioned I only know in the form "This value must be a function but has the form: unitless", that is without any "R".

But as I understand you are up and running again - the error was the definition of "sin" as variable and later trying to use it as a function again, right? So the error message isn't that bad. And if you didn't disable warning in Preferences the definition of your variable "sin" should be green wavy underlined because of the redefinition of a built in function name.

Sorry Wener i have so many versions of tha file constanrt3 I send the wrong one by mistake. I must tidy them up.. I do need to be morecareful and not using sin as a variable name. I sent the correct constants3 file to PTC technical support.

I still don't understand why I got the "pattern match error" for symbolic evaluations although if it couldn't identify the meaning of sin trhat might have triggered.it.

Again thanks for your help.

Mathcad uses two different engines to evaluate expressions. Numeric evaluations are done using Mathcads native numeric engine but symbolic evaluations are handed over to a software which is just licensed (up to version 13 this was Maple, since MC14 its unfortunately muPad). This explains the difference in the error messages. The symbolic engines also distinguishes what the expression is - I guess different subroutines in muPad throw different errors. To take the integral symbolically the expression has to be parsed beforehand to sort out what function and whats the variable of integration. During this process sin(x) or 5(x) is seen as a wrong pattern, so the message makes sense. BuI of course I agree that error handling in general needed to be improved (especially with solve blocks), though I don't expect to see any improvements and developments there in Mathcad 15. And Prime - thats a sadly chapter by itself.

sinredefine.png

Just for fun the same in Prime 2 - and all has changed, but not necessarily to the best, I think. The symbolic evals in your sheet would have given you surprising wrong results without any hint that something went wrong. Obviously a constant as function "name" is accepted and treated simply as a constant, ignoring the argument. If thats on purpose it should also affect the numerics, if not, I would call it a bug.

sinredefine2.png

Top Tags