Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: Issues in plotting 2D plots

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-15-2017
08:48 PM

05-15-2017
08:48 PM

Issues in plotting 2D plots

I´ve plot a stem trace graph. and dont know why 2 points with the same values (in the y axis) dont be at the same height.

Here a screen shot.

Hope u guys can help me.

See u later.

Labels:

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
09:41 AM

05-16-2017
09:41 AM

Re: Issues in plotting 2D plots

Please attach your Mathcad Prime worksheet.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
11:08 AM

05-16-2017
11:08 AM

Re: Issues in plotting 2D plots

Here the link to the file

Dropbox - TESTE PROGRAMA MEF 3.mcdx

The Y axis represent the variable "RM" tha is at the pag 12 and the plot is at pag 14.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
01:00 PM

05-16-2017
01:00 PM

Re: Issues in plotting 2D plots

Excel file "**DADOS EXEMPLO2**" is missing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
01:17 PM

05-16-2017
01:17 PM

Re: Issues in plotting 2D plots

VladimirN. wrote:

Excel file "

DADOS EXEMPLO2" is missing.

I guess we don't really need it.

You could easily duplicate the "problem" - see my post below.

Its sure a numerical inaccuracy.

BTW, the time delay of some hours due to moderation is quite often really annoying.

Johnny sent his file at about way before I replied and had simply to guess what the problem might be, but I just see it now - more than two hours after he posted it.

OK, in this case the file wouldn't have helped as I would not had downloaded it from a dropbox link anyway and additionally chances are that its newer than the Prime version I have

installed here.

@Johnny

You can attach files directly here. At the upper left chose "Use Advanced Editor" and then at the lower right you see "Attach".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
02:03 PM

05-16-2017
02:03 PM

Re: Issues in plotting 2D plots

Sorry about that. here the excel file.

https://www.dropbox.com/s/rkkwz5f5n7bmabe/DADOS%20EXEMPLO2.xlsx?dl=0

Mathcad have to read just the cells A1 : G18.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
11:42 AM

05-16-2017
11:42 AM

Re: Issues in plotting 2D plots

Look at the scale on the ordinate!

It seems that internally the two values differ for a very small amount - maybe due to numerical round-off errors.

Set the upper and lower limits on the vertical axis manually and the two stems sure would look like they are of same height.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
02:10 PM

05-16-2017
02:10 PM

Re: Issues in plotting 2D plots

I did it and it worked!!!

But is there any function tha will do that? I use this file in many different cases and i wouldn't think that define the limits manually are much efficient... Is this a "bug" of the software or something like it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

05-16-2017
03:13 PM

05-16-2017
03:13 PM

Re: Issues in plotting 2D plots

> But is there any function tha will do that?

A function that will do what? Making values, which are apparently equal perfectly equal? "Round" comes to my mind.

Note the difference in syntax between "round" and "Round".

>I use this file in many different cases and i wouldn't think that define the limits manually are much efficient

Guess normally you won't just plot two values which are close to equal. As soon as you have other values involved Primes autoscaling will automatically do the work.

But be aware that Primes autoscaling usually produces very ugly intervals, so most of the times its necessary to manually change first, second and end value to get a nicer plot. Nicer does not mean nice as the plotting capabilities of Prime unfortunately still are beneath contempt.

> Is this a "bug" of the software or something like it?

No, its not a bug. Its normal behavior when dealing with numerical calculations. Never test if two reals are equal (a=b), always test if the absolute value of their difference is close enough to zero (|a-b|<10^-10).

Our decimal numbers are converted to binaries - then calculations are done and then the result is again converted in our decimal system for display. A lot of possibilities for inaccuracies and round-off errors which naturally occur. The simple number 0,1 is in binary representation periodic. So we have to cut off the number and never are able to store a simple number like 0,1 with perfect precision.

Most software uses IEEE format for storing numbers and using the double precision of this format means you can not expect more than 15 to 16 accurate digits. With every calculation you lose more and more precision.

See the screenshot above - the first time the difference Y(1)-Y(0) should be exactly 2*10^-10 but Mathcad already shows a round-off error.

Here is another example

And here the same calculation in Excel