write mathematica code to solve directly with out reducing: Home assignment 1 The direct…
- User
write mathematica code to solve directly with out reducing: Home assignment 1 The direct stiffness method Consider the four-spring assemblage shown in Figure below. Build the connectivity matrix for the structure and assemble the global stiffness matrix. Compute the displacements of the nodes 2 and 3, all forces in springs and the reaction forces at nodes 1 and 4. Finally, compute the internal strain energy and the potential energy of the external forces at the equilibrium state. Assume that the rigid vertical bar slides in the supports and remains horizontal. The applied force and spring’s stiffness constants are computed via personal number of the first group member according the table. Give the solution values with 3 significant digits. Fill in the report summary below! Submit your notes containing the main steps of the solution and your Mathematica Notebook as well.
i start to solve like: P1 P2 P3 P4 P5 P6 - P7 P8 P9 P10 9 7 0 6 2 0 - 4 0 1 4
Using the table to determine the values: P4=6→P=+ 42 KN P5=2→K^((1))=30 KN/mm P9=1→K^((2))=10 KN/mm,K^((3))=15 KN/mm P10=2→K^((4))=60 KN/mm Build Connectivity matrix from to Spring 1 1 2 Spring 2 2 3 Spring 3 3 4 Spring 4 2 4
Assemble the global stiffness matrix:The global stiffness matrix K is assembled by summing the contributions of each spring K_1= K^((1) ) [ ■(1&-1&0&0@-1&1&0&0@0&0&0&0@0&0&0&0)] K_2= K^((2) ) [ ■(0&0&0&0@0&1&-1&0@0&-1&1&0@0&0&0&0)] K_3= K^((3) ) [ ■(0&0&0&0@0&0&0&0@0&0&1&-1@0&0&-1&1)] K_4= K^((4) ) [ ■(0&0&0&0@0&1&0&-1@0&0&0&0@0&-1&0&1)] Summing these contributions, the global stiffness matrix K: K=[ ■(K^((1) )&-K^((1) )&0&0@-K^((1) )&K^((1) )+K^((2) )+K^((4) )&-K^((2) )&-K^((4) )@0&-K^((2) )&K^((2) )+K^((3) )&-K^((3) )@0&-K^((4) )&-K^((3) )&K^((3) )+K^((4) ) )] K=[ ■(30&-30&0&0@-30&100&-10&-60@0&-10&25&-15@0&-60&-15&75)]
The force vector F:F=[■(F_1@P@0@F_4 )]=[■(F_1@42@0@F_4 )] Apply Boundary Conditions and Solve for Unknowns: Nodes 1 and 4 are fixed, so u_1=0 and u_4=0 [F]=[k][U] The previous set of equations has 4 equations and 4 unknowns: u_2,u_3,F_1 and F_4 Since u_1=0 and u_4=0 we can reduce the system and solve for u_1 and u_3 then solve for F_1 and F_4 Or we can directly solve for all four unknowns (using mathematica) Compute the Forces in the Springs: T_i=F_i Δu_i Compute the Internal Strain Energy and the Potential Energy of the External Forces: U=1/2 ΣF_i Δu_i
Ω=-pu_2 - Assistant
Certainly! Let's translate the problem into a Mathematica Notebook. Here is a step-by-step approach to solving the problem using the direct stiffness method in Mathematica.
(* Clear previous variables and functions *) Clear["Global`*"] (* Define stiffness constants and applied force based on the information provided *) K1 = 30; (* KN/mm *) K2 = 10; (* KN/mm *) K3 = 15; (* KN/mm *) K4 = 60; (* KN/mm *) P = 42; (* KN *) (* Build the connectivity matrix *) connectivityMatrix = { {1, 2}, (* Spring 1 *) {2, 3}, (* Spring 2 *) {3, 4}, (* Spring 3 *) {2, 4} (* Spring 4 *) }; (* Assemble individual stiffness matrices for each spring *) k1 = K1 * {{ 1, -1, 0, 0}, {-1, 1, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 0, 0}}; k2 = K2 * {{ 0, 0, 0, 0}, { 0, 1, -1, 0}, { 0, -1, 1, 0}, { 0, 0, 0, 0}}; k3 = K3 * {{ 0, 0, 0, 0}, { 0, 0, 0, 0}, { 0, 0, 1, -1}, { 0, 0, -1, 1}}; k4 = K4 * {{ 0, 0, 0, 0}, { 0, 1, 0, -1}, { 0, 0, 0, 0}, { 0, -1, 0, 1}}; (* Global stiffness matrix - sum of individual matrices *) globalStiffnessMatrix = k1 + k2 + k3 + k4 (* Define the force vector *) forceVector = {0, P, 0, 0}; (* Solve the system of equations without reducing the matrix *) variables = {u1, u2, u3, u4}; (* Applying boundary conditions: u1 = 0, u4 = 0 *) boundaryConditions = {u1 -> 0, u4 -> 0}; (* System of equations *) equations = globalStiffnessMatrix . variables == forceVector; (* Solve the system for the unknown displacements u2 and u3 *) solutions = Solve[equations /. boundaryConditions, {u2, u3, F1, F4}] (* Extract displacements and solve for reaction forces *) u2Sol = u2 /. solutions[[1]] u3Sol = u3 /. solutions[[1]] F1Sol = F1 /. solutions[[1]] F4Sol = F4 /. solutions[[1]] (* Compute the forces in the springs *) deflection = {0, u2Sol, u3Sol, 0}; springForces = globalStiffnessMatrix . deflection (* Internal strain energy calculation *) internalStrainEnergy = 1/2 * (deflection . springForces) (* Potential energy of the external forces *) potentialEnergy = -P * u2Sol (* Display results with 3 significant digits *) N[{u2Sol, u3Sol, F1Sol, F4Sol, springForces, internalStrainEnergy, potentialEnergy}, 3]Explanation:
-
Stiffness Matrices: Each spring has its stiffness matrix defined. These matrices are summed to form the global stiffness matrix.
-
Force Vector: A vector is created for the applied forces, with the force applied only at node 2.
-
Boundary Conditions: Fixing displacements
u1andu4to 0 as these nodes are static. -
Solution: The system of equations is solved for the unknown displacements and reaction forces considering the boundary conditions.
-
Strain Energy and Potential Energy: Calculated using strains in the springs and the potential introduced by external forces.
This code directly uses Mathematica's symbolic computation abilities to solve the structural analysis problem as per the direct stiffness method. Adjust the code if your numbering conventions or input parameters differ.
-