Skip to main content
Best answer by Werner_E

The reason for the error is that your vector sigma'v;top is a nested vector. Each element of this vector is a 8x1 vector on its own, so you actually have 64 values stored in that vector.

For every value of the range variable k you get a full vector at the abscissa and not just a single scalar as it is needed.

Werner_E_0-1727184591211.png

Because I don't know what the correct values for this vector should be and because your sheet is full of red errors right from the start, its impossible for me to help with a problem an page 11, sorry.

 

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
September 24, 2024

The reason for the error is that your vector sigma'v;top is a nested vector. Each element of this vector is a 8x1 vector on its own, so you actually have 64 values stored in that vector.

For every value of the range variable k you get a full vector at the abscissa and not just a single scalar as it is needed.

Werner_E_0-1727184591211.png

Because I don't know what the correct values for this vector should be and because your sheet is full of red errors right from the start, its impossible for me to help with a problem an page 11, sorry.

 

14-Alexandrite
September 24, 2024

Actually I think I did it wrong. Because it should be one vector. but accumlated . For example if sigma is = ( 0,1,2,3)    .... 0+1=1 then 1+2=3, then 2+3=5....... and the result of the last should be the sum of all previous results = (1,2,5,..). And that will produce one vector not 8 vectors with 64 values. 

23-Emerald V
September 24, 2024

@YA_10963798 wrote:

Actually I think I did it wrong. Because it should be one vector. but accumlated . For example if sigma is = ( 0,1,2,3)    .... 0+1=1 then 1+2=3, then 2+3=5....... and the result of the last should be the sum of all previous results = (1,2,5,..). And that will produce one vector not 8 vectors with 64 values. 


.

A cumulative sum is such a common need that I'm surprised that Mathcad doesn't have a built-in cumulative sum function.  I note you've found your probem and therefore one of the many possible solutions, but it can be useful to have a cumsum function in your Mathcad toolbox

 

2024 09 24 A.png

 

Stuart