I am trying to write a for loop that will take values from two different matrices and create one 2x1 matrix and one 2x2 matrix. The purporse of the 2x1 and the 2x2 is to take the inverse of the 2x2 times the 2x1 to solve for 2 unkown variables. The matrices that are being pulled from are 15x3 originally. I am assuming one of my 3 unknowns to be equal to 1 and therefore enabling me to solve two equations for two unknowns simultaneously. I am using mathcad prime 2.0 to do this. I will attach a worksheet showing what I am trying to do. At the bottom of the worksheet is an italicized section named "Solve for Un-Normalized Force Vector". I have it done for one set of values but dont want to have to go through and redo it 14 more times to get my results. I am new to programming loops and such so I am trying to teach myself as much as possible.
Any help and suggestions are much appreciated.
Solved! Go to Solution.
Think the attached should do what you intended.
In the Tie Down Analysis_2 that you helped me with, I know there is a way to combine the 3 for loops into one for loop correct? So instead of mathcad going through and running 15 iterations three time, it only runs the 15 iterations once and still outputs the matrices. Would I just have to define a new "vec" and have it return that each and every time? Does what I am asking make sense?
I am not sure which three for-loops you are talking of.
You can calculate Rcs, Rcsp, Fs and also fs in one for loop. Care has to be taken with Fs, as the denominator requires all rows of Rcsp to be already known.
As a program in MC can only return one result, you have to pack all result matrices as elements in one result vector. I have chosen to name them new_... to be able to compare with the earlier results.