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

Problem with matrix

Highlighted
Newbie

Problem with matrix

Hi,

I'm new with mathcad and i'm working with a simple camshaft kinematic and dinamic analysis and i'm having problems evaluating some matrix in the dinamic part.

Attatched is the file, it's in spanish and the problems appear after the "análsis dinámico" part. The problems that appear are "undefined variables" in the matrix where i define the variables i want to solve, units incongruence in some matrix, etc.

Hope you can help me.

Thanks,

Jorge

7 REPLIES 7

Re: Problem with matrix

It seems you ran into two matrix limitations of Mathcad:

1) all Elements of a matrix must have the same unit

2) functions are not allowed as matrix elements

Both are on the wishlist of us costumers for quite some time (along with multi dimensional arrays) but obviously not on the todo-list of PTC.

Re: Problem with matrix

Functions are allowed as matrix elements. Even function names are allowed as matrix elements, although then there are some restrictions (it is not just that different units are not alowed in arrays, but in fact different types are not allowed, so mixing function names with other elements may not be possible).

Prime allows mixed units in arrays. So this is one of our wishes that has, finally, been fulfilled.

Re: Problem with matrix

You have several problems.

As already noted, mixed units are not allowed in arrays. a2*sin(theta2), for example, evaluates to a length. The number 1, obviously, doesn't. If that is supposed to be 1m, make it 1m.

More importantly, the variables in the vector on the rhs, R02x, R02y, etc are undefined.

Even if you fix those problems you cannot define functions F2x, F2y, etc like that.You need a single name on the lhs, with the argument, for example (Results(theta2)). A vector of functions on the lhs wil not work (I assume this is what WE meant). You an create separate functions after that, for example F2x(theta2):=Results(theta2)[0

Re: Problem with matrix

The attached shows how to get what you want (or what I think you want, which might not be the same thing!).

Alan

Re: Problem with matrix

Richard Jackson schrieb:

Functions are allowed as matrix elements.

Yes, my fault. Thank for pointing out. What I was thinking of was that you cannot define a vector (or matrix) of functions intuitively (and/or through a program) like

21.11.1.png

but have to do it "manually"

21.11.2.png

and of course concerning the worksheet under discussion that, while you can define variables with

21.11.3.png

you cannot do it likewise with functions

21.11.4.png

You could do it using the symbolical evaluation, but nevertheless you would have to redifine the functions

21.11.5.png

But it seems that Alan has presented a solution to the poster's problem anyway.

Even function names are allowed as matrix elements,

??

Prime allows mixed units in arrays. So this is one of our wishes that has, finally, been fulfilled.

Glad to hear that. Haven't done much with Prime yet because so much is not implemented yet, it reacts awfully slow and I have great difficulties to see e.g. a marked area on my lcd and even worse on the notebook screen. So we wait 'til Prime gets grown up.

Re: Problem with matrix

What I was thinking of was that you cannot define a vector (or matrix) of functions intuitively (and/or through a program)

I did wonder if that's what you meant (see my reply to Jorge). I agree. This is an annoying restriction.

Even function names are allowed as matrix elements,

??

Using your example, the arguments to the functions are not necessary:

function+names+in+arrays.jpg

Re: Problem with matrix

Richard Jackson schrieb:

Using your example, the arguments to the functions are not necessary:

function+names+in+arrays.jpg

Thanks! Was not aware of that - learned something new