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

## Mathcad v14 trig functions calculate incorrectly  Newbie

## Mathcad v14 trig functions calculate incorrectly

Does anybody know if this error has been corrected in subsequent versions? Mathcad v14 does not calculate sin(180 deg) or cos(90 deg) as 0. There is a value out to ~16 decimal places, which would not normally be an issue, but I have a 0/0 division calculation that returns an error because of this. Using radians rather than degrees does not change the value calculated. I have created a kludge workaround, but I shouldn't have to. Is there a program fix for this? And does PTC know?

Tags (3)
4 REPLIES 4  Ruby IV
(in response to ptc-1428060)

## Re: Mathcad v14 trig functions calculate incorrectly

I wouldn't call this an error. Mathcad is a numeric number cruncher and the results are within its numeric accuracy.

If you need something better you might consider using the symbolic evaluation. The screenshot below was made in the current release of Mathcad 15 and I guess it would be similar in Prime, too. I am just too lazy to fire up that uncomfortable slow horse.   Peridot
(in response to Werner_E)

## Re: Mathcad v14 trig functions calculate incorrectly

And just for comparison with another mainstream maths application, here are the Matlab 2014a results for the same calculation:

Trial>> sin(pi)

ans =

1.224646799147353e-16

Trial>> cos(pi/2)

ans =

6.123233995736766e-17

Trial>> sin(3*pi)

ans =

3.673940397442059e-16

Trial>> cos(101*pi/2)

ans =

4.408109496293883e-15

Trial>>

Very similar and for the same reason - standard fixed-width floating point roundoff.

Stuart  Peridot
(in response to StuartBruff)

## Re: Mathcad v14 trig functions calculate incorrectly

And, for forms sake, here's Excel's take on it ...

 1.22515e-16 6.12574e-17 3.67545e-16 4.41064e-15

So, unfortunately, you'll find this behaviour is common to many, industry-standard numeric applications.

Stuart  Opal
(in response to ptc-1428060)

## Re: Mathcad v14 trig functions calculate incorrectly

Roundoff error is the nature of numeric processing. This has come up before, more than once. See here:

http://communities.ptc.com/message/70317#70317

http://communities.ptc.com/message/258037#258037

Maybe the worksheet I posted in the second thread would be a solution for you.

Announcements
Check out the latest