Project

Calculation of work done, Solving and saving output of an equation to a file & Mass Spring Damper System Comparison

Objective:

1. Calcuting the work done by the cutting tool of a shaping machine as the tool moves through a distance of 100 mm. The force on the cutting tool w.r.t to the length traversed by the tool is given below

Distance (mm) 0 20 40 60 80 100

Force (kN) 60 72 65 53 44 50

2. Solving the equation z=3x2-5y+18 using simulink blocks and store the result values using To File block. The value of x = [22 3 55.6 9 12 10] and y = [5 31 95 56.3 77 61] are to be provided from the command window

3. Running the example ‘Mass-Spring-Damper in Simulink and Simscape’ and solving the following problems:

  1. Derive the governing equation for the model
  2. Change the value of mass, damper, and spring for the Simscape model and plot the result. Change the value of Mass x0=2 in the Simulink model and plot the results.
  3. Make the response from Simscape and Simulink as two separate displays.

1. Work Done by the Shaper Tool

For the model the following blocks were used

  1. Constant
  2. Product
  3. Sum of elements
  4. Display

Fig: Model for Calculating Work Done

Values of F and S given as input from the command terminal

Stop Time given for the model was 5 sec.

Results: Total Work Done: 15740 J, the display1 also shows the work at each position of tool traversal

2. Solving the Equation and Storing the results to a file

The equation to be solved: z=3x2-5y+18

The following blocks were used to create the mpdel

  1. Constant
  2. Square
  3. Product
  4. Subtract
  5. Add
  6. Scope
  7. ToFile

Model:

The following input Values of x & y provided at the command window

The simulation was run with a stop time of 5 sec and results in the model fig. were displayed. These results were also diverted to the 'ToFile' block to save in a file name Z_values

Z_values.mat was open in matlab to check the values

Result: Both the values of z i.e., the one displayed and the ones stored in the file matched

3. Mass Spring Damper comparison on Simulink & Simscape

The ssc_mass_spring_damper_sl model was opened from the examples and saved in a different location for the analysis

Model

Some of the default values for both models were

m=3.6 kg

x0=1 m

k=400

b=10

Derivation of the governing equation

Mass Spring Damper Setup

Free Body Diagram of Mass m

`sum F= m*(d^2x)/dt^2`

or `-k*x-b*x'=m*(d^2x)/dt^2`

=`-k.x-b.(dx/dt)=m*(d^2x)/dt^2`

=`m*(d^2x)/dt^2+b.(dx/dt)+k*x=0` This is the governing equation for the mass-spring-damper system

solving the above equation we get

= `x=x_0e^(-(b*t)/(2m))cos(omega't+phi)`

where `x_0` is the initial postion of the mass and `x`is the position of the mass at any given time t

and `omega'= [(k/m)-(b/(2*m))^2]^-(1/2)`

Fig: Modified Model with Separate Displays for Simscape and Simulink

For providing different values of mass, stiffness and damping coefficient to both the models, in the simscape model the variable of stiffness in the spring block was changed from k to k_ss, in the mass block from m to m_ss and in the damper block,the damping coefficient b to b_ss

From the command terminal the following values were entered and in the simulink model the value of x0 was changed to 2m (no change to x0 were made in simscale model)

Inputs

The simulation was run with a stop time of 5 sec and the following results were obtained from each scopes

Fig: Simscale Results

Fig: Simulink Results

Results: In the simscape model the mass, stiffness and damping coefficient were increase, thus the oscillation stopped completely before 5seconds, but in the simulink model the mass was decreased and the initial position of x0 was increase, so the oscilltions did not completely stop in 5sec

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.