## 3 Vibration Analysis
### Solution of Equations  
Vibration analysis was conducted to determine the mass displacements in the system. This provides an understanding of how the internal components are affected by the external forcing conditions. To obtain the linear or angular displacement values from the above equations, MATLAB was utilized. First, the equations were rearranged in the following form (Equation (2) has been changed to the following form, for example.)  
\[\ddot{z}_{1}=\frac{-k_{2}\big{(}z_{1}-z_{3}-l_{1}\theta_{b,x}\big{)}-k_{3}z_{1 }-k_{6}\big{(}z_{1}-z_{2}+l_{2}\theta_{b,x}\big{)}}{M_{1}} \tag{27}\]  
After the double integration of the above equation, linear displacement of the projection unit along the \(z\)-axis can be obtained. The Simulink model for this equation is shown below in Figure 9.  
All the terms were added and divided by the mass, and then two integration blocks were used to obtain the displacement. For the other equations, models were developed and solved to determine the response of the system. Because the system is coupled, the output of one equation affects other linked equations. A small change in variables, such as mass or stiffness, at one point can alter the solution of some other blocks.  
In the case of angular displacement, mass \(M\) was replaced by the angular moment of inertia \(J\) and linear displacement by \(\theta\). The equation used to develop Simulink model for the rotation is expressed as follows (Equation (25) has been changed to the following form, for example.).  
\[\ddot{\theta}_{e,z}=\frac{+k_{18}(x_{4}+l_{6}\theta_{e,z})l_{6}+k_{15}(x_{4}-x _{3}+l_{8}\theta_{e,z})l_{8}+k_{20}(y_{4}+l_{7}\theta_{e,z})l_{7}+k_{10}(y_{4} -y_{2}+l_{7}\theta_{e,z})l_{7}}{J_{4}} \tag{28}\]  
Figure 8: Input data for case II: (**a**) acceleration data; (**b**) excitation force.  
After the equation is integrated twice, the value of the angle of rotation is obtained for the housing at point e, about the \(z\)-axis. All the equations of rotation were simulated the same way as above, and angles of rotation were obtained.  
Developing the GUI  
A GUI is an application of MATLAB used to develop a user-friendly solution environment. It is very convenient for solving a system when the input variables need to be varied for analysis. For the headlamp assembly, the developed Simulink model was linked with the GUIDE (Graphical User Interface Development) application to create the GUI. Force transmission plots were added in the \".fig\" file. Several variables, such as mass, length, stiffness, and moment of inertia were also added (see Table 1). Stiffness magnitudes values used in the GUI ranged from 15,000-18,000 \(N/m\). These can be varied and any required value can be used to run the solution. Angular moments of inertia were calculated by assuming each body as a sphere. A time function is included in the GUI, which can be utilized to alter the solution time of the model. When the \"Simulate & Plot\" button (Figure 10) is pressed, Simulink runs the solution and plots the results on the GUI. All variables shown on the interface can be varied with just one click, and system can be solved again. The developed GUI is demonstrated below.  
Figure 9: Simulink model for force transmission.