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
- :
- Possible bug? - Vector square root vs raise to pow...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-03-2014
04:30 AM

09-03-2014
04:30 AM

Possible bug? - Vector square root vs raise to power of 0.5

For some reason, the square root symbol works but raising to a power of 0.5 doesn't:

Version: 15.0

Mathcad doc attached.

9 REPLIES 9

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

09-03-2014
04:31 AM

09-03-2014
04:31 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Remove the units from a and b.

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

09-03-2014
04:58 AM

09-03-2014
04:58 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Might be worth reading this:

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

09-03-2014
05:22 AM

09-03-2014
05:22 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Mathcad doesn't treat row vectors as true vectors, so best to use column vectors:

Alan

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

09-03-2014
05:27 AM

09-03-2014
05:27 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Thanks, my actual vectors are quite long and look better in the worksheet as row vectors.

The square root works so I'll continue but it does seem that there is a bug in there.

Update, just played a bit more and it appears to be the decimal causing the problem. 0.5 fails but 1/2 works.

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

09-03-2014
05:32 AM

09-03-2014
05:32 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Good information, but I am not sure if it relates to the problem here.

After all without vectorization all is working as expected.

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

09-03-2014
05:33 AM

09-03-2014
05:33 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

You could just write them as row vectors, but put a transpose at the end:

e.g. a = (1 2 3)ctrl_1

Alan

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

09-03-2014
05:38 AM

09-03-2014
05:38 AM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Dan Rose wrote:

For some reason, the square root symbol works but raising to a power of 0.5 doesn't:

Thats a bit strange and I tend to call it a bug - at least I agree that it should work as you expected when we use column vectors.

The problem seems to be the combination of units and vectorization and the error is thrown with column and rowvectors alike.

Interestingly it works if you replace 0.5 by 1/2 and it also works with symbolic evaluation.

As Alan already noted it also works when we place the vecorization operator inside and use column vecctors.

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

09-03-2014
10:54 AM

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

09-03-2014
05:39 PM

09-03-2014
05:39 PM

Re: Possible bug? - Vector square root vs raise to power of 0.5

Mike Armstrong wrote:

Werner Exinger wrote:

Good information, but I am not sure if it relates to the problem here.

After all without vectorization all is working as expected.

Yes but he was using column vectors, not scalars.

Yes, correct. And so my conclusion is that the problem is not that of function returning different units not depending on the input units only as stated in the information you posted.