Professional Documents
Culture Documents
Report With Contents Page
Report With Contents Page
Report With Contents Page
Table of Contents
1) Introduction: ............................................................................................................................................. 1
2) Theory:...................................................................................................................................................... 2
Characterizing the motion: ........................................................................................................................ 2
Detecting contact: ..................................................................................................................................... 2
Two cases of contact: ................................................................................................................................ 3
Contact resolution: .................................................................................................................................... 3
Finding Time of Impact: ........................................................................................................................... 4
Code Verification:..................................................................................................................................... 4
Angles vs Time: .................................................................................................................................... 4
Phase portrait: ....................................................................................................................................... 5
Trajectory: ............................................................................................................................................. 6
Energy vs time graph: ........................................................................................................................... 6
Input Data for original MATLAB CODE: ............................................................................................ 7
3) Study and Results: .................................................................................................................................... 8
4) New Observation: ................................................................................................................................... 11
5) Conclusion: ............................................................................................................................................. 13
6) Appendix ................................................................................................................................................ 14
MATLAB Code: ..................................................................................................................................... 14
Page # 0
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Computing Project 4
Impact
1) Introduction:
Fourth computing project is known as Impact. This project is about the model of two bars which
will swing freely around their hinges. They may have positions close to each other to contact
with each other. When they will have contact with each other then they will definitely lose some
energy and they will in contact with each other and this will be according to law of conversation
of momentum.
Figure number 1 shows the bars which will contact with each other again and again. Rod’s
motion’s equation can be derived from conservation of energy. It can also taken from angular
momentum balance. The equation which we will get after this process will be like simple
pendulum equations. We should account for impact in this problem. Therefore, we will stand in
need to do phase-II analysis of the system. We suppose the ideal condition (contact is
frictionless) so the force of contact is normal to surface of contact. We will suppose that this
system will have a restitution coefficient that is supposed to be the ratio of impulse throughout
recovery to the impulse throughout deformation.
Contact between two physical forms of creature, can be a big reason for concern as forces grown
can be substantial and contact can give us outcome to damage to both physical forms of creature.
Page # 1
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
2) Theory:
Characterizing the motion:
We will track through two angles which are 𝛳1 and 𝛳2 . The equation of motion through two
angles will become,
𝑊1 𝐿21 𝑑 2 𝛳1 𝑊1 𝐿1 𝑠𝑖𝑛𝛳1
+ = 0 For Bar 1
𝑔𝑑𝐿2 2
𝑊2 𝐿22 𝑑 2 𝛳2 𝑊2 𝐿2 𝑠𝑖𝑛𝛳2
+ = 0 For Bar 2
𝑔𝑑𝐿2 2
Most of time will use these equations. For instant times we will have contact. By numerical
integration we will find the solution of these equations. We will need to detect and solve the
contact problem when it happens.
Detecting contact:
For detecting the contact we will create the vector for hinge A to the tip of Bar 2. Now we can
compute those as,
Page # 2
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
If the first one which is for Bar 2 will be positive then contact must have taken during time step.
If we will take the computation for projections then we will get the conditions,
2
(𝑋𝑛2 + 𝑐). 𝑛1𝑛 > L1 and (𝑋𝑛+1 + 𝑐). 𝑛1𝑛+1 > L1
Contact will not happen in the result of upper equation so we will do out test now with additional
condition which will be as,
2
0 < (𝑋𝑛+1 + 𝑐). 𝑛1𝑛+1 < L1
2
0 < (𝑋𝑛+1 − 𝑐). 𝑛1𝑛+1 < L2
Contact resolution:
End results of both the cases can be explained as, for Case 1,
𝐿1 cos(𝛳2 − 𝛳1 ) −𝑧2 𝛳 .+
[ 𝑊2 ] { 1. + } =
𝑧2 𝐿1 /𝐿2 (𝑊 ) 𝐿2 cos(𝛳2 − 𝛳1 ) 𝛳2
1
−𝑒𝐿1 cos(𝛳2 − 𝛳1 ) 𝑒𝑧2 𝛳 .−
[ 𝑊2 ] { 1. − }
𝑧2 𝐿1 /𝐿2 ( ) 𝐿2 cos(𝛳2 − 𝛳1 ) 𝛳2
𝑊1
Page # 3
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
So, now we will find time, position, velocity and acceleration of contact as,
tcontact = (1- ξ)told + ξtnew
xcontact = (1- ξ)xold + ξxnew
vcontact = (1- ξ)vold + ξvnew
acontact = (1- ξ)aold + ξanew
This linear interpolation is not exact but it will provide good results.
Code Verification:
For code verification part we have four plots which we have got as Angles vs Time, Phase
Portrait, Trajectory and Total energy of the system. We saw that our code is correct according to
the requirement of the benchmark file. We enter the same data in our code as we were asked to
enter in benchmark file. We match all results with the default given benchmark file and results
are matching as a whole. Here we attached the plots which we have got as the result of
simulation of MATLAB code of our project.
Angles vs Time:
We have done with this graph by plotting between Angles and Time. t is taken on x-axis and ϴ is
taken on y-axis. We may compare both real and benchmark files by putting side by side both
plots as,
Page # 4
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Phase portrait:
We have four plots in this MATLAB Project. So, we will compare all files which we have got
from our MATLAB CODE and default benchmark file. Now compare phase portrait plotas,
Page # 5
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
We may see by comparing figures 3a and 3b that they are giving us same results with same color
of both (MATLAB and benchmark) plots. Hence phase portrait confirmation has been done!!
Trajectory:
We got a graph by plotting MATLAB trajectory of this project. We can see clearly that both bars
will come near to each other and they are experiencing a contact at a point. The trajectory for
both bars can be plotted by given data on benchmark input data file. So we have got trajectory
plot as,
Page # 6
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Fig. 5a MATLAB total energy plot Fig. 5b Benchmark total energy plot
In the upper given graph blue is kinetic energy, red is potential energy and black is the sum of
kinetic plus potential. We compare the variation in energy by seeing the plots.
Page # 7
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
We can explore our problem with the changing values of inputs (Length etc.) We will not get a
blind mark which will able to plot graphs but for different values plots will also be changes. If
we reduce the Length of bar 2 to 6 then we can put the values in the formulas with the help of
our MATLAB simulations and will be able to know that plots will also be changed. So, we are
now changing the physical property (Length) of bar 2 and now in integration of equations we
will change the value of final time from 10 to 30. Number o of time step and number of steps to
Page # 8
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Now if we will see plots we plotted with the help of blind mark code. First in Angles vs Time
graph we can see clearly in plot shown below in fig. 6 that frequency is increased and angle ϴ’s
span has also been changed.
Page # 9
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Now we are coming forward to analyze change in phase portrait. We can observe by seeing
blind-mark plot shown in fig. 7 and MATLAB original plot shown in figure 3a that phase
compact is experiencing a compact in it and shape of phase portrait is shown is figure below as,
Page # 10
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
If we will compare fig. 9 and fig 5a then we will find a change is energies both (potential and
kinetic). So, total energy (Kinetic energy + Potential energy) will also be changed. Hence by
seeing at both the plots we may observe that now all energies are being changed.
In upper plot Blue color is showing the kinetic energy while red color is showing potential
energy and black one is showing the total energy of the system.
4) New Observation:
We have done with the new observation to check that this code is working for another problem
too. We have changed the values of some constants and got the new plots. We have reduced the
length of bar 1 from 10 to 5 and another change we have made is that we have reduced the
weight of bar 1 from 10 to 5. All other parameters remain same. We have got some new plots
from new observation, which are showing that code is also working for another problem. We
Page # 11
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
𝑙
T = 2π.(𝑔)1/2
T ∞ (𝑙)1/2
Fig. 10 New obs. Angles vs Time plot Fig. 11 New obs. phase portrait plot
Fig. 12 New obs. Trajectory plot Fig. 13 New obs. total energy plot
Page # 12
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 13
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 14
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 15
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 16
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 17
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 18
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 19
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 20
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 21
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 22
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 23
CEE 212 Fall 2016 Impact
School of Sustainable Engineering and The Built Environment
Page # 24