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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

Extracting data from a vector and create two sets of vectors, Creating a vector subset

SFares
14-Alexandrite

Extracting data from a vector and create two sets of vectors, Creating a vector subset

Hello All,

 

I have attached P10 sheet and an Excel sheet I am reading from. Many thanks to Werner and Stuart for helping me get this far. On page 12 of the Mathcad sheet, you’ll see the results of the axial forces and moments imported from the attached Excel file. On page 13, I’ve listed a couple of questions I need help with:

1 How do I extract from the [TC axial Comp] forces of the panel forces (e.g. TC1, TC2, TC3, TC4, .... ) and place them into a vector labeled TC.Panel.Axial.Compr?

2. How can I extract the [TC axial Comp] forces at panel points (TPP#), such as TPP3, TPP5, TPP7, TPP9, … and place them into a vector labeled TC.PP.Axial.Compr?

 

Regards,

Sam

SFares_0-1756911162063.png

 

ACCEPTED SOLUTION

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

Page 11:

You used the row operator to extract the data and so you created 1x1 matrices. You should use the vector index instead as shown for the first two values in the pic

Werner_E_1-1756913755732.png

 

Page 12:

You get an error when calculating TX.Axial.Tense which results in this variable being undefined. Reason is that "filterNaN" throws an error if the matrix/vector supplied does not contain a single NaN. You may use try..on error.. to trap this case and create your own "FilterNaN" function (I used a capital "F" so not to overwrite the built-in function).

Werner_E_2-1756913967220.png

This simple function will erroneously return the unchanged matrix/vector if every rows contains a NaN. To cope with this a more elaborate version could be used

Werner_E_3-1756914456539.png

 

 Page 13:

I hope I have understood correctly what you need. Here is a simple way to split the vector, depending on whether the name starts with “TC” or not.
To be on the safe side, I have also created vectors with the corresponding names in case you need that mapping.
I hope this helps.

Werner_E_0-1756913473099.png

In case you need this kind of splitting more often you may consider turning it into a utility function.

 

Prime 10 sheet attached

 

View solution in original post

2 REPLIES 2
Werner_E
25-Diamond I
(To:SFares)

Page 11:

You used the row operator to extract the data and so you created 1x1 matrices. You should use the vector index instead as shown for the first two values in the pic

Werner_E_1-1756913755732.png

 

Page 12:

You get an error when calculating TX.Axial.Tense which results in this variable being undefined. Reason is that "filterNaN" throws an error if the matrix/vector supplied does not contain a single NaN. You may use try..on error.. to trap this case and create your own "FilterNaN" function (I used a capital "F" so not to overwrite the built-in function).

Werner_E_2-1756913967220.png

This simple function will erroneously return the unchanged matrix/vector if every rows contains a NaN. To cope with this a more elaborate version could be used

Werner_E_3-1756914456539.png

 

 Page 13:

I hope I have understood correctly what you need. Here is a simple way to split the vector, depending on whether the name starts with “TC” or not.
To be on the safe side, I have also created vectors with the corresponding names in case you need that mapping.
I hope this helps.

Werner_E_0-1756913473099.png

In case you need this kind of splitting more often you may consider turning it into a utility function.

 

Prime 10 sheet attached

 

SFares
14-Alexandrite
(To:Werner_E)

Perfect!

 

Thank you so much for all you do, Werner!

Announcements


Top Tags