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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Plot bug in Mathcad 15?

Werner_E
24-Ruby V

Plot bug in Mathcad 15?

I can hardly believe that I did not ran into this bug in the past. Or maybe I am blind and doing something wrong?

Why is the horizontal base line if the second triangle not drawn in the combined plot?

Werner_E_0-1667264746399.png

IMHO it should work (and I hesitate to say so, but it actually works OK in Prime).

Has anybody already experienced that bug?

Has anybody an explanation (other than "buggy programmed" 🙂

Has anybody an idea for a workaround?

I thought that using complex numbers may be a way to get what I want, but, alas, to no avail!

Werner_E_1-1667264805346.png

BTW, the problem goes away if the tringles don't share the common point (1;1).

More precise: The problem seems to be that the last point of the first triangle is the very same as the first point of the second one.

Sure in this simple example the order of the points could be changed to circumvent the problem,

Werner_E_2-1667265234865.png

but in an automatically created list of a larger number of different shapes this seems not to be an inviting option.

Any ideas are welcome.

Mathcad 15 file attached

 

7 REPLIES 7
prop_design
15-Moonstone
(To:Werner_E)

hi werner,

 

i'm just curious, does the NaN have anything to do with it. Moreover, if those weren't part of the matrices, do they plot?

The NaN's separate the various shapes and so usually are necessary as otherwise Mathcad would connect the last point of the one shape with the first point of the next one and this is of course undesirable.

In case of the example showing the bug the NaN's would not be necessary as the end point of the one is the starting point of the next none. It would do no harm if Mathcad would try to connect this point with itself. So deleting the NaN's does indeed make the plot work. I simply would hate in the automatic assembly of multiple shapes to have to ask if the previous shape (if its not the first one) hast the same end point as the starting point of the current shape and delete the NaN's which already are part of the large matrix already created.

At the time being my workaround is to change the order of the points when necessary. This was easier to implement but still requires an "if" before adding a shape to the list and i really would like to be able to simply stack the shapes on on top of the other without any additional hassles.

But it seems to be a bug in Mathcad 15 (probably also in MC14 and maybe even in lower versions) and it will never be fixed as MC15 is not supported anymore. Therefore there seems to be no way around applying some sort of annoying workaround.

Please specify which service release of Mathcad 15 you are using?


@VladimirN wrote:

Please specify which service release of Mathcad 15 you are using?


@VladimirN 

I am using the latest maintenance release M050.

Why are you asking? Did you test my file in a prior release without seeing the undesired effect?

LouP
10-Marble
(To:Werner_E)

Doesn't seem to be a problem in MCD11.

 

Lou

FDS
12-Amethyst
12-Amethyst
(To:LouP)

Dear Werner, Do not ask me why but if you remove the NaN's it works...

 

FDS_0-1667368458943.png

 

Werner_E
24-Ruby V
(To:FDS)


@FDS wrote:

Dear Werner, Do not ask me why but if you remove the NaN's it works...


Thanks for trying, but I know. I already explained in my reply to @prop_design         
https://community.ptc.com/t5/Mathcad/Plot-bug-in-Mathcad-15/m-p/834481/highlight/true#M203548

why the NaN's are needed and that in case of the example posted removing them, the plot works OK.

Reason is that without the NaN's the last point of one shape is connected with the starting point of the next one by a line which of course is disturbing. In case of the example its the very same point and so no disturbing line is created.

 

Actually I have two workarounds when creating a matrix consisting of various closed shapes which I want to plot in one go.

But both require me to ask before adding a new shape if its starting point equals the endpoint of the last shape. If so, I either have to change the order of the points of the new shape  OR I have to omit/delete the separating NaN's for these two shapes. For the second approach it would of course be better to add the NaN's in front of a new shape and not at the end.

I don't like both workarounds and was hoping for a simpler way to get around.. 😉

 

EDIT: Actually I just found a third workaround which would not require to ask before adding a new shape. We can insert a single point in-between two shapes. We could always add 1 to one or both coordinates of the first point of the new shape.
Drawback is that the matrix grows significantly in size and that this point would also show up in the plot.

Werner_E_0-1667391269043.png

Showing the point can be avoided if we chose coordinates outside the visible area. Of course this would mean that we have to set the axis limits manually.

We could chose "infinity" as coordinates:

Werner_E_1-1667391408191.png

Drawback still is the increase of the matrix size and that we cannot determine the necessary limits simply by calculating min and max of the two matrix columns. But the latter is already failing with negative coordinates because NaN is treated as zero.
I am not sure but I could imagine other troubles with that many coordinates being infinity, too.

I also tried using infinities instead of the NaN's,but then no lines of the second shape are plotted, only the points. And when I added a third shape that way, Mathcad crashed. Crazy!

Top Tags