Project

Using SIMULINK with script and workspace

Objectives:

  1. Given an array of force and distance, determine the work done using SIMULINK
  2. Use MATLAB and SIMULINK together to implement an equation
  3. Studying the behaviour of 'Mass-Spring-Damper in Simulink and Simscape’ model

#Objective A:

Building the above coordinates using a signal builder:

Simulink model:

Output:

#Objective B:

Defining x and y arrays in MATLAB:

Modeling the function in SIMULINK:

#Objective C:

'Mass-Spring-Damper in Simulink and Simscape’ model:

Deriving the governing equation for the model:

  • Figure A represents a spring and damper without a mass attached.
  • When the mass is attached in Figure B, the spring experiences tension and is pulled down a distance of 's'. The system reaches equilibrium with net forces equalling zero, and hence the system experiences no acceleration.
  • In Figure C, the mass is pulled further down a distance of 'x'. This external pull force allows the system to be 'active' again such that there is a net force acting on the system, which leads to a simple harmonic motion oscillation.

  • This free body diagram results from Figure C above.

`F_G = mg`

`F_K = k(s+x)`

`F_C = Cv`

Using Newton's second law of motion:

`sumF = mg - ks - kx-Cv = ma`

`mg - ks` equals to 0 because both are of equal magnitude (In Figure B when the system is in equilibrium, it's because mg and ks cancel out)

`sumF = - kx - Cv = ma`

`-kx - Cdx/dt = m(d^2x)/dt^2`

`(d^2x)/dt^2 = -k/m*x - c/m*dx/dt` -------------------------- Governing equation of the model

Changing the value of mass, damper, and spring for the Simscape model only:

  • Common variables for mass (m), damper (b), and spring (k) were assigned for both Simulink and Simscape. To change the output of Simscape only, new variables (m1, b1, k1) and values (mass was doubled, damper and spring constant were halved) were assigned for the three parameters in MATLAB.

Changing the value of Mass x0=2 in the Simulink model only:

  • Frequency remains the same but the amplitude has doubled when mass x0 changed from 1 to 2

Simulink and Simscape as two separate displays:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.