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

Divide by zero only in a range variable

GerritBarrere
1-Newbie

Divide by zero only in a range variable

I'm attaching a Prime 1.0 worksheet that demonstrates a problem I'm having. I'm defining a function with a program which tests for a zero input. This works fine when you invoke the function with a constant or a simple variable of zero, but not when the argument is a range variable including a zero value. Am I doing something wrong, or is there a workaround to this?

Thanks,

Gerrit

11 REPLIES 11

Have a look at the attached if you can open it. There does seem to be a problem when units are involved.

Mike

Just incase you can't open the above file I save included an image for you to follow. Sorry, my Mathcad Prime 1.0 is off at the moment.

Clipboard01.jpg

Mike

If I vectorize my call to H(f) like you've done it works fine too, even with units. Thank you, Mike! Are you with PTC? Can I consider that this little insect has been reported?

If I vectorize my call to H(f) like you've done it works fine too, even with units. Thank you, Mike!

No problem at all. It works for me with units, but when I see a problem I always strip the units away and start from scratch.

Are you with PTC?

No I'm not with PTC

Can I consider that this little insect has been reported?

It's actually not a bug. The way to created your range requires the Vectorize function.

Mike

Against my old argument, see below. Mathcad 15 which doesn't need the vectorize function.

Clipboard01.jpg

Mike

I didn't recall that it did either. In fact, I've done similar things in Prime without having to vectorize. My general philosophy has always been "if it doesn't work, try vectorizing", which I didn't follow this time, alas.

I do think Prime is not quite up to snuff yet. I've seen a number of unexplainable errors, which disappear if you delete part of the equation and then re-enter the identical thing, for example. It's so nice in other ways I'm sticking with it, but it's been really difficult this morning.

Gerrit

I would stick with it Gerrit. Future releases will be a massive improvement.

Mike

Mike's Mathcad 15 example works the same in Mathcad Prime as well.

I was looking at the problem with Gerrit's worksheet, and it appears that the issue is that f is defined as 0 in the program, but f is a vector. So you can't test for 0 this way.

Mona

Hi Mona,

I don't see where f is defined as zero in the program (that is, in the definition of H()). There is a test for the argument being passed being zero. The definition of H as it is should accept a vector f_sub_i and return a vector of the same size, shouldn't it? And if an element of the vector is zero, the test on the first line should catch it. Or am I misunderstanding?

Gerrit

MikeArmstrong
5-Regular Member
(To:mzeftel)

Mike's Mathcad 15 example works the same in Mathcad Prime as well.

Mona,

Mathcad 15 works without using the vectorize function and just using the subscript i. Mathcad Prime will not allow this. Are you getting this problem?

Mike

I agree! I'm looking forward to it.

Thanks again for your help,

Gerrit

Top Tags