How the MATLAB code for the RC sims works
To create more accurate stiffnesses for the RC sims, this MATLAB code is utilized in order to create a stiffness matrix, by taking in material and tube properties.
To start, when ran, the code comes up with a pop up screen, where input values are required to continue the code. These values include Elastic/Young’s Modulus, Shear Modulus, Outer Diameter, Wall Thickness, and the length of the tube not modeled (which essentially means that the length that is not modeled in ANSYS is the length of the imaginary cantilever beam).
Essentially, what we are doing with these input values is assuming that the joints of the frame are continuing without actually modeling them. To do this, because the tubes are all fixed together (so no allowed translation or rotation), we act as if the rest of the tube that is not modeled is a cantilever beam, and the point at which the joint is cut is the end of the cantilever beam, with the stress/force at that joint being an applied load.
After inputting those values, the code then calculates the necessary values in order to create the stiffness matrix. These include the inner diameter, cross sectional area, second moment of inertia, and polar moment of inertia. These are all necessary in order to solve each of the respective stiffness values, including axial, torsional, and bending stiffness. Lastly, an empty 6x6 matrix is calculated, where each row represents a force/moment (first 3 rows being force in x,y,z, and next 3 being moment in x,y,z), and each column representing per unit of distance, with the first 3 being length in x,y,z, and the next 3 being radians in x,y,z).
This is the stiffness matrix for a cantilever beam, which I then mimic in the matrix with the calculated stiffness values.
The given result is then printed liked this, which can be directly input to Ansys in the worksheet stiffness coefficient matrix.