Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email.
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Feb 14, 2021
07:56 AM

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

Feb 14, 2021
07:56 AM

Two ranges in one equation

Hi,

I am having an issue where I can't get a range of values when I use two ranges in one equation:

for hlc I am expecting a range similar to Le and v, what am I doing wrong?

Thanks!

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Feb 14, 2021
10:43 AM

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

Feb 14, 2021
10:43 AM

The auxiliary variable T should not be necessary.

Simply vectorize the whole expression on the right hand side of hlc:=... in your original sheet.

What you have are not called ranged but vectors.

Actually the square of a vector (v^2) is not defined from a mathematical point of view. Its NOT v*v (which would be a scalar).

Instead of throwing an error Mathcad applies implicit vectorization, squaring each element of the vector and collects the result in a new vector.

Now your formula demands Prime to multiply two vectors, Le and the newly created v^2. Prime does as demanded and gives you back the vector product, which of course is just a single scalar.

You had in mind to multiply each element of the one vector by the corresponding one of the other and this is exactly what vectorization is made for.

5 REPLIES 5

Feb 14, 2021
08:22 AM

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

Feb 14, 2021
08:22 AM

I found a way of doing it (typically right after I posted here), it's not the neatest solution but I used vectorization to multiply the two and put that into a single variable, then used that variable in my equation instead:

Feb 14, 2021
10:43 AM

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

Feb 14, 2021
10:43 AM

The auxiliary variable T should not be necessary.

Simply vectorize the whole expression on the right hand side of hlc:=... in your original sheet.

What you have are not called ranged but vectors.

Actually the square of a vector (v^2) is not defined from a mathematical point of view. Its NOT v*v (which would be a scalar).

Instead of throwing an error Mathcad applies implicit vectorization, squaring each element of the vector and collects the result in a new vector.

Now your formula demands Prime to multiply two vectors, Le and the newly created v^2. Prime does as demanded and gives you back the vector product, which of course is just a single scalar.

You had in mind to multiply each element of the one vector by the corresponding one of the other and this is exactly what vectorization is made for.

Feb 15, 2021
03:04 PM

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

Feb 15, 2021
03:04 PM

This can be done as a single step by using the vectorize operator Ctrl+Shift+^ or from the Math>Operators menu.

Feb 15, 2021
03:33 PM

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

Feb 15, 2021
03:33 PM

@RantEng wrote:

Isn't this exactly what I suggested in my answer above when I wrote

*"Simply vectorize the whole expression on the right hand side of hlc:=..."*

As @JM_9356739 didn't bother to attach the worksheet, I couldn't bring myself to type in the data to show it

Feb 16, 2021
04:44 AM

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

Feb 16, 2021
04:44 AM

Thank you both for your input.

I'll include my worksheet in further enquiries, I didn't think it necessary for such a simple problem, my apologies.