0% found this document useful (0 votes)
202 views11 pages

MECH 370 Lab 1

This lab introduces students to MATLAB, Simulink, and Simscape. The objective is to understand basic control theory concepts and the software environment. Models of a mass-spring-damper system are created in both Simulink and Simscape to analyze the system's response under different parameter values. The results show that reducing damping increases settling time to equilibrium, and that Simulink and Simscape produce identical outputs as expected since they model the same system. The lab demonstrates the usefulness of these tools for testing and experimenting with dynamic models without physical experimentation.

Uploaded by

Gab Simard
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
202 views11 pages

MECH 370 Lab 1

This lab introduces students to MATLAB, Simulink, and Simscape. The objective is to understand basic control theory concepts and the software environment. Models of a mass-spring-damper system are created in both Simulink and Simscape to analyze the system's response under different parameter values. The results show that reducing damping increases settling time to equilibrium, and that Simulink and Simscape produce identical outputs as expected since they model the same system. The lab demonstrates the usefulness of these tools for testing and experimenting with dynamic models without physical experimentation.

Uploaded by

Gab Simard
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Lab 1: Introduction to Simulink and Simscape

MECH 370
Lab Section: EI-X
Winter 2021

Submitted by: Gabriel Simard


40078484

Submitted to: Professor Suraj Joshi


January 31st, 2021
Objective
This lab is to help me become familiar with the MATLAB, Simulink and Simscape
environment and understand some of the basic concepts behind control theory such as
equilibrium points, stability, feedback, steady-state response, and linearization

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.

Mx’’ + Bx’ + Kx = f(t) (1.1)

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:

x’’ = 1/M (f(t) - Bx’ - Kx) . (1.2)

For a massless system, we isolate for x’.

x’ = 1/B (f(t) -Kx). (1.3)

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.

A step by step analysis on the procedure taken is as following:


1) Obtain necessary equation
2) Make the basic Simulink model
3) Write the script of the Simulink model and configure the model such that a full simulation
model can be produced
4) Initialize the parameters
5) Run the system
6) Obtain and analyze the results

Results

Exercise A: Simulink

The Simulink diagram for the following equation is given below.

Figure 1: Simulink Diagram


1) First create a Simmulink model of the mass-spring-damper system. Use the following
data:
M=2
B=10
K=10

Code:

Figure 2: Mass’s position and velocity vs time graphs

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

Figure 5: Mass’s position and velocity vs time graphs

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

Figure 7: Simscape Model for Questions 1 & 2

1) The simulation for M=2, B=10 and K=10 gives the following graph:
Figure 8

2) The only change from question #1 is of the damping coefficient to B=1

Figure 9

The Simscape model for questions 3 & 4 changes to the following:


Figure 10: Simscape Model for Questions 3 & 4

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.

You might also like