Work done by a cutting tool, Function modeling and Mass-Spring-Damper in Simulink and Simscape.
1 . AIM:
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
To determine the work done as the tool moves through a distance of 100 mm.
SIMULINK MODEL:

DESCRIPTION:
Workdone: Work is done when a force that is applied to an object moves that object.
The work is calculated by multiplying the force by the amount of movement of an object.
W = F*d.
where , w = workdone
F = force
d = distance .
Input to repeating sequence: In repeating sequence block the distance values are given as time values and force values are given as output values.
Time values : distance = [ 0 20 40 60 80 100]
Output values : Force = [60 72 65 53 44 50]
Integrator: The integrator block outputs the value of the integral of its input signal with respect to time.
2 . AIM :
To create a Simulink model to implement equation z=3x2-5y+18 and store result values using To File block.
OBJECTIVE :
To 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.
INPUT :
In MATLAB we have created arrays x and y to implement equation z=3x2-5y+18.

SIMULINK MODEL :

Implementing z=3x2-5y+18 equation using simulink model.
For making 3x.^2 we have multiplied x with a square block.
Gain block : The Gain block generates its output by multiplying its input by a specified gain factor. You can enter the gain as a numeric value, or as a variable or expression in the Gain parameter field.
The gain multiplies the input value by a constant value.We have given gain input value as 3.Now, it multiplies by x.^2 and becomes 3x.^2.
Similarly, another gain block is used for 5y.
The value 18 is given to a constant block. Now all these three values are given to a add block.We have changed the inputs of add block to 3 values(+,-,+).
Finally the obtained results are given to a To File block. We have named it as "output".
Inside the "output" file we can see the values of z.
OUTPUT :
Output of z values in workspace.

3 . AIM:
To open the simulink model 'Mass-Spring-Damper in Simulink and Simscape’ and solve the following problems:
- Derive the governing equation for the model.
- 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.
- Make the response from Simscape and Simulink as two separate displays.
SIMULINK MODEL:

Governing equation for the model :
The governing equation for mass-spring-damper system is

m = mass
b = damping factor
k = spring constant
x = displacement
dx/dt = velocity
dx^2/dt^2 = acceleration
2 . Change the value of x0 = 2 in simulink model:

Values of mass, damper, spring and initial condition (x0)

Result for mass-spring-damper system in simulink model:

Change the values of mass, damper , spring for the simscape model:

Values of mass,damper and spring for the simscape model:

Result for mass-spring-damper system in simscape model:
