Solution of Damped Spring Vibration Model of Motor Vehicles With MATLAB Application
Solution of Damped Spring Vibration Model of Motor Vehicles With MATLAB Application
Abstract: This study analyzes the application of the Runge Kutte 4 method, Runge Kute Gill, and Milne Method in two-
wheeled motor vehicles. The study results show that: (1) Performance of the Milne Method: The Milne method is effective
for solving damped oscillatory systems with small time steps and provides good results, although with a slight increase in
error compared to the Runge Kutte 4 method. (2) Advantages The Milne method shows more efficiency in the number of
function evaluations per step. It is suitable for applications requiring more significant time steps without requiring
accuracy as high as the Runge Kutte 4 method. (3) Disadvantages The Milne method has lower accuracy than the Runge
Kutte 4 method, especially for small time steps and requires an initial step using another method, adding to the complexity
of the Implementation.
Keywords: Analysis; Runge Kutta; Runge Kutta Gill; Milne Method; Two-Wheeled Motorized Vehicles.
How to Cite: Gilang Nitiasya Fawzi; Yani Ramdani. (2025). Solution of Damped Spring Vibration Model of Motor Vehicles
with MATLAB Application. International Journal of Innovative Science and Research Technology,
10(4), 314-327. https://doi.org/10.38124/ijisrt/25apr256.
I. INTRODUCTION there are resistance factors in the form of air friction and
internal factors that cause the vibrations to decrease over
Motorized vehicles are a means of transportation that time and eventually stop slowly; such vibrations of objects
is very much needed by the community. Comfort and safety are usually referred to as damped harmonic motion [1].
of travel are among the most essential criteria when This phenomenon can be formed in a mathematical model.
choosing a vehicle. High speed demands the vibration-
damping system the most. Thus, motorized vehicles require Mathematics is a deductive science. The concepts in
springs that function as shock absorbers on the road and mathematics are hierarchical, structured, logical, and
wheel vibrations so that they are not directly transmitted to systematic, ranging from the simplest to the most complex
the vehicle body. Springs are components that function to [2]. Mathematics has a vital role in formulating real-life
receive dynamic loads and have elastic properties. Springs problems into a model, such as the problem of vibrations in
are also referred to as flexible objects; they can return to springs. The vibration model in a damped spring is an
their original position even though they have received ordinary differential equation that can be solved using
external force. Vibrations that occur if a load is attached or analytical and numerical methods. An analytical method is
hung to a spring are one example of vibration. a method that can provide actual results (exact solutions)
and solve some mathematical issues. At the same time, the
Vibrations can occur if a system is disturbed from its numerical method is an approach to the exact solution of a
stable equilibrium position. Vibrations in springs are mathematical problem. There are two methods to find
divided into simple harmonic motion and damped harmonic solutions to differential equations numerically: the one-step
motion. Simple harmonic motion is the vibration of an and multistep methods. This paper discusses the solution of
object that occurs continuously, and there are no resistance motor vehicles' damped spring vibration model using the
or damping factors. Simple harmonic motion can also be Runge-Kutta Method, Runge-Kutta Gill Method, and Milne
interpreted as a system that vibrates with a restoring force Method. Runge-Kutta Gill Method is a family of fourth-
directly proportional to its deviation's negative. The order Runge-Kutta methods, which include one-step
restoring force is a force that works in the direction of methods where the next step solution depends on the
returning the mass to its equilibrium position. In reality, previous solution value. Milne Method has many steps that
vibrations in an object will not occur continuously because can be used to find the approximate value of ordinary
You can use the Runge-Kutta method to find the efficient for computer calculations [9]. Several types of
solution to equation (6). The Runge-Kutta method is a Runge-Kutta methods depend on the value of n (order) used.
method that provides greater accuracy of results and does For example, for called the first-order Runge-Kutta
not require derivatives of a function. The general form of method, also called the Euler method, which is obtained
the Runge-Kutta method is equation (7) from equation (9)
(7)
(11)
With
With
With
And
for m = 67,6 kg, c = 532,8 Ns/m, and k = 9102,46 N/m For initial requirements of so that ,
be obtained, and the first derivative of (17) is
(16)
For , and 0,0118, then the From equation (18), the graph shown in Figure 3 is
specific solution has the form. obtained.
Fig 4: Error Graph against Exact Solution of Runge Kutta Gill Method
Script MATLAB Metode Runge Kutta Gill v(i+1) = v(i) + (1/6) * (l1 + l4) + (1/3) * (s * l2 + u_
function [t, x, v] = rukg(g, t0, x0, v0, h, n) coefficient * l3);
% Initialize vectors t, x, dan v
t = zeros(n+1, 1); % Update t value
x = zeros(n+1, 1); t(i+1) = t(i) + h;
v = zeros(n+1, 1); end
x_exact = (exp(-
% Set initial condition 3.940828402*t)).*(0.02*cos(10.91428636*t) +
t(1) = t0; 0.0118*sin(10.91428636*t));
x(1) = x0;
v(1) = v0; % Calculating error
error = abs(x - x_exact)
% Calculate constants r, s, t, dan u
r = (sqrt(2) - 1) / 2; figure;
s = (2 - sqrt(2)) / 2; plot(t, error);
t_koefisien = -sqrt(2) / 2; xlabel('Time(t)');
u_koefisien = 1 + sqrt(2) / 2; ylabel('Error');
title('Error to exact solution');
% Runge-Kutta-Gill Iterations end
for i = 1:n
% Calculates k1 and l1 Command Window untuk menjalankan script
k1 = h * v(i); k = 9102.46;
l1 = h * g(t(i), x(i), v(i)); m = 67.6;
c = 532.8;
% Calculates k2 and l2 g = @(t, x, v) -k/m*x - c/m*v;
k2 = h * (v(i) + 0.5 * l1); t0 = 0;
l2 = h * g(t(i) + 0.5 * h, x(i) + 0.5 * k1, v(i) + 0.5 * l1); x0 = 0.02;
v0 = 0.05;
% Calculates k3 and l3 h = 0.05; % steps
k3 = h * (v(i) + 0.5 * l2); n = 100; % number of iteration
l3 = h * g(t(i) + 0.5 * h, x(i) + r * k1 + s * k2, v(i) + 0.5 [t, x, v] = rukg(g, t0, x0, v0, h, n);
* l2); % Displaying results
disp('Numeric result:')
% Calculates k4 and l4 disp('--------------------------------')
k4 = h * (v(i) + 0.5 * l3); disp(' t x v ')
l4 = h * g(t(i) + h, x(i) + t_coefficient * k2 + u_ disp('--------------------------------')
coefficient * k3, v(i) + 0.5 * l3); disp([t, x, v])
figure;
% Update x dan v values using the Runge-Kutta-Gill subplot(2, 1, 1);
formula plot(t, x);
x(i+1) = x(i) + (1/6) * (k1 + k4) + (1/3) * (s * k2 + u_ xlabel('Time(t)');
coefficient * k3); ylabel('Position(x)');
Based on Figure 7, Figure 8, and Figure 9, it can be allows long-term system analysis without significant error
seen that the spring oscillates and reaches equilibrium at accumulation. In general, RK4 successfully solves the
time t = 1.65. It stretches maximally at x = 0.02 for position differential equations of the damped oscillatory system with
x versus time and at 0.0557 for velocity v versus time and consistent and accurate results. The position and velocity
has the most significant error of 0.7011. Compared to the graphs show how the system energy is dissipated due to
Runge-Kutta-Gill method, RK4 is more accurate for this damping. The error in the exact solution is small, which
system because it has more local minor mistakes than RK- shows the reliability of the RK4 numerical method for this
Gill. RK4 is more stable for time steps h = 0.05, which physical system.
% Calculates k4 and l4
k4 = h * (v(i) + 0.5 * l3);
l4 = h * g(t(i) + h, x(i) + k3, v(i) + 0.5 * l3);
The next stage is to correct equation (16) as in
equation (15). So that we obtain % Updates x dan v values
x(i+1) = x(i) + (k1 + 2*k2 + 2*k3 + k4) / 6;
v(i+1) = v(i) + (l1 + 2*l2 + 2*l3 + l4) / 6;
% Updates t value
t(i+1) = t(i) + h;
end
for i = 4:n
Based on the provisions of the Milne method that have % Calculates approximate values using the Milne
been described, a Matlab program will be created from the method
Milne method, which aims to obtain the results of each x_pred = x(i-3) + 4*h/3 * (2*v(i-2) - v(i-1) + 2*v(i));
iteration in the form of a table so that further analysis can v_pred = v(i-3) + 4*h/3 * (2*g(t(i-2), x(i-2), v(i-2)) -
be carried out and produce a graph that can provide a (g(t(i-1), x(i-1), v(i-1))) + (2*g(t(i), x(i), v(i))));
clearer picture. This program will create a graph in the form
of (1) Error against the exact solution, (2) Position x(t) % Calculates the correction value using the Milne
against time, and (3) Velocity v(t) against time. method
x_corr = x(i-1) + h/3 * (v(i-1) + 4*v(i) + v_pred);
The simulation results on the unique equation (18) v_corr = v(i-1) + h/3 * (g(t(i-1), x(i-1), v(i-1)) +
obtained three result graphs from the Milne method 4*g(t(i), x(i), v(i)) + g(t(i+1), x_pred, v_pred));
simulation: (1) Error Graph against Time: This shows the
absolute difference between the numerical solution and the % Updates x and v values
exact solution. This graph provides an overview of how x(i+1) = x_corr;
accurate the Milne method is in solving ordinary v(i+1) = v_corr;
differential equations: (2) Position Graph against Time:
Shows the change in system position (x) over time. The % Updates t value
position oscillates with damping, as expected for a damped t(i+1) = t(i) + h;
spring system; and (3) Velocity Graph against Time: This end
shows the change in system velocity (v) over time, which x_exact = (exp(-
also oscillates with reduced amplitude due to damping. The 3.940828402*t)).*(0.02*cos(10.91428636*t) +
graphs are presented in Figure 10, Figure 11, and Figure 12. 0.0118*sin(10.91428636*t));
The MATLAB script for the Milne method is as follows.
% Calculating error
Script MATLAB Metode Milne error = abs(x - x_exact)
function [t, x, v] = milneMethod(g, t0, x0, v0, h, n)
% Initializes vectors t, x, dan v figure;
t = zeros(n+1, 1); plot(t, error);
x = zeros(n+1, 1); xlabel('Time(t)');
v = zeros(n+1, 1); ylabel('Error');
title('Error Towards Exact Solution');
% Set the initial condition end
t(1) = t0;
x(1) = x0; Here is the Command Window to run the script
v(1) = v0;
k = 9102.46;
for i = 1:3 m = 67.6;