Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I am using Mathcad Express 10 to calculate the stress and deflection of components under a specific load case. To avoid having to create a copy of the calculation for each component, I want to perform the calculation using vectors and matrices simultaneously for all components and their values.
Unfortunately, I don't have access to the full version of Mathcad so I can't use any programming.
However, when I switch the calculation to vectors, a problem occurs that I cannot solve. I have created a minimal example, see attached file.
There are three vectors (v1 - v3) which all have the same length. The length of the vectors results from the number of different components to be calculated and is not fixed but can change. Therefore, the solution must work with any vector length.
What I am trying to achieve: I need the maximum values of each line from the vectors for the calculation later on. The resulting vector then has the maximum value from all the first rows of the vectors in its row 1 and so on for the next rows. The picture below shows the desired result.
To achieve this I have come up with the following solution:
The calculation of v_max(M1,m) produces the expected result: a vector with the max values of each row of the vectors v1 - v3. But: I cannot continue calculating with this result or assign it to a variable. Error: “This value must be an integer”.
I understand that Mathcad expects an integer as an index here, but why can Mathcad create the result vector as described but not assign it to a variable or calculate with it?
If anyone has any other ideas on how to determine the respective max values from the vectors (Mathcad Express only), I would be very grateful for that too!
Thanks in advance for your help!
Solved! Go to Solution.
Simply add a vector index "m" when defining v.var
BTW, you may want to have a look at @LucMeekes toolbox of functions for Prime Express Prime Express...A joke
Simply add a vector index "m" when defining v.var
BTW, you may want to have a look at @LucMeekes toolbox of functions for Prime Express Prime Express...A joke
Many thanks for the quick solution, it's finally working!
And also for the reference to the toolbox, I'll have a look there straight away.
