Question: Can you write a matlab code for this?? The vertical position of a mass on a spring oscillates after being released if it is not
Can you write a matlab code for this?? The vertical position of a mass on a spring oscillates after being released if it is not initially at equilibrium, but the amplitude of the oscillation decreases exponentially due to air resistance
Assume that for a particular massspring system, the vertical position y of the mass follows yet cospir where t is time. In this case, the vertical velocity of the mass is vet pisinpitcospit
Write a MATLAB script in which you: Create a time vector t of equally spaced values between and in increments of
Calculate the vertical position y for every time value.
Calculate the vertical velocity v for every time value.
On the left yaxis, plot the vertical position versus time.
Set the left yaxis limits to and
Label the left yaxis y
On the same figure, but on the right yaxis, plot the vertical velocity versus time.
Set the right yaxis limits to and
Label the right yaxis v
Label the xaxis t
Title the axes "Vertical position and velocity over time".
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
