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

Bug in Prime?

ValeryOchkov
24-Ruby IV

Bug in Prime?

At n=1000 all is OK. At n=5000 - Prime has an error!

What is it?

CM-15.png

CM-Prime.png

1 ACCEPTED SOLUTION

Accepted Solutions

Valery Ochkov wrote:

Thanks, Werner!

But without Fred's function we have a bug in Prime! In Mathcad 16 all is OK at n=10^5

Yes, its a bug. I could reproduce it.

Not sure what the reason for it could be.

First thought was that it might be a confusion between local X and global X, but using X <-- X in the program first did not change anything.

View solution in original post

11 REPLIES 11

Work around:

LucMeekes
23-Emerald III
(To:Fred_Kohlhepp)

Yep, I find the same Fred, but in Mathcad 11!

I suppose that Mathcad 15 is the exception here and

Once more, they've managed to bring some functionality of Mathcad 11 into Prime. That .... is.... an.... improvement....?

Here's the fun stuf (I stripped the program somewhat):

Notice that you loose array elements. With every run I get between 90 and 99 elements for each of the two elements of Z.

And notice how all the other, non-NaN elements are 0. (I can't check what Prime does here, I'm limited to Express = no programming).

But when I make Z a function of X and Y, I consistently get two arrays of 100 elements back, and the in-between numbers are (mostly) non-zero:

Luc

LucMeekes
23-Emerald III
(To:LucMeekes)

When n=10, I (also) loose about 1 to 10 elements, so am sometimes left with zero elements in the two parts of Z, but sometimes:

I get them all.

So do I loose 0 to 10 elements consistently...

What if n=1000:

OK, it's possible to loose more than 10 elements, but it's rare. The worst I've seen in about 50 runs is 15 elements lost.

Luc

LucMeekes
23-Emerald III
(To:LucMeekes)

Oh, and:

50k points is no problem, neither is 500k:

In Mathcad 15 - all OK. Problems in Prime by a big n.

Fred Kohlhepp написал(а):

Work around:

n - ?

Valery Ochkov wrote:

Fred Kohlhepp написал(а):

Work around:

n - ?

Higher values of n are no problem with Freds function!

Unfortunately Primes Plot is limited to 500001 points.

Thanks, Werner!

But without Fred's function we have a bug in Prime! In Mathcad 16 all is OK at n=10^5

CM.png

Valery Ochkov wrote:

Thanks, Werner!

But without Fred's function we have a bug in Prime! In Mathcad 16 all is OK at n=10^5

Yes, its a bug. I could reproduce it.

Not sure what the reason for it could be.

First thought was that it might be a confusion between local X and global X, but using X <-- X in the program first did not change anything.

Is it a center of mass (gravity)?

The converted sheet from Mathcad 15 to Prime 3.1 gives an error. See two sheets in attach.

23-8-Ship.png

One verify:

23-9-Ship.png

Top Tags