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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Degree and ° in Mathcad

SS_9781956
8-Gravel

Degree and ° in Mathcad

I am unable to get the results when used ° instead of deg could someone let me know what I am doing wrong? 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:SS_9781956)

1) On contrary to real Mathcad (up to version 15) we cannot use the degree character from the keyboard when displaying a result. That's very annoying and uncomfortable but that is the way PTC has implemented it. You have to use the appropriate entry from the unit drop down menu:

 

Werner_E_1-1721218656022.png

 

2) The symbolic engine does not know anything about units and it treats them as unknown variables. But by default these units/variables do NOT keep their label as being a unit (so their numeric evaluation fails) unless you turn on the appropriate option (which is what you should do):

Werner_E_2-1721218844832.png

 

3) Even if you turn on the option as explained in 2), the symbolics still treats a unit as an unknown variable. This is especially true concerning the unit "deg". To be able to work symbolically with angle variables defined in degree, you have to (re)define the unit "deg" somewhere at the top in front of its first usage (don't forget to label "deg" as being a unit when you do so).

Werner_E_3-1721219065669.png

BTW, its not necessary to redefine ° as unit, its internally automatically replaced for "deg" when you type it (unfortunately this does not happen when used in the unit placeholder as explained in 1)). So the symbolics also understands variables defied using the typed ° symbol once you redefined the unit "deg"

Werner_E_0-1721219884769.png

BUT ... the symbolics does not understand the ° chosen from the unit selector!

Werner_E_1-1721220020822.png

You would have to redefine that unit as well (Don't type ° when you do so, but instead use the unit selector)

Werner_E_2-1721220228023.png

EDIT: Actually it looks to me that when we simply type the degree symbol °, it is automatically turned into a function in postfix notation with a placeholder in front of it. This may be the  reason why it does not work when used in the unit place holder - silly implementation indeed.

 

4) if you turned on the option as shown in 2) and you type "c" or "h", they automatically are treated as being the predefined constants of the same name. The symbolic engine will refuse to solve for these 'variables' - it generally refuses to solve for variables which already have been assigned a value (you may use "clear.sym(<variable name>) to overcome this).
So its necessary to manually relabel all "c" and "h" in your expression and also in the "solve,..." command to type "Variable".

Now the symbolics correctly solves for these variables

Werner_E_5-1721219559191.png

 

Prime 10 worksheet attached

 

 

View solution in original post

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

You added  a degree sign °, but without labelling it as a unit. That appears to work in the argument to a trig function.

However, for some reason, if you enter the ° from the keyboard (e.g. ALT-248), you cannot change its label.

If you want to use the degree symbol, take it from the units selector.

 

Note the difference in appearance between a ° entered manually:

LucMeekes_0-1721217921439.png

and one from the units selector:

LucMeekes_1-1721217957650.png

 

Success!
Luc

Werner_E
25-Diamond I
(To:SS_9781956)

1) On contrary to real Mathcad (up to version 15) we cannot use the degree character from the keyboard when displaying a result. That's very annoying and uncomfortable but that is the way PTC has implemented it. You have to use the appropriate entry from the unit drop down menu:

 

Werner_E_1-1721218656022.png

 

2) The symbolic engine does not know anything about units and it treats them as unknown variables. But by default these units/variables do NOT keep their label as being a unit (so their numeric evaluation fails) unless you turn on the appropriate option (which is what you should do):

Werner_E_2-1721218844832.png

 

3) Even if you turn on the option as explained in 2), the symbolics still treats a unit as an unknown variable. This is especially true concerning the unit "deg". To be able to work symbolically with angle variables defined in degree, you have to (re)define the unit "deg" somewhere at the top in front of its first usage (don't forget to label "deg" as being a unit when you do so).

Werner_E_3-1721219065669.png

BTW, its not necessary to redefine ° as unit, its internally automatically replaced for "deg" when you type it (unfortunately this does not happen when used in the unit placeholder as explained in 1)). So the symbolics also understands variables defied using the typed ° symbol once you redefined the unit "deg"

Werner_E_0-1721219884769.png

BUT ... the symbolics does not understand the ° chosen from the unit selector!

Werner_E_1-1721220020822.png

You would have to redefine that unit as well (Don't type ° when you do so, but instead use the unit selector)

Werner_E_2-1721220228023.png

EDIT: Actually it looks to me that when we simply type the degree symbol °, it is automatically turned into a function in postfix notation with a placeholder in front of it. This may be the  reason why it does not work when used in the unit place holder - silly implementation indeed.

 

4) if you turned on the option as shown in 2) and you type "c" or "h", they automatically are treated as being the predefined constants of the same name. The symbolic engine will refuse to solve for these 'variables' - it generally refuses to solve for variables which already have been assigned a value (you may use "clear.sym(<variable name>) to overcome this).
So its necessary to manually relabel all "c" and "h" in your expression and also in the "solve,..." command to type "Variable".

Now the symbolics correctly solves for these variables

Werner_E_5-1721219559191.png

 

Prime 10 worksheet attached

 

 

Werner_E
25-Diamond I
(To:Werner_E)

One additional remark @SS_9781956 

 

It looks like you tend not to come back and comment to your thread once you got some replies. This is generally not seen as particularly polite.

You might consider closing your threads or, if there still is a question, ask again.

This variable is undefined for derivative - PTC Community

Vector requirement - PTC Community

Solve block not giving answer - PTC Community

Symbolic evaluation behaving weird - PTC Community

@Werner_E , @LucMeekes 

Thank you for detailed explanation 
I did mark the answers for all the remaining threads. I did know I miss out on accepting the answers but I rectified it. 

Announcements

Top Tags