Challenge in Simulink
AIM:
- Determine the work done as the cutting tool of a shaping machine varies over the length of the cut as it moves through a distance of 100mm.
- Create two array data set x= [22 3 55.6 9 12 10] and y= [5 31 95 56.3 77 61] from the command window and create a Simulink model to implement the equation z=3x^2-5y+18 and store results values to File block.
- Solve ‘mass-Spring-Damper in Simulink and Simscape ’ model
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 Massx0=2 in the Simulink model and plot the results.
Make the response from Simscape and Simulink as two separate displays.
Description For Q1:
The force on a cutting tool of a shaping machine varies over the length of the cut as follows
Distance(mm) 0 20 40 60 80 100
Force(KN) 60 72 65 53 44 50
Work done as the tool moves through a distance of 100mm, W=`int_0 ^100F*x dx`
Using signal builder block we have generated a signal in which force acting on tool and position of the tool are taken as input. Force has taken in y-axis and position in the x-axis and is integrated the values using Integrator block. The output we get is work done by the tool on the workpiece and is represented in a graph that we can visualize using scope block. The area under this curve gives the Work done by the cutting tool.
Model:

Input Signal:

Results:

Description for 2Q :
To implement equation Z=3x^2-5y+18 , where x and y are variables. Given the array of data set for variable x=[22 3 55.6 9 12 10] and y=[5 31 95 56.3 77 61]
We need to give the input data set values for x and y in the command window so that the values will be entered into the workspace. Simulink model can access the values from the workspace using constant block. We have taken two blocks and given names as x and y which were already exist in the workspace.



Using square block we square the x values and the output from Square block is connected to gain block with value 3 so that it multiplies the x values with 3 which completes the 3x^2 part. In the same way, we connect gain block with value 5 to y constant block so that the value of y multiplies with 5 which completes the 5y part. We connect constant block with value 18. Now all the expressions are calculated and now the time to do math operations using Add block, which performs +-+ operations with three outputs and displays its values in display block. Finally, we can save this model using the To File block.
Model:

Description for 3Q:
Mass-Spring-Damper in Simulink and Simscape:
Consider a vibrating system in which a mass is suspended from one end of the spiral spring and the other end of which is fixed. A damper is provided between the mass and the rigid support. The fluid in the damper provides resistance which is known as viscous damping. This viscous damping provides resistance to the motion of the body by producing damped vibrations. The amplitude of the resulting vibration gradually diminishes as the energy is dissipated to overcome the frictional resistance.

Let m= Mass suspended from the spring
k=Stiffness of the spring
x=Displacement of the mass from the mean position at time t
`delta` =Static deflection of the spring
b=Damping Coefficient or the damping force per unit velocity
Model:

Assuming the frictional resistance to the motion of the body is directly proportional to the speed of the movement. Damping force or the frictional force on the mass acting in opposite direction to the motion of the mass,
Damping Force,`Fd=b*dx/dt`
Acceleration force on the mass, acting along with the motion of the mass,
Acceleration Force,`F=m*frac{d^2x}{dt^2`
Spring force on the mass, acting in opposite direction to the motion of the mass,
Spring force, `Fs=k*x`
Now the equilibrium law of motion, the equation becomes
Acceleration Force = -(Damping Force+ Spring Force)
`F=-Fs-Fd`
`m* frac{d^2x}{dt^2}=-(b*dx/dt+k.x)`
`frac{d^2x}{dt^2}+b/m*dx/dt+k/m*x=0`
This is a differential equation of the second order. Assuming a solution of the form`x=e^(yt)` where c is a constant to be determined. Now the differential equation reduces to
`y2*e^(yt)+b/m*y.e^(yt)+s/m*e^(yt)=0`
`y^2+b/m*y+k/m=0` This is the governing equation for the mass-spring-damper system.
where `y=frac{-b/mpmsqrt(b/m)^2-4*k/m}{2}`
`y=-b/(2m)pmsqrt((b/(2m))^2-k/m`

The motion of the mass is simple harmonic with damped frequency and amplitude, diminishes exponentially with time.Though the mass eventually returns to iys equilibrium position because of its inertia ,yet it overshoots and the oscillations may take some time to become zero.
When the parameters are the same in both the Simulink and simscape model, the graph we get as both take the same path. This shows either model gives the same result.

- The values of mass, damping coefficient, and spring constant are changed for the simscape model and we can see the difference in the frequency of vibration in the simscape curve.

Values changed are mass=2 kg, spring constant=0.2 N/m and damping coefficient=5 N/m/s
- By changing the value of mass xo=2m in the Simulink model while in simscape the value of xo=1m. The plots of the velocity of mass in both Simulink and simscape models result as shown.


- The response of frequency of vibrations for both the models when the changes are made is displayed in separate displays by giving scope blocks to see individual results.


conclusion:
This concludes the simulink and simscape models give the same results . The difference between these two are the simulink model represents basic mathematical operations using simulink blocks whereas in simscape employs the physical systems approach.