Determine the effect of parameters on the solutions

Assignment Help Simulation in MATLAB
Reference no: EM131472000

MAT Laboratory: The Mass-Spring System

In this laboratory we will examine harmonic oscillation. We will model the motion of a mass-spring system with differential equations.
Our objectives are as follows:

1. Determine the effect of parameters on the solutions of differential equations.
2. Determine the behavior of the mass-spring system from the graph of the solution.
3. Determine the effect of the parameters on the behavior of the mass-spring. The primary MATLAB command used is the ode45 function.

Mass-Spring System without Damping

The motion of a mass suspended to a vertical spring can be described as follows. When the spring is not loaded it has length l0 (situation (a)). When a mass m is attached to its lower end it has length l (situation (b)). From the first principle of mechanics we then obtain1767_Principle of Mechanics.jpg

The term g measures the gravitational acceleration (g c 9.8m/s2 c 32ft/s2). The quantity k is a spring constant measuring its stiffness. We now pull downwards on the mass by an amount y and let the mass go (situation (c)). We expect the mass to oscillate around the position y = 0. The second principle of mechanics yields

1380_Mass to Oscillate.jpg

using (L5.1). This ODE is second-order.

2285_ODE is second-order.jpg

Equation (L5.2) is rewritten

d2y / dt2 + ω20 y = 0           (L5.3)

where ω20 = k/m. Equation (L5.3) models simple harmonic motion. A numerical solution with initial conditions y(0) = 0.4 meter and y'(0) = 0 (i.e., the mass is initially stretched downward 40cms and released, see setting (c) in figure) is obtained by first reducing the ODE to first-order ODEs (see Laboratory 4).

Let v = y'. Then v' = y'' = -ω20y = -9y. Also v(0) = y'(0) = 0. The following MATLAB program implements the problem (with ω0 = 3).
function LAB05ex1

m = 1;                                                        % mass [kg]
k = 9;                                                         % spring constant [N/m]
omega0 = sqrt(k/m);
y0 = 0.4; v0 = 0;                                         % initial conditions
[t,Y] = ode45(@f,[0,10],[y0,v0],[],omega0);   % solve for 0<t<10
y = Y(:,1); v = Y(:,2);                                   % retrieve y, v from Y
figure(1); plot(t,y,'b+-',t,v,'ro-');                   % time series for y and v grid on;
%____
function dYdt = f(t,Y,omega0) y = Y(1); v = Y(2);
dYdt = [ v ; -omega0^2*y ];

Note that the parameter ω0 was passed as an argument to ode45 rather than set to its value ω0 = 3 directly in the function f. The advantage is that its value can easily be changed in the driver part of the program rather than in the function, for example when multiple plots with different values of ω0 need to be compared in a single MATLAB figure window.

670_Damped harmonic motion.jpg
Figure L5a: Harmonic motion

1. From the graph in Fig. L5a answer the following questions.

(a) Which curve represents y = y(t)? How do you know?

(b) What is the period of the motion? Answer this question first graphically (by reading the period from the graph) and then analytically (by finding the period using ω0).

(c) We say that the mass comes to rest if, after a certain time, the position of the mass remains within an arbitrary small distance from the equilibrium position. Will the mass ever come to rest? Why?

(d) What is the amplitude of the oscillations for y?

(e) What is the maximum velocity (in magnitude) attained by the mass, and when is it attained? Make sure you give all the t-values at which the velocity is maximum and the corresponding maximum value. The t-values can be determined by magnifying the MATLAB figure using
the magnify button, and by using the periodicity of the velocity function.

(f) How does the size of the mass m and the stiffness k of the spring affect the motion?

Support your answer first with a theoretical analysis on how ω0 - and therefore the period of the oscillation - is related to m and k, and then graphically by running LAB05ex1.m first with m = 5 and k = 9 and then with m = 1 and k = 18. Include the corresponding graphs.

2. The energy of the mass-spring system is given by the sum of the potential energy and kinetic energy. In absence of damping, the energy is conserved.

(a) Plot the quantity E = (1/2) mv2 + (1/2) ky2 as a function of time. What do you observe? (pay close attention to the y-axis scale and, if necessary, use ylim to get a better graph). Does the graph confirm the fact that the energy is conserved?

(b) Show analytically that dE/dt = 0. (Note that this proves that the energy is constant).

(c) Plot v vs y (phase plot). Does the curve ever get close to the origin? Why or why not? What does that mean for the mass-spring system?

Mass-Spring System with Damping

When the movement of the mass is damped due to viscous effects (e.g., the mass moves in a cylinder containing oil, situation (d)), an additional term proportional to the velocity must be added. The resulting equation becomes

m (d2y/ dt2) + c (dy/dt) + ky = 0 or (d2y/dt2) + 2p (dy/dt) + ω20y = 0       (L5.4)

by setting p = c/2m . The program LAB05ex1 is updated by modifying the function f:

function LAB05ex1a
m = 1;                                                              % mass [kg]
k = 9;                                                               % spring constant [N/m]
c = 1;                                                               % friction coefficient [Ns/m]
omega0 = sqrt(k/m); p = c/(2*m);
y0 = 0.4; v0 = 0;                                               % initial conditions
[t,Y] = ode45(@f,[0,10],[y0,v0],[],omega0,p);      % solve for 0<t<10
y = Y(:,1); v = Y(:,2);                                         % retrieve y, v from Y
figure(1); plot(t,y,'b+-',t,v,'ro-');                         % time series for y and v grid on;
-------------------------------------------
function dYdt = f(t,Y,omega0,p) y = Y(1); v = Y(2);
dYdt = [ v ; ?? ];                                                % fill-in dv/dt

3. Fill in LAB05ex1a.m to reproduce Fig. L5b and then answer the following questions.

(a) For what minimal time t1 will the mass-spring system satisfy |y(t)| < 0.02 for all t > t1? You can answer the question either by magnifying the MATLAB figure using the magnify button (include a graph that confirms your answer), or use the following MATLAB commands (explain):

782_Damped harmonic motion1.jpg
Figure L5b: Damped harmonic motion

for i=1:length(y) m(i)=max(abs(y(i:end)));
end
i = find(m<0.02); i = i(1);
disp(['|y|<0.02 for t>t1 with ' num2str(t(i-1)) '<t1<' num2str(t(i))])

(b) What is the maximum (in magnitude) velocity attained by the mass, and when is it attained? Answer by using the magnify button and include the corresponding picture.

(c) How does the size of c affect the motion? To support your answer, run the file LAB05ex1.m for c = 2, c = 6 and c = 10. Include the corresponding graphs with a title indicating the value of c used.

(d) Determine a nalytically the smallest (critical) value of c such that no oscillation appears in the solution.

4. (a) Plot the quantity E = (1/2) mv2 + (1/2) ky2 as a function of time. What do you observe? Is the energy conserved in this case?

(b) Show analytically that (dE/dt) < 0 for c > 0 while (dE/dt)  > 0 for c < 0.

(c) Plot v vs y (phase plot). Comment on the behavior of the curve in the context of the motion of the spring. Does the graph ever get close to the origin? Why or why not?

Attachment:- Attachments.rar

Reference no: EM131472000

Questions Cloud

Traditional brick-and-mortar businesses : The FTC considers e-commerce just the same as traditional brick-and-mortar businesses. Describe what the FTC requires regarding claims made by websites.
Replacement algorithm is used for block replacement : Assume LRU (Least Recently Used) replacement algorithm is used for block replacement in the cache, and the cache is initially empty.
Would prospective seller be wise to engage services of agent : What is the amount of the standard real estate commission charged by brokerage firms in your community? Assume you own a home in which your equity is $25,000.
Identify the important attributes for your chosen product : Identify the important attributes for your chosen product and select two key variables for your perceptual map.
Determine the effect of parameters on the solutions : Determine the effect of parameters on the solutions of differential equations. Determine the behavior of the mass-spring system from the graph of the solution.
Parameter and returns a float number : Create your own function in C that accepts one input parameter and returns a float number. You decide the theme.
Describe the purpose of a code of ethics for health educator : HPR232: Describe the purpose of a code of ethics for health educators -  What does each article mean - Why is this important to health educators
One of the disadvantages of internal recruitment : One of the disadvantages of internal recruitment is:
Name one advertisement that illustrates the zeigarnik effect : What is another tactic you have seen (other than the Zeigarnik) that advertisers have used that gained your attention?

Reviews

Write a Review

Simulation in MATLAB Questions & Answers

  Is it possible tom will catch jerry in his life time?

Use Adam-Bashforth Technique with your result from Runge-Kutta method as initial step to compute when will Tom catch Jerry - Suppose Tom's acceleration is unknown someone found did not catch Jerry in 2 minutes. Is it possible Tom will catch Jerry in..

  Perform the closed loop system using block diagram

Build the closed loop system using Simulink-Find poles, zeros and pole-zero map for the closed loop system-Perform the closed loop system using block diagram

  Write a function with header

Write a function with header [M]= myMax(A) where M is the maximum (largest) value in A. Do not use the built-in MATLAB function max

  Design an echo filter

Design an echo filter. The output should be the original signal followed by three echoes with attenuations of 10%, 25 % and 30% respectively and the delays should be 0.5 secs, 1 sec, and 1.5 secs respectively for each echo

  Solve the linear system

Compute the rank of S manually and use the MATLAB function to verify the result - Solve the linear system of equations Ax = b using MATLAB.

  Find inverse laplace transform for frequency domain signal

EECE 365 Signals, Systems, & Transforms. Find Inverse Laplace Transform for following frequency domain signal using Partial Fraction Expansion. Find Inverse Laplace Transform for following time domain signal using MATLAB. Consider using "sym" functio..

  Develop a fuzzy forecasting system using matlab

Develop a fuzzy forecasting system using Matlab Toolbox. The system performs a forecasting task for power marketing price. The data used in this assignment is from the real world and it has been split up into two parts.

  Need an expert who can model a drill in simulink

Need an expert who can model a drill in Simulink. Working model of a drill needing for an improvment to behave more realistically as a drill to drill through plastic block.

  Theory of machines and mechanisms

Kinematics & Dynamics of Machines Coupler Curve Synthesis. Construction of mechanism, to any selected scale and from any selected material. Popsicle sticks will be made available to the class. Cardboard also works well

  Queuing simulator

Queuing Simulator: Consider a communications router that can route (service) EXACTLY 800 messages per second (mps). Assume that messages arrive at an AVERAGE rate of 850 messages per second. Assume that the arriving messages follow an exponential dis..

  Evaluate signals and systems using the z-transform

ECE471 LAB - Use the function freqz to plot the phase and magnitude of the above system. Comment on the type of system it is and draw conclusions as to its potential usage.

  Write matlab to display even component and odd component

Write a MATLAB script to do the Display v(t) and vi(2t-1) in window 1 by using subplot. Display both the even component and odd component of v(0 in window 2.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd