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.

athurin1-VisitorAnswer
1-Visitor
May 11, 2015

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).

1-Visitor
May 12, 2015

Hi Adrien!!.. thank you a lot for your interest and time.

I saw your solution and it is totally right... but I didn't told you that this "problem" is a part of a bigger calculation sheet where all functions are dependant of the B range variable... so I would like to ask you if there's workaround for that problem using the range variable option...

Or I was thinking if theres a way to use a kind of if instruction to force that the first k(B) value should be equal to 1 when B=1, because this is the only value at which my formula k(B) gives a strange result.

Thanks a lot.

LAST UPDATE: I am trying to change everything to a vector style...