Skip to main content
1-Visitor
July 5, 2022
Solved

Solve matrix

  • July 5, 2022
  • 1 reply
  • 1640 views

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

Best answer by 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

 

 

1 reply

25-Diamond I
July 5, 2022

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_E25-Diamond IAnswer
25-Diamond I
July 5, 2022

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

 

 

Casper1231-VisitorAuthor
1-Visitor
July 6, 2022

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