Project

Simulink-Integrator, To file, Array input

Objective

  1. Use integrator to find the work done by the cutting tool
  2. Use array dat from workspace to evaluate a function and store the results to a file using To file block
  3. Study the effect of changing the values of variables in command window using the Mass-Spring-Damper in Simulink and Simscape example m model

1.WORK DONE BY THE CUTTING TOOL

The force on a cutting tool of a shaping machine varies over the length of cut as follows:

Distance (mm) 0 20 40 60 80 100

Force (kN) 60 72 65 53 44 50

Determine the work done as the tool moves through a distance of 100 mm.

Simulink model

Input:

working:

  • signal builder is used to convert the given force vs distance data into the above shown signal data.
  • Area under the above curve upto distance 'x' give the work done by the tool as it moves a distance of 'x' mm.
  • work done by the tool is plotted as shown below

Result:

From the graph and display in simulink model total work done by the cutting tool as it move 100mm is 5.78 kNmm or 5780 Nm

2.'To File' BLOCK:

Create two array data sets x = [22 3 55.6 9 12 10] and y = [5 31 95 56.3 77 61] from the command window. Create a Simulink model to implement equation z=3x2-5y+18 Store result values using To File block.

simulink model

Input:

given variables X and y are created in the workspace a shown below

Working:

simulink model reads the values from the array in model workspace and evaluates the function values and saves them in the file 'z.mat' using to file block.

Result:

File saved in harddisk in the working directory

Values of the function z=3x2-5y+18 stored in the file 'z.mat'

value of Z displayed in display block in simulink

3.STUDY the GIVEN MODEL AND CHANGE ITS VARIABLES IN WORKSPCACE

‘Mass-Spring-Damper in Simulink and Simscape’. Open the model and solve 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.

Simulink model:

1.Derive the governing equation for the model

from the simulink model it can be derived as follows

where a=d2x/dt2 and v=dx/dt and x0=1.

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.

output form the model given

it can be seen from below graph that output from simulink nand simscape are same

output after changing the values of mass,damper,spring fro simscape model in model workspace.

changing the values of b,k,m in worksapce changes values in both simulink model and simscape model since they both share common variabels. so to change the value only in simscape model we have to declare a different varaible and assign them to the model.

changing value of x0=2 in simulink model

changing the value of x0 increases the amplitude but the frequency remains the same. fro both x0=1 and x0=2.

3.Make the response from Simscape and Simulink as two separate displays.

response can be displayed in two seperate window by any of the below methods

a.changing the layout of the scope block and remove the mux block( result shown below)

b.using two different scope blocks for each model

Conclusion:

Integrator and To file blocks are stuided and effect of changing the values of variabels in workspace is also studied.

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.