Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Can anyone tell me the correct syntax for using trigonometric functions? When I try it, I get an error result that says "missing term or expression". All help appreciated
1. What version of the program are you using?
2. Please show your example.
Hi,
Like this:
As you do not show what you are actually trying we have to stab in the dark 😞
The error message you mention is thrown when you don't provide a function argument (by default you would see a question mark instead of the three dots)
But as this is very obvious I guess that's not the problem which you experience.
So for sure you would need to show examples of what you are doing and it also may help if you state which kind of Mathcad you are using (real, legacy Mathcad 15 or below or Prime) and which version.
Can you post the failing worksheet or at least a screenshot!?
Have you tried what I show in the second line (pi/6) with the same error?
Have you tried too use the unit "deg" instead of "°" as seen in Terrys answer. You may explicitly type a multiplication after the number as Terry did, but it should not be necessary, just type "deg" after the number. That way you won't see a dot between the two
Are the letters "sin" upright or italic? When you click somewhere in "sin" and then look at menu Math-Style-Label, do you see "Function" as in the screenshot below or something else? If something else, does it help when you manually change the label to "Function"? Changing it to "Automatic" should work as well.
Actually I don't think that wrong labelling is the cause as the error message would be something else ("variable undefined") if that would be the case, but without seeing what you actually typed and without being able to play around with your worksheet we still are just stabbing in the dark 😞
You sure have typed the normal equal sign and not the fat boolean one which you get with Ctrl-+ !? Guess that could not be the cause, either, as if you use the boolean equal you won't get any error message - Prime would just wait for you to type in the RHS of the equation and tell it what you want to be done with the equation.
When you are using the inverse sinus (arcsin, in Prime called asin) and want to see the result in degree rather than the default radian, you unfortunately can't simply type "°" as we can do in real Mathcad. In Prime we get the exact error message you experience. You either have to type "deg" in the unit placeholder or uncomfortably chose the unit degree from the units menu.
But then you sure did not want the result of the sine function to be displayed in degree as the result isn't an angle anyway.
So again just a lot of shots in the dark...
Do you experience any problems with the attached worksheet?
It sure will look OK when you just open it as all you see is the last view I had over here. You should let the sheet recalculate (F9 or F5) to see what your installation of Prime thinks of it.
I am using Prime 6 but I don't think that such a severe bug could have found its way in P8 an remained undetected until now.
Here is what you should see, also after recalculation:
And one last try: You didn't do this (putting the angle outside of the parentheses), didn't you?
Hi,
There are three equals signs in Prime each one is different
:= assignment equals
= output equals
= equivalence
It really would have helped if you had attached your worksheet as well!
@DU_8998062 wrote:
Well okay then. I only know of the one equal sign, :=. How do you incorporate the other types of equal signs? What keys?
Actually there are two more "equal signs" additionally to the three mentioned by Terry - the symbolic evaluation and the global definition.
But you seem to know already at least of two different equal signs as we see that you had used them in your picture (and they sure are the most important two equal signs you should know of).
Obviously you used the "normal" equal sign (numeric evaluation) when you got the correct result for sin (30 deg).
And you used the assignment/definition equal (which you get by simply typing a colon ":") when you assigned the value 45 deg to phi and theta.
In all expressions which failed I see an assignment := instead of an evaluation =.
Did you type this? if so, than thats the culprit.
You have to type just a normal equal sign to numerically evaluate an expression.
Example:
The first region is an assignment/definiton (note the colon ":") - the variable phi is assigned the value pi/6; the variable is defined. And the last two regions are numeric evaluations (note that there is NO colon here!)
See also
https://support.ptc.com/help/mathcad/r8.0/en/index.html#page/PTC_Mathcad_Help/evaluation_operator.html
or
or
BTW, as you already had success with sin(30 deg). It should work as well if you type an explicit multiplication and it should also work using the degree sign. It really looks to me that you always used the assignment definition := instead of the evaluation =
You also have not answered my question if you experienced any problems with the file I had attached when you let prime recalculate it!
:= assignment equals - [Shift]Colon: buttons
= output equals - Equal button
= equivalence - [Ctrl]Equal buttons
Actually buttons/keyboard shortcuts depend on which language keyboard you are using.
E.g. on my german keyboard I get the boolean equal with "Ctrl +" and not with "Ctrl =".
The localized help should be of help, but unfortunately isn't.
The German help for P6 claims that there is no keyboard shortcut for the boolean equivalence and the German P8 help claims that the shortcut is Ctrl =, which is true for English language keyboards but not for German ones.
There are quite some other discrepancies, too - localization was done very sloppily (and I am not surprised about that).
Mine works fine. Please see file which I have not attached.
@ppal wrote:
Mine works fine. Please see file which I have not attached.
Your file contained a small clerical error. I have corrected it in the file not attached here.