MECH 370 Lab 1
MECH 370 Lab 1
MECH 370
Lab Section: EI-X
Winter 2021
Introduction
This lab is an introduction to Matlab and Simulink used for the student to grasp the
basics of the software. This software permits engineers to utilize models and scripts to simplify
the complexity and extensivity of a problem. An important part in this lab is to understand the
formula that will be used to create the model.
where M is the mass, B the damping coefficient, K the spring coefficient and x the position of the
system. Isolating for x’’ we get:
Now, a Simulink model can be made using the necessary blocks, which include gains, sums,
integrators, scope and step.
Procedure
A simple Simulink model was created for this lab. A source block was added from the
sum block. Three gains were added, 1/M, B and K. Two integrators were also used and a
scope. For the second exercise, a similar procedure was used but without the mass. Please
refer to model screenshots for more details.
Results
Exercise A: Simulink
Code:
2) The only variable being changed in this question is the damping coefficient B to 1.
Figure 3: Mass’s position and velocity vs time graphs
3) Our governing equation now changes to equation 1.3 mentioned in the introduction
(X’= 1/B (f(t)-Kx)).
Figure 4: Simulink model for questions 3 & 4
The code remains the same, the only changes are in the variables with;
M=0
K=10
B=10
4) For this question the only change is to the damping coefficient from B=10 to B=1.
Figure 6: Mass’s position and velocity vs time graphs
Exercise B: Simscape
1) The simulation for M=2, B=10 and K=10 gives the following graph:
Figure 8
Figure 9
3)
Figure 11
4) The only change from question #3 is that the damping coefficient B is not equal to 1.
Figure 12
Discussion
The purpose of this lab was to introduce Matlab, Simulink and Simscape. These
softwares are used to save money and time while testing and experimenting models. This lab
demonstrates how useful this software is and how it is necessary.
For a non-zero mass system, the simulations show that reducing the damping coefficient
increases the time needed for the mass-spring-damper system to return to equilibrium. When
the initial conditions were changed, the graph was just shifted. Furthermore, we notice that the
results for both Simulink and Simscape are identical, which is to be expected. Indeed, even
though we used two different programs we expect the results to be the same since both of them
are analyzing the same dynamic models. These programs are very useful in terms of analyzing
models and observing how they change with respect to time.