Question: [Python in Jupyter Notebook] Finish the code Part A: mass-spring pendulum Construct an appropriate f for a mass hanging from a spring, free to move
[Python in Jupyter Notebook] Finish the code
Part A: mass-spring pendulum Construct an appropriate f for a mass hanging from a spring, free to move in two dimensions (up/down and left/right) under the influence of gravity and the spring force. Consider a mass of 1 kg suspended from a spring with equilibrium length 5 m and spring constant 20 N/m. Question 1: code for the system In [ ]: NL = 5.0 # equilibrium Length of spring (m) k = 20.0 # spring constant (N/m) m = 1.0 # mass of object (kg) g = array( [0.0,-10.0]) # acceleration due to gravity (m/s^2) def f(state,t): # unpack state... r = V = # calculate forces... Fs1 = Fg1 = return ... # construct and return array of derivatives. Part A: mass-spring pendulum Construct an appropriate f for a mass hanging from a spring, free to move in two dimensions (up/down and left/right) under the influence of gravity and the spring force. Consider a mass of 1 kg suspended from a spring with equilibrium length 5 m and spring constant 20 N/m. Question 1: code for the system In [ ]: NL = 5.0 # equilibrium Length of spring (m) k = 20.0 # spring constant (N/m) m = 1.0 # mass of object (kg) g = array( [0.0,-10.0]) # acceleration due to gravity (m/s^2) def f(state,t): # unpack state... r = V = # calculate forces... Fs1 = Fg1 = return ... # construct and return array of derivatives
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
