Question
a) We want to write the above equations in matrix form as F = Kx - b .in Python. Write a function that takes the
a) We want to write the above equations in matrix form as F = Kx - b .in Python. Write a function that takes the ki and Li values as inputs in 1-D arrays and returns the arrays corresponding to K and b.
b) Use the function from part a and the linalg functions to solve for the equilibrium positions of the masses (where Fi=0) for the cases
(i) k = [1 2 3 4], L = [1 1 1 1], Lw=10
(ii) k = [0 1 1 0], L = [2 2 1 1], Lw=4
c) Write the appropriate code needed to solve this system of equations using scipy.integrate.solve_ivp. (Hint: your state vector in this case should have 6 components, 3 for x_i and 3 for v_i. Your derivative function will need the vectors k and L as additional arguments). Compute the solutions using as initial values the equilibrium positions x_i for the 2 cases you computed in part 3, and v_i=0. Are the results as you might expect?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started