cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

## Two ranges in one equation 2-Guest

## 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!

1 ACCEPTED SOLUTION

Accepted Solutions 24-Ruby V
(To:JM_9356739)

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 2-Guest
(To:JM_9356739)

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: 24-Ruby V
(To:JM_9356739)

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. 12-Amethyst
(To:JM_9356739)

This can be done as a single step by using the vectorize  operator Ctrl+Shift+^ or from the Math>Operators menu. 24-Ruby V
(To:RantEng)

@RantEng wrote:

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

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 2-Guest
(To:Werner_E)

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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9373129,"math_prob":0.89689815,"size":2685,"snap":"2023-40-2023-50","text_gpt3_token_len":594,"char_repetition_ratio":0.11488251,"word_repetition_ratio":0.6568421,"special_character_ratio":0.21675977,"punctuation_ratio":0.09944751,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99536383,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"im_url_duplicate_count":[null,null,null,null,null,1,null,null,null,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,1,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-10-02T12:36:53Z\",\"WARC-Record-ID\":\"<urn:uuid:223d8269-b09f-4ad5-91eb-be2142c5af2c>\",\"Content-Length\":\"298304\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:12a01be3-2872-4e6c-b63d-4c3bfdaef6f2>\",\"WARC-Concurrent-To\":\"<urn:uuid:cdc3598a-1842-4ff1-83b3-1e16cff894a9>\",\"WARC-IP-Address\":\"18.160.10.14\",\"WARC-Target-URI\":\"https://community.ptc.com/t5/Mathcad/Two-ranges-in-one-equation/td-p/712822\",\"WARC-Payload-Digest\":\"sha1:RDYYCC4SMM6E3UR6YVJWKXXQTXHI5Q64\",\"WARC-Block-Digest\":\"sha1:VILDAPQAPYZOOKRJLTVOCXKQIECG27DL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510994.61_warc_CC-MAIN-20231002100910-20231002130910-00495.warc.gz\"}"}