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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Explicit Help

ptc-5456846
1-Newbie

Explicit Help

Hello,

I'm having a problem with MathCAD (version 14). As shown in my attached file, I've used the explicit command to show variables in equation 1 which shows everything just fine. However, when I introduce a fourth variable (r in this case) and try to make the second equation and show the values before evaluating the it, it shows q as a funny value with weird units (0.1524*ft/0.3048) added to a normal-looking r value. I evaluated this number and it does come out to 0.5 ft but I was wondering if there was a way to just get the 0.5 ft (or rather the 6 in) to show up instead of this funny-looking value. Additionally, it shows the q + r as red and with the message "This variable is undefined" and it does not actually solve for the correct value or 10 in.

Thanks in advance for any responses that I get.

6 REPLIES 6

Somehow your sheets seems to got corrupted. When I open it with the current version of Mathcad 15 (M030) I get a very unusual error:

09.01a.png

When I click OK r and q are variables known to the numeric processor but not to the symbolics.

I retyped your expressions in a fresh worksheet and all worked as expected:

09.01.png

Note that I avoided the inline evaluation after the explicit eval. The reason is the way Mathcad stores numbers and units and the way the symbolic processor sees it.

The symbolic processor is not aware of units and treats them as unknown variables. So it cannot convert in to ft, e.g.

if you define a:=2in b:=3in c:=a+b (explicit or not does not matter here) c is stored internally with unit in and if you evaluate c symbolically you will get c-->5in.

But if you define c:=a+b...=, the numeric eval(=) will convert the unit to the standard length unit (ft in your sheet, m in mine) and if you symbolically evaluate c you will see the result in ft (or m) as thats the only "unit" ze symbol processor will see. It does not help to manually set the unit to a different one after the numeric eval.

Werner Exinger wrote:

... I retyped your expressions in a fresh worksheet and all worked as expected ...

I just copied all the contents of the worksheet into a new document and save it in Mathcad 15 M030 version. Then it work fine.

Try to open your sheet, then chose Tools/WorksheetOptions/UnitSystem/U.S.

When I do this, I get the same error shown above.

It seems to be the inline evaluation in combination with the U.S. unit system. Obviously an old Mathcad bug which wasn't noticed untlil now.

It is one "why" I do not use the explicit operator on my Mathcad server.

I do so and no problem:

abc.png

Thank you everyone for all the posts, they have been of great help to me (especially Werner Exinger's post). I just have two more questions.

1.) I understand the reasoning (with Werner Exinger's help) why I have my problem. I just want to ask if there is any work-around to actually show the result on the same line i.e. q := x + y +z explicit, ALL --> in + 2 in + 3 in = 0.5 ft without the result that I talked about earlier. Obviously definining the result on the next line, i.e. q = 0.5 ft is not the end of the world, but I figured I would ask.

2.) I do believe this has been answered before but I figured I would ask again. If I was to use my worksheet correctly (incorporating the changes that Werner Exinger suggested), is there a way to just show the value of q as 0.5 ft or 6 in when I show it explicitly in the t equation. For example, it would read t := q + r explicit, ALL --> 6 in + 4 in (instead of in + 2 in + 3 in + 4 in).

Sorry for the verbose post, I do appreciate everyone helping me out in this matter.

With more or less trickery you may achieve what you demand. Find attached some ways to use explicit. q1 and t1 are rather tricky as each line consists of two regions. Thats the only way I could found which makes it possible to see the way q was derived later in the definition of t. But as your posting implies thats something you don't want anyway. So the other two lines seem to be what you are searching for.

I used some formatting facilities of MC15 to make them look like they do (all accessible via right click menu): show assignment as equal sign (w/o colon), hide keywords, show symbolic eval as equal (instead of the arrow) and for q1 and t1 also hide left hand side.

You seem to have found a Mathcad bug which is still not fixed in the most current version (MC15 M030). I have included a disabled region which, when enabled, throws that error. It has to do with numeric evaluation in line with an assignment and only shows when the sheet has unit system set to U.S.

09.01.png

Top Tags