In [2]: import sympy as sp # Define symbols m, 1, b, omega= sp.symbols ('m 1 b omega') Ix = 1/12 * m*1**2 In [3]: # Inertia matrices of rods about their mass centers (G) I_G1= sp.Matrix ([[0, 0, 0], [0, Ix, 0], [0, 0, Ix]]) I_G2= sp.Matrix ([[Ix, 0, 0], [0, 0, 0], [0, 0, Ix]]) I_G3= sp.Matrix ([[Ix, 0, 0], [0, Ix, 0], [0, 0, 0]]) In [4]: # Position vectors of mass centers of rods relative to the mass center S* r_Gl_Sstar= sp.Matrix ([-b/2, 0, 0]) r_G2_Sstar = sp.Matrix ([0, -b/2, 0]) r_G3_Sstar = sp.Matrix ([0, 0, -b/2]) # Inertia matrices of rods about S* using the parallel axis theorem I_R1_Sstar=I_G1 + mr_Gl_Sstar.cross (r_Gl_Sstar).cross (sp.eye (3)) I_R2_Sstar=I_G2 + m r_G2_Sstar.cross (r_G2_Sstar).cross (sp.eye (3)) I_R3_Sstar = I_G3+ m* r_G3_Sstar.cross (r_G3_Sstar).cross (sp.eye (3)) ShapeError /var/folders/nk/sfvkdtp13jz_9vg5qxdyqjf00000gn/T/ipykernel_2376/3050223977.py in 4 r_G3_Sstar = sp.Matrix ([0, 0, -b/2]) 5 # Inertia matrices of rods about S* using the parallel axis theorem 6 I R1_Sstar=I_G1 + mr_G1_Sstar.cross (r_G1_Sstar).cross (sp.eye (3)) I_R2_Sstar 7 I_G2+ mr_G2_Sstar.cross (r_G2_Sstar).cross (sp.eye (3)) 8 I R3_Sstar = I_G3+ mr_G3_Sstar.cross (r_G3_Sstar).cross (sp.eye (3)) -/opt/anaconda3/lib/python3.9/site-packages/sympy/matrices/matrices.py in cross (self, b) 1291 1292 ->1293 1294 1295 Traceback (most recent call last) if not (self.rows *self.cols= b.rows* b.cols == 3): raise ShapeError("Dimensions incorrect for cross product: 88 x 8s" 8 ((self.rows, self.cols), (b.rows, b.cols))) else: ShapeError: Dimensions incorrect for cross product: (3, 1) x (3, 3)
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Step by step
Solved in 3 steps with 1 images