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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Solve matrix

Casper123
3-Newcomer

Solve matrix

Hi,
I'm somewhat new to mathcad and trying to solve an equation with a solve block. (see attached)

Tried several things, but without succes, I don't know if ti actually can work? perhaps with a for-while loop?

The equation is quite straight forward with some forces and lengths, resulting in a summed moment, for which I would like to find a 0. 

 

Can anybody help to achieve this or help me in the right direction?

 

Kind regards, Casper

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Werner_E)

In case you want the values in the matrices you defined with the sum-symbol in their name to really be summed up, you have to tell Prime that it should do so. In this case Mh returns a single value and so a single variable x would be all that is needed:

Werner_E_0-1657039954007.png

 

EDIT: A third interpretation of what you are trying to achieve comes to my mind. Maybe you want the definition for Mh to be vectorized?
This would yield

Werner_E_0-1657041231143.png

 

 

View solution in original post

3 REPLIES 3
Werner_E
25-Diamond I
(To:Casper123)

Your function Mh returns a vector of 16 elements.

Werner_E_1-1657038879786.png

 

If you want this vector to be all zeros, this would mean you have 16 single equations.
Because you only provide one single variable x for Prime to vary, Prime is not able to find a solution:

Werner_E_0-1657038788622.png

No surprise, as you normally would need at least 16 unknows to get a solution.

 

If you define your guess as a vector of 16 elements, Prime is able to find a solution.
Not sure if this is what you are looking for:

Werner_E_2-1657039277652.png

 

 

Werner_E
25-Diamond I
(To:Werner_E)

In case you want the values in the matrices you defined with the sum-symbol in their name to really be summed up, you have to tell Prime that it should do so. In this case Mh returns a single value and so a single variable x would be all that is needed:

Werner_E_0-1657039954007.png

 

EDIT: A third interpretation of what you are trying to achieve comes to my mind. Maybe you want the definition for Mh to be vectorized?
This would yield

Werner_E_0-1657041231143.png

 

 

Hi Werner, 

Thanks, that was indeed what I was trying to solve, to find 16 answers in an array. 
The vector operator on the formula did the trip for the solve block. 

Without the vector operator it already gave a vectorized solution when I left x out, hence wasn't aware of this.

 

Thanks again

Announcements

Top Tags