Skip to main content
1-Visitor
May 6, 2015
Solved

About matrix definition

  • May 6, 2015
  • 3 replies
  • 2946 views

Hi, i suppose my problem has a easy solution, but I cant find it.

I define a simple operation k(B), I got the results but by some circunstance I got a solution that I need to change, so I want to create a new matrix with the modified results and call it back to use it on an equation but I wrong results... (image attached)..

As you can see in the image, when I select the new matrix, I can not change the Math Properties (Tab).

Hope you can help me.

Best answer by athurin

I think I cracked the problem. 1st problem comes form the fact that B is NOT a vector, but a range variable. Because B and the manually defined jB are different in nature (range variable VS matrix), the functions applied to them are applied differently.

The second problem is much easier. If I uunderstand what you are trying to do, all you need to do is to define I1, I2... as functions of z, and it all works.

Sheet attached with solution to both problems (at the end).

3 replies

1-Visitor
May 7, 2015

When you define j(B), you actually define a function that returns a constant vector/matrix. Not sure that's what you intended...

Next, your program does operation on the whole B vector, which, in my opinion, is bad karma. It depends on what your Df variable is, but I would personally work with the elements of B, not B itself.

That being said, when I try to do something similar; I don't get the same result. OK, I am too lazy to copy every single value, but overall, it works for me. What I would suggest is :

1/ try using the vectorization tool in your dc function

2/ upload your sheet (providing it is not Mathcad Prime 3.1)

12-Amethyst
May 7, 2015

j(B) isn't really a function of B; try re-defining it as jB:=

As jB is no t=longer a function of B the same argument should apply to the definition of D.c.

since prime doesn't use the array B in the function, I think that it is repeating the Dc function call for each row in B and generating the same result (using the static values in j(B) each time).

1-Visitor
May 7, 2015

Thanks Adrien Thurin and A Westerman‌ for your time!

I tried to solved using your suggestions but I couldn't; I attached the file, hope you can help me.

By the way, I attached in the same file a problem similar to the previous, hope can check it and help me to solve it.

Greetings.

1-Visitor
May 11, 2015

The second problem is easy : you are trying to multiply matrix with incompatible sizes. if M is a matrix, M*M is a matrix product, and you can't multiply vectors this way. You need to replace your product by a scalar product, or an element-by-element product, depending on the result you are expecting.

But, either way, if I am not mistaken, the problem isn't set properly. In my understanding, you want to express Iz as a function of z. Which means : calculate I1, I2... and Iz for each value of z. If that's the case, using vectors is probably not the simplest way to do so. Am I right ?

Your first problem is weird, I don't understant yet what is happening, but I am working on it ...