MATLAB GUI based code for acceleration analysis in learning of kinematics

In this study, a code or computer program has been developed as an educational material for courses on kinematics. This code is expected to help the learning of kinematic which mostly uses analysis of velocity and acceleration graphically. By using this code, explanation of velocity and acceleration analysis can be performed by the code/computer program, instead of using the ruler and protractor manually. This eases the teacher and student in learning of kinematic. The code is written based on MATLAB. GUI (Graphical User Interface) is used to make this code as a user friendly kinematic learning media. The calculation of velocity and acceleration is performed based on the method of relative velocity and relative acceleration. This code provides tutorial of velocity and acceleration analysis which is displayed in the GUI screen. The animation of movement and its trajectory is also displayed. In this present research work, acceleration analysis on slider crank mechanism created by the code is presented. The results is compared with the theoritical calculation and the differences are less than 1%. Therefore, the code is considered acceptable and feasible to enrich the learning experience in kinematics.


Introduction
In mechanical engineering, kinematic is a subject that provides a knowledge about mechanism's motion without consider the cause of motion.For analysis of kinematic, the method of relative velocity and relative acceleration are the widely used method.This method requires graphically vector drawing which is normally perfomed by using a ruler, protractor etc.In explaining the kinematic concept in the classroom, process of manually vector drawing consumes much time.The delivering of concept is not efficient and it is not easy to understand by the students.In order to achieve an efficient learning process, it is required a learning media that can replace the process of manually vector drawing and deliver the concept in easy way.
MATLAB is a software which is widely used in engineering for programming, visualization of computer graphic, numerical data analysis, simulation, signal processing and modeling.Recently, it is widely used as an efficient media to support the learning process in academic institutions.Many studies use MATLAB as a part of learning process.In learning of the Finite Element, a computer model is made by using MATLAB [1].The results show that this computer model increases programming's skills of the students.To stimulate critical thinking and problem-solving of the students, in Engineering Analysis Course, MATLAB code is used by Rahemi and LaVergne [2].For facilitating student in learning Power System Harmonic Studies, Chang et.al [3] develop education oriented software with GUI.Gourde and Kumgeh [4] presents a computer program in learning of thermodynamic for determination of thermodynamic properties of steam.In subject of Power System Analysis, in Department of Electrical Education, Koç and Aydoğmuş [5] develop an educational media based on MATLAB/GUI.This tool is used to determine the short circuit fault in lines of power transmission.In the course of Vibration and Control, Liu [6] use MATLAB/Simulink as a part of vibration learning, to enable comparison of experimental result with computational result in vibration analysis.This MATLAB integration increase students's capability in programming and analyzing of dynamic system response.Pena et.al [7] employ MATLAB simscape GUI program in subject of Mechanical Vibration and Control.The program is developed to support the online learning.The program provides dynamic system model and control.MATLAB SimMechanics is used in teaching of Robotics by Hussain et.al [8].They found that by using MATLAB, the students have a better understanding in analyzing of robot compared to the conventional teaching method.This study aims to develop a learning media that can be used in kinematic course.The media is expected to provide the tutorial in analysis of velocity and acceleration.This analysis involves mathematical computation, vector drawing dan measurement of vector line.MATLAB code is chosen as a tool to create this learning media as MATLAB has a good capability in programming, computation and graphic visualization.GUI is used to make this code as a user friendly kinematic learning media.Graphical User Interface (GUI) is a type of user interface that uses a method of interaction on an electronic device graphically (not text commands) between the user and the computer.The goal of using a GUI is to make programs look simpler and more practical for end-users.
In the previous study, MATLAB's utilization for analysis of velocity on slider crank mechanism is already discussed [9].As the kinematic analysis involves both velocity and acceleration analysis, in the present study, the use of MATLAB based code for analysis of acceleration on slider crank mechanism is presented.

The analysis of acceleration on mechanism of slider crank
The slider crank can be seen in Figure 1(a).The acceleration analysis is explained as follows: The acceleration of A (  ) is calculated by using ( 1) 2 is normal acceleration (   ) and  2 is tangential acceleration (   ).Since R and  2 are known,    may be calculated.The direction of    is along the line O2A and is directed from A to O2.Since  2 is zero because  2 is constant,  2 = 0.The relation of accelerations is expressed by

Methodology
MATLAB is used to write a code for analysis of acceleration on slider crank.A code or computer program is designed to allow the users vary the magnitude of several input variables namely link angle, angular velocity and acceleration.GUI MATLAB is employed to facilitate this interactive learning.The computer program will calculate and shows the steps of acceleration analysis graphically and the calculation procedure.The results of linear and angular acceleration of other links will also be displayed.Figure 2 shows the flowchart of the program.

Figure 2. Code flowchart
First, the user gives data of input variables.Based on this data, the code compute velocity of point A and B (see Figure 1 and Figure 3).Next, the code compute acceleration of point A, B and angular acceleration of link 3. The codes will display the value of output variables, the way how to obtain those values, steps of mathematical operation and vector drawing.In general, implementation of relative velocity and acceleration in code is performed by creating the line of vectors, sum the vectors graphically based on the equation ( 1) to ( 5) and measure the length of vector line which represent the magnitude of the vectors.

Results and Discussion
Figure 3 shows results of executed code (example output of the code).In the Input section, the users give data of the slope of link 2, data of the angular velocity, data of angular acceleration.The users click 'Hitung' and the MATLAB code computes and shows output variables namely VA, VB, VC, ω3, AA, AB, α 3 .The slope of slider crank (link 2) is created based on the input angle.The code will show the tutorial of graphically vectors drawing and calculation procedure for every steps.On the right side of window, there is animation, trajectory and graph of position.The following figures display example output of the code for for acceleration analysis.The steps in acceleration vector drawing as follows 1. Drawing of    , which is directed from A to O2, along the line O2A.Equation ( 1) is used to compute    .
2. Drawing of    , which is perpendicular to line O2A, in the same direction with angular acceleration.Equation ( 1) is used to compute    .Vector   is obtained by summation of vector    and    graphically.
3. Drawing of    , which is along of line BA, from B to A. Equation ( 4) is used to compute    4. Drawing of line of vector    which is perpendicular of line BA.The magnitude is still unknown.5. Drawing of line of vector   which is along the direction slider B. The magnitude is still unknown.6. Drawing the direction of vector    and   .Measure the length of those lines to obtain the magnitude of the vectors.
For validation of the MATLAB program, the program is run with the given input as follows :  2 = 1000 ,  2 =5000 rad/s 2 , angle of link 2 45 0 , direction of  2 is clockwise (cw) and direction of  2 is counter clockwise (ccw).The results for acceleration analysis (  ,   ,  3 ) is compared with the theoritical calculation.They are shown in Tabel 1.It can be seen that the differences are smaller than 1%.Hence the MATLAB code for acceleration analysis on slider crank mechanism is considered acceptable and feasible to use as educational tool.The complete acceleration vector diagram resulted from the MATLAB code is provided in Figure 6, while the acceleration vector diagram manually is shown in Figure 7.It is seen that both the vectors diagrams are similar.By using this code, learning of kinematic will be more efficient.As the code is written with MATLAB, the code can be used if MATLAB is already installed in the computer.In the future, development of the code can be done by adding module of the code for other mechanism which is more complicated.

Conclussion
MATLAB GUI based code is developed for analysis of acceleration on slider crank.The code provides the calculation procedure for acceleration analysis.Validation shows that the difference of the results of MATLAB code with manual calculation is less than 1%.Therefore this MATLAB code is considered acceptable and feasible to use in the course of kinematics.

Figure 1 .
Figure1.Slider crank mechanism and its acceleration diagram vector[10] Start Input : angular velocity link 2, link angle Output : tutorials of graphically vectors drawing, mathematical procedure, motion of mechanism, trajectory Compute linear velocity of A, B and angular velocity link 3 End Compute linear acceleration of A, B and angular acceleration link 3

Figure 3 .
Figure 3. Main window for slider crank mechanism

Figure 6 .Figure 7 .
Figure 6.Display of the computer program for case of validation

Tabel 1
Comparison of the results of MATLAB program with theoritical calculation