Answered step by step
Verified Expert Solution
Question
1 Approved Answer
When a system oscillates over a fixed aperture, it can be considered to contain a mass - spring - damper set - up . This
When a system oscillates over a fixed aperture, it can be considered to contain a mass
springdamper setup This common model is often utilized in engineering applications
and mathematical simulations. Such model can be visualized in the following figure Fig
Figure : Example Mass Spring Damper.
In this project, you will create a program that takes the mass m damping ratio c spring
constant k and driving force F to find the reactionary motion of the mass over time.
The governing equation is a nd order differential equation Eq
mdx
dt cdx
dt kx F t
Specific Parameters
You are tasked to simulate the following trials and present the results:
Trail No mass kg k Nm c Nsm
For this project, we are simulating the homogeneous response, where the forcing func
tion F t The initial position is always x m
Required Function
Develop a function called:
function xkpvkp VibrationPositionxkvkmkcfdttype
where you would approximate the position of a massspringdamper system from the
second order partial differential equation for an individual timestep. The input values for
the functions are:
xkvk Iteration kPosition Velocity
mkc Model Parameters mass spring constant, damping constant
f Forcing Function
dt Timestep
type Type of differentiation Forward Euler or Runge Kutta
xkp vkp Iteration kPosition Velocity
Incorporate your function into the following main topics:
Forward Euler numeric scheme
Utilizing Forward Euler numeric schemes, eg given dy
dt f t y
df
dt f tk y f tk y
t
and using the given listed parameters:
a Solve for the homogeneous response of the massspringdamper ODEs and
plot the position of the mass vs time.
Hint: You should break down the second order differential equation into two first
order equations in order to apply the numeric schemes. I.e let vt dxt
dt then
dxt
dt f t becomes:
dvt
dt f t
dxt
dt vt
th Order RungeKutta
Utilizing th Order RungeKutta numeric schemes, eg given dx
dt f t x
ctf tk xk
ctf
tk
t xk
c
ctf
tk
t xk
c
ctf tk t xk c
xk xk
c
c
c
c
and using the given listed parameters:
a Solve for the homogeneous response of the massspringdamper ODEs and
plot the position of the mass vs time.
Animation of Time Evolution
Generate a video of the mass position as it evolves over time for a massspring
damper system for each trial. Use the following timestep for your output frame.
Initial Time t
Total Time tf seconds
Timestep dt seconds
Frames per Second fps frames per second
Note: Make sure ALL your plots contain the necessary titles legends and axis
labels You need to submit three second videos along with your script on
Canvas. Use the naming convention LastName ID video # where # is or
Extra Credit : Inhomogeneous Response
For each of the three trials, also solve the inhomogeneous response, using
the forcing function F t a sin tpi where a N
Solve for the inhomogeneous response of the massspringdamper ODEs and
plot the position of the mass vs time for each trial.
Then change the three video animation to plot both responses. Each video
should contain two plots sidebyside, with the left subplot being the homoge
neous free response, and the right subplot being the inhomogeneous forced
response. Use the same timestep as step
Hint: set f in the function input to an array: f tf t
dtf t dt
Note: If you completed the extra credit, you may replace the video submission in
part with the three videos in part instead.
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