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
- :
- Error summing range with units

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

09-19-2021
01:37 AM

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

09-19-2021
01:37 AM

Error summing range with units

I have a range of lengths. I need to sum them after pushing them through a function. Unfortunately the sum operator is not happy and stating: "Ranges with units must specify the second value in the range". Thank you for your time and help.

Labels:

5 REPLIES 5

09-20-2021
02:22 AM

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

09-20-2021
02:22 AM

Hi,

The issue is earlier in the worksheet.

Please enclose the worksheet.

Cheers

Terry

09-20-2021
05:18 AM

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

09-20-2021
05:18 AM

Your post is missing a worksheet (attachment).

09-20-2021
05:26 AM

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

09-20-2021
05:26 AM

@EP_10048426 wrote:

I have a range of lengths. I need to sum them after pushing them through a function. Unfortunately the sum operator is not happy and stating: "Ranges with units must specify the second value in the range". Thank you for your time and help.]

What this normally means is that the user has defined a range with units, but only specified the first and last values, eg, i:=1 m..10 m.

Mathcad requires ranges with units to have the 'step' value, eg, i:=1 m, 2 m .. 10 m.

However, as noted in other messages, it is difficult (read 'normally impossible') to diagnose an error without the guilty worksheet. Error messages can be misleading or complete red herrings.

Cheers,

Stuart

09-20-2021
07:12 AM

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

09-20-2021
07:12 AM

First off: Yes the worksheet is needed! (You should ALWAYS attach the worksheet, or a minimised version, that shows your problem).

Assuming you have i defined as a range with units, this is Prime behaviour:

Success!

Luc

09-20-2021
10:32 PM

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

09-20-2021
10:32 PM

I don't think that the OP has defined a range variable above the expression shown in the pic. It looks to me that the problem is rather that the upper limit of his sum is not a simple scalar but a quantity with a unit, maybe a length. So basically he is trying to do something like

Unfortunately I wasn't able to get the desired result using the sum operator alone without having to define something else like a vector or a a global range variable on worksheet level 😞

OK, one way to avoid defining anything else is to get rid of the units in the summation and add them to the function argument, but I would not recommend doing so: