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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Why??? Sum vector and matrix in prime

ValeryOchkov
24-Ruby IV

Why??? Sum vector and matrix in prime

Why.PNG

I have do so:

Why1.PNG

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:ValeryOchkov)

Because the summation operator without indices is designed to work only with vectors and ranges, not with matrices.

It's been that way in Mathcad also:

It also doesn't accept pure numbers:

But I would fully agree with you that there is no compelling reason to limit the summation operator in this way. Especially because the mean function accepts all:

Luc

View solution in original post

23 REPLIES 23
LucMeekes
23-Emerald III
(To:ValeryOchkov)

Because the summation operator without indices is designed to work only with vectors and ranges, not with matrices.

It's been that way in Mathcad also:

It also doesn't accept pure numbers:

But I would fully agree with you that there is no compelling reason to limit the summation operator in this way. Especially because the mean function accepts all:

Luc

LucMeekes написал(а):

But I would fully agree with you that there is no compelling reason to limit the summation operator in this way. Especially because the mean function accepts all:

Luc

One more bad limitation (Net v jizni schact'ia!)

Matrix and vector in Solver!

ViktorKorobov
14-Alexandrite
(To:LucMeekes)

Luc_Meekes-disabled wrote in 2008:

SumMat.png

Viktor

Viktor Korobov wrote:

Luc_Meekes-disabled wrote in 2008:

SumMat.png

That's a neat method from Luc.

Here's a messier, but still fundamentally matrix, program way ...

Stuart

LucMeekes
23-Emerald III
(To:ViktorKorobov)

I must have had a bright moment there...

Luc

StuartBruff
23-Emerald III
(To:LucMeekes)

LucMeekes wrote:

I must have had a bright moment there...

Luc

Merely but one of many, Luc! Success!

LucMeekes wrote:

Because the summation operator without indices is designed to work only with vectors and ranges, not with matrices.

It's been that way in Mathcad also:

It also doesn't accept pure numbers:

But I would fully agree with you that there is no compelling reason to limit the summation operator in this way. Especially because the mean function accepts all:

Luc

I'm surprised at you, Valery. Seems to work for me.

Stuart

Sum.bmp

Valery, it looks to me that your trick won't work with scalars and nested matrices - right?

Werner

StuartBruff
23-Emerald III
(To:Werner_E)

Werner Exinger wrote:

Valery, it looks to me that your trick won't work with scalars and nested matrices - right?

Werner

Ah! Decisions, decisions ...

given

this ...

or this ...

or this ...

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

StuartBruff wrote:

Ah! Decisions, decisions ...

Yes. life is hard!

I took the easy way

Sorry!

The talk is not about Mathcad 15 - about Prime!

Valery Ochkov wrote:

Sorry!

The talk is not about Mathcad 15 - about Prime!

I was just answering to your post from

Guess we all know that what you would like to do only works in your Mathcad PM (or whatever you would call it now).

Luc already gave the correct answer to your question "Why???". Its because the sum operator simply isn't implemented that way and never was. Maybe it should be, but it isn't. You are free to open a support case with PTC and hope the best, but I wouldn't hold my breath waiting for a solution.

Hi

Werner Exinger wrote:

... Luc already gave the correct answer to your question "Why???". Its because the sum operator simply isn't implemented that way and never was. ...

I guess that probably isn't that simple. For me it's more related about that there are not range matrices, there are only range vectors. Also with two range variables can't index a matrix in the "natural" or "expected" way.

With range matrices it could be easy extend a lot of vector operators.

Best regards.

Alvaro.

fig1.gif

StuartBruff
23-Emerald III
(To:AlvaroDíaz)

AlvaroDíaz wrote:

Hi

Werner Exinger wrote:

... Luc already gave the correct answer to your question "Why???". Its because the sum operator simply isn't implemented that way and never was. ...

I guess that probably isn't that simple. For me it's more related about that there are not range matrices, there are only range vectors.

...

With range matrices it could be easy extend a lot of vector operators.

Could you please expand on what you mean by a "range matrix", Alvaro?

.... Also with two range variables can't index a matrix in the "natural" or "expected" way.

fig1.gif

This is yet another long-standing request (in one form or another).  I posted a workround last year and I've got a semi-smart pick function that also provides similar functionality.

Re: How to extract non-consecutive submatrix in a easier way

Stuart

Hi Stuart.

Something like n:=i,j

fig.gif

Even not pretty sure if that way is correct, what can I say is that a "matrix range" can be write expanding columns in this strange range variable input way:

fig1.gif

Best regards.

Alvaro.

StuartBruff
23-Emerald III
(To:AlvaroDíaz)

AlvaroDíaz wrote:

Hi Stuart.

Something like n:=i,j

fig.gif

Even not pretty sure if that way is correct, what can I say is that a "matrix range" can be write expanding columns in this strange range variable input way:

Best regards.

Alvaro.

Ah.  I think what you're suggesting is akin to my Very Long-Standing Request to formalize the sequence as a type, where a sequence is an expression of the form

     a,b,c,d,(e,f..g),h, etc,etc

This would allow such expressions as you want, plus allowing an easy extension of it to Multi Dimensional Array (MDA) indexing (A[i,j,k), and I wouldn't want it limited to just numbers - strings would also be allowed. For example, in the image below, s gives an example of how a numeric sequence might look, with parentheses bounding ranges; A shows how indexing might be achieved with a sequence (if each of the variables is itself a range variable, then I'd expect Mathcad to simply extend how it does 2D indexing);  and the program shows that Mathcad can already handle such sequences when they form the value list for a for expression (note in particular, the two strings, the explicit ranges and the range variables are all evaluated - it's a shame Mathcad doesn't expand string ranges).

Stuart

StuartBruff
23-Emerald III
(To:StuartBruff)

StuartBruff wrote:

Ah.  I think what you're suggesting is akin to my Very Long-Standing Request to formalize the sequence as a type, where a sequence is an expression of the form

    a,b,c,d,(e,f..g),h, etc,etc

This would allow such expressions as you want, plus allowing an easy extension of it to Multi Dimensional Array (MDA) indexing (A[i,j,k), and I wouldn't want it limited to just numbers - strings would also be allowed. For example, in the image below, s gives an example of how a numeric sequence might look, with parentheses bounding ranges; A shows how indexing might be achieved with a sequence (if each of the variables is itself a range variable, then I'd expect Mathcad to simply extend how it does 2D indexing);  and the program shows that Mathcad can already handle such sequences when they form the value list for a for expression (note in particular, the two strings, the explicit ranges and the range variables are all evaluated - it's a shame Mathcad doesn't expand string ranges).

Interestingly, "sequence" is how Mathcad defines such structures in XML.  Here's the XML for the sequence in the previous message:

<ml:program>

    <ml:localDefine>

        <ml:id xml:space="preserve">k</ml:id>

        <ml:range>

            <ml:real>0</ml:real>

            <ml:real>3</ml:real>

        </ml:range>

    </ml:localDefine>

    <ml:localDefine>

        <ml:id xml:space="preserve">j</ml:id>

        <ml:range>

            <ml:sequence>

                <ml:real>1</ml:real>

                <ml:real>4</ml:real>

            </ml:sequence>

            <ml:real>13</ml:real>

        </ml:range>

    </ml:localDefine>

    <ml:for>

        <ml:id xml:space="preserve">x</ml:id>

        <ml:sequence>

            <ml:real>1</ml:real>

            <ml:str xml:space="preserve">a</ml:str>

            <ml:real>5</ml:real>

            <ml:real>4</ml:real>

            <ml:parens>

                <ml:range>

                    <ml:real>9</ml:real>

                    <ml:real>13</ml:real>

                </ml:range>

            </ml:parens>

            <ml:parens>

                <ml:range>

                    <ml:sequence>

                        <ml:real>21</ml:real>

                        <ml:real>23</ml:real>

                    </ml:sequence>

                    <ml:real>29</ml:real>

                </ml:range>

            </ml:parens>

            <ml:real>36</ml:real>

            <ml:str xml:space="preserve">45</ml:str>

            <ml:id xml:space="preserve">k</ml:id>

            <ml:real>16</ml:real>

            <ml:id xml:space="preserve">j</ml:id>

        </ml:sequence>

        <ml:localDefine>

            <ml:apply>

                <ml:indexer/>

                <ml:id xml:space="preserve">s</ml:id>

                <ml:apply>

                    <ml:id xml:space="preserve">rows</ml:id>

                    <ml:id xml:space="preserve">s</ml:id>

                </ml:apply>

            </ml:apply>

            <ml:id xml:space="preserve">x</ml:id>

        </ml:localDefine>

    </ml:for>

    <ml:id xml:space="preserve">s</ml:id>

</ml:program>

As an aside, it would be useful if factor (or some of the other symbolic functions) returned their results as sequence (or, at least, a vector) ... again, a very-long-standing request to make the symbolic results more useful.

Stuart

Hi Stuart.

What can I say? I'm take a look too into the xml but don't found nothing interesting. You do.

Best regards.

Alvaro.

Hi Stuart.

StuartBruff wrote:

Ah.  I think what you're suggesting is akin to my Very Long-Standing Request to formalize the sequence as a type, where a sequence is an expression of the form

     a,b,c,d,(e,f..g),h, etc,etc

This would allow such expressions as you want, plus allowing an easy extension of it to Multi Dimensional Array (MDA) indexing (A[i,j,k), ...

Yep. But problem here is that I understand only in part your big develop of the MDA. And also understand in parts the issues that ranges introduces in Mathcad, and I'm only use them for plots, and not every times. For this reason, after found this strange notation for ranges, now I can define precisely what is a range matrix: anything with more than one column in this other range definition. Before of that, I know that an indexation of a MDA with A[i,j,k intruduce some kind of range matrix, but can't prove it, and I'm not pretty sure if this kind of range matrix could be only two range variables in the implementation of a Mathcad internal library for MDA's.

About what you say about strings, sorry, give me a couple of weeks or more to fully understand it.

Best regards.

Alvaro.

StuartBruff wrote:

... This is yet another long-standing request (in one form or another).  I posted a workround last year and I've got a semi-smart pick function that also provides similar functionality.

But here there are not a "Feature Request" anymore sub forum. Maybe you're interesting in see this, from a Feature request sub forum: Extracting matrix from a matrix .

Best regards.

Alvaro.

PD: Power users group subsists? Or it was substituted by a kind of Power customers? I don't imagine the owners (this is, the true Mathcad customers) of Techint, Shell, General Electric, those big enterprises with a lot of engineers, posting they ideas into this forum.

StuartBruff
23-Emerald III
(To:AlvaroDíaz)

AlvaroDíaz wrote:

StuartBruff wrote:

... This is yet another long-standing request (in one form or another).  I posted a workround last year and I've got a semi-smart pick function that also provides similar functionality.

But here there are not a "Feature Request" anymore sub forum. Maybe you're interesting in see this, from a Feature request sub forum: Extracting matrix from a matrix .

Ah yes.  Very responsive.  ... I'm not entirely convinced that dropping range variables was a good idea, though - a range variable takes up a few bytes of memory whilst the equivalent vector could potentially take up gigabytes (1..10E9).

PD: Power users group subsists? Or it was substituted by a kind of Power customers? I don't imagine the owners (this is, the true Mathcad customers) of Techint, Shell, General Electric, those big enterprises with a lot of engineers, posting they ideas into this forum.

"Power Users" was a private Mathsoft Collaboratory forum, created to get feedback from a variety of experienced / influential users.   It was intended as a sort of direct "face to face" discussion place with Mathsoft's staff, and was definitely *not* intended as a alternative to the main Mathcad Colloboratory forum.

I don't know whether PTC has an equivalent forum.  It would be ... disappointing ... if the expert Mathcad users from the big enterprises only posted in some "Premier League" Community, and deprived the rest of the user base of their talents and ideas.

Stuart

StuartBruff wrote:

... I don't know whether PTC has an equivalent forum. ...

Stuart

Hi Stuart.

Maybe I don't explain well (Well, that's more than much probably). What I was observed is a change in the words from PTC. Before, we all are "users", but now, there are a lot of "customers" in the PTC mathcad blogs, posts, etc. Users maybe don't own a copy of Mathcad, but, are users ... they are who use Mathcad. When an enterprise buy a software, they establish some encouraged people, but usually those people are not necessary the final users, are technical guys, that's right, but in most cases from the IT department, and have not much idea about for what the true users are doing with the software. And that's ok, they don't need to know that. I know that PTC have their own marketing strategies, and don't need at all to discuses them with me. I'm just making the appointment about my impression of this marketing policy. And, regarding this, think about who can be called for the equivalent of the old Power Users forum. If the strategy point to customers, not the users, then, ¿who are those customers? If an university or big enterprise it's a Mathcad customer, then about who are talking in PTC blogs when they refer to them. ¿To the actionist of the university or the enterprise?

Hope that explain better what I'm saying.

Best regards.

Alvaro.@

PD: Two examples, there are more:

From this link, Notice how the inverviewed change the words


Q: I understand this feature comes as a response to user feedback. Is that right?

McGough: Yes. In fact, all our release planning is based on customer input – we listen to what customers want and try to prioritize release content accordingly.

This article: Don’t Compromise When You Buy Engineering Calculation Software . Can't remember who recently tell us how, even he was an independent engineer, must to rewrite a very easy Mathcad calculation into a nonsense excel file. This is: we need to work with the software that companies have. Which is the concept of the article? The writer know the peple that buy software at universities or enterprises? Because those guys only want excel and some few others things.

PD2: I use PD because know that it means Post data. Don't know what means PS.

Announcements

Top Tags