Question

The spring-mass system is at rest when the force P(t) is applied, where P(t) = 100 N 20 N when t < 2 s when t>2 s The differe

NOTE:Follow the Runge-Kutta Method.Any programming language(Matlab) can be used.Plot Position-Time and Velocity-Time graphs.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

k=75;
m=2.5;
f=@(t,y)[y(2) (10*t*(t<2)+20*(t>=2))/m-k*y(1)/m];
t=0:.01:5;
h=.01;
y0=[1 0];%initial condition
y=zeros(length(t),length(y0));
y(1,:)=y0;%initial value put
for i = 1:length(t)-1%this calulates y using RK4
k1=f(t(i),y(i,:));
k2=f(t(i)+h/2,y(i,:)+k1*h/2);
k3=f(t(i)+h/2,y(i,:)+k2*h/2);
k4=f(t(i)+h,y(i,:)+k3*h);
phi = (k1+2*k2+2*k3+k4)/6;
y(i+1,:) = y(i,:) + phi*h;
end
plot(t,y(:,1))
xlabel('time')
ylabel('displacement')
figure
plot(t,y(:,2))
xlabel('time')
ylabel('Velocity')
fprintf('Max displacement between 0 to 5second: %f\n',max(y(:,1)))

>> rungeK Max displacement between 0 to 5second: 1.291302 fx >> A Figure 2 A Figure 1 Desktop Window Help Tools Desktop Windo

Add a comment
Know the answer?
Add Answer to:
NOTE:Follow the Runge-Kutta Method.Any programming language(Matlab) can be used.Plot Position-Time and Velocity-Time graphs. The spring-mass system...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Both parts please! 1 Runge-Kutta Method The discretization of the spatial derivatives of a PDE often...

    Both parts please! 1 Runge-Kutta Method The discretization of the spatial derivatives of a PDE often results in a system of ODEs of the fornm du Runge-Kutta methods are the most commonly used schemes for numerically integrating in time the ODE system. We will numerically implement the "standard" third-order Runge-Kutta method. To advance the solution u from time t to t + Δ1, three sub-steps, are taken. If the solution at time t is un the following three steps are...

  • 6) The 18 kg mass of a spring-mass system is initially at rest. At time =...

    6) The 18 kg mass of a spring-mass system is initially at rest. At time = 0, a 400 N force is applied (toward the right). Spring constant is 100 kN / m, and the viscous damping coefficient is 520 Ns/m Determine the transient response F = (400 N) 1(t) Delay time [HINT: may need to a) graphing calculator, fixed point iteration; or calculator equation solver] b) c) use a m Peak time Maximum overshoot (in mm) 6) The 18...

  • Consider the following differential equation which describes a spring-mass-damper system më + ci + kx =...

    Consider the following differential equation which describes a spring-mass-damper system më + ci + kx = cos(2nt) where c 1.9 and k = 3.1. The initial conditions are given as x(0) = 0 and 2(0) = 0 and the time step is 0.1 s. 1. Assuming that m - 0, use the Runge-Kutta 4th order method to find (a) x(0.1) and (b) *(0.1). 2. Assuming that m 1, use Euler's method to find (a) 2(0.2) and (b) X(0.3).

  • Problem 1 (Harmonic Oscillators) A mass-damper-spring system is a simple harmonic oscillator whose dynamics is governed...

    Problem 1 (Harmonic Oscillators) A mass-damper-spring system is a simple harmonic oscillator whose dynamics is governed by the equation of motion where m is the mass, c is the damping coefficient of the damper, k is the stiffness of the spring, F is the net force applied on the mass, and x is the displacement of the mass from its equilibrium point. In this problem, we focus on a mass-damper-spring system with m = 1 kg, c-4 kg/s, k-3 N/m,...

  • Please help with 4a and 4b 4. (8 marks) A spring of natural length L is...

    Please help with 4a and 4b 4. (8 marks) A spring of natural length L is hung vertically with a mass of 2 kg attached to the end. 4(a) Assume that the friction is negligible and the spring constant is k 128. Find the position of the mass at time t, if the spring is pulled down 0.2m from its equilibrium position and released with velocity 0 at time t = 0. Flo)0.2 4(b) Assume that a spring, with an...

  • A damped forced oscillation with mass-spring sys- tem is modeled as an nonhomogeneous ODE as following:...

    A damped forced oscillation with mass-spring sys- tem is modeled as an nonhomogeneous ODE as following: my" + cy' + ky = r(t) where m = 1 kg, k = 1 N/m and c = 2 N m/s. Initially, y(0) 1m y(0) = -1m/s. r(t) is the input force for this system. Initially (t = (s), there is no input force for this system r(t) = 0 N. At time t = 2s, a costant force (r(t) = 2 N)...

  • The figure shows the position-time graph of an object of mass m oscillating on the end of a massless ideal spring of spring constant k

    The figure shows the position-time graph of an object of mass m oscillating on the end of a massless ideal spring of spring constant k. Answer the following questions.1. Which of the following graphs is the correct velocity-time graph of the oscillation?2. Which of the following graphs is the correct acceleration-time graph of the oscillation?3. If the mass of the object is m = 0.500 kg, what is the spring constant k of the ideal spring?Hint: read o the period of...

  • 3. [10 pts) Consider a familiar horizontal ideal spring-mass system. The solutions for both the velocity...

    3. [10 pts) Consider a familiar horizontal ideal spring-mass system. The solutions for both the velocity and position of the mass are oscillatory. Write down the second-order differential equa- tion which describes the position of the mass. Although this differential equation does have an analytic solution, use Mathematica to find and plot x(t) numerically, using NDSolve. Pick convenient values for mass and spring constant, and assume the object begins at rest at some finite positive position. For these values, use...

  • When a 4 kg mass is attached to a spring whose constant is 100 N/m, it...

    When a 4 kg mass is attached to a spring whose constant is 100 N/m, it comes to rest in the equilibrium position. Starting at t= 0, a force equal to f(t) = 12e-3t cos 6t is applied to the system. In the absence of damping, (a) find the position of the mass when t= 1. (b) what is the amplitude of vibrations after a very long time?

  • Solve it with matlab 25.16 The motion of a damped spring-mass system (Fig. P25.16) is described...

    Solve it with matlab 25.16 The motion of a damped spring-mass system (Fig. P25.16) is described by the following ordinary differential equation: d’x dx ++ kx = 0 m dr dt where x = displacement from equilibrium position (m), t = time (s), m 20-kg mass, and c = the damping coefficient (N · s/m). The damping coefficient c takes on three values of 5 (under- damped), 40 (critically damped), and 200 (overdamped). The spring constant k = 20 N/m....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT