Analysis of the coefficient of friction on ice
The article is a comprehensive example of the processing and analysis of experimental data in the Engee environment. Using a specific example of studying the dependence of the coefficient of friction on temperature, we demonstrate the full cycle of working with data: from their statistical description to building interactive visualizations and formulating practical recommendations.
The central topic of the study is the analysis of the behavior of the coefficient of friction for two fundamentally different cases: the friction of ice for pedestrians and the friction of a car tire on ice. The temperature range from +5°C to -80°C is considered, which covers most of the climatic conditions encountered in practice.
Through this analysis, we demonstrate how modern data processing tools make it possible not only to state facts, but also to predict the behavior of a system in various conditions, which is a key skill in any scientific and technical activity.
Now let's move on to the example itself and consider the libraries used in it.
StatsBase is a library for basic statistical data processing. In our example, it is used to calculate statistical indicators (mean, standard deviation, median, quantiles) of friction coefficients, as well as to calculate the correlation between data for pedestrians and drivers.
Interpolations is a library for data interpolation. We use it to create smooth curves based on discrete experimental points, which allows us to better visualize trends and analyze derivatives (rates of change in the coefficient of friction).
LaTeXStrings is a library for working with LaTeX formatting in graphs. With its help, we add professional mathematical notations to the axis signatures, such as μ (coefficient of friction) with indexes for different types of surfaces, which increases the readability and scientific rigor of visualizations.
Pkg.add("Interpolations")
using StatsBase, Interpolations, LaTeXStrings
The temperature range from -80°C to +5°C with a discreteness of 5°C is used as the initial data.
Arrays μ_ice and μ_tire They contain experimental values of friction coefficients for two cases: ice-on-ice friction (pedestrian model) and car tire-on-ice friction.
Threshold constants HIGH_RISK_PEDESTRIAN, LOW_RISK_PEDESTRIAN, HIGH_RISK_DRIVER and LOW_RISK_DRIVER define the boundaries between high, medium and low risk levels for the respective categories of road users.
temperatures = collect(-80.0:5.0:5.0)
μ_ice = [
0.091, 0.09, 0.089, 0.087, 0.085, 0.082, 0.08, 0.075, 0.07,
0.065, 0.06, 0.055, 0.05, 0.04, 0.035, 0.03, 0.02, 0.005
]
μ_tire = [
0.264, 0.263, 0.262, 0.261, 0.26, 0.258, 0.256, 0.253, 0.25,
0.245, 0.24, 0.235, 0.23, 0.21, 0.19, 0.17, 0.15, 0.08
]
HIGH_RISK_PEDESTRIAN = 0.03
LOW_RISK_PEDESTRIAN = 0.06
HIGH_RISK_DRIVER = 0.18
LOW_RISK_DRIVER = 0.25;
The code below performs statistical analysis and determines critical safety temperatures. First, the main statistical indicators for both types of friction are calculated: mean, standard deviation, minimum, maximum, median and quartiles. Linear interpolation is then applied to create smooth curves based on the experimental points. The find_critical_temp function determines the threshold temperatures at which the coefficient of friction crosses the specified risk levels. The result is specific temperature boundaries separating conditions of high and low danger for pedestrians and drivers.
println("="^50)
println("STATISTICAL ANALYSIS OF FRICTION COEFFICIENTS")
println("="^50)
stats_ice = [
mean(μ_ice), std(μ_ice), minimum(μ_ice), maximum(μ_ice),
median(μ_ice), quantile(μ_ice, 0.25), quantile(μ_ice, 0.75)
]
stats_tire = [
mean(μ_tire), std(μ_tire), minimum(μ_tire), maximum(μ_tire),
median(μ_tire), quantile(μ_tire, 0.25), quantile(μ_tire, 0.75)
]
println("Pedestrians (ice):")
println("Average: $(round(stats_ice[1], digits=4))")
println("Standard. deviation: $(round(stats_ice[2], digits=4))")
println("Minimum: $(stats_ice[3]) at $(temperatures[argmin(µ_ice)])°C")
println("Maximum: $(stats_ice[4]) at $(temperatures[argmax(µ_ice)])°C")
println("Drivers (tire-ice):")
println("Average: $(round(stats_tire[1], digits=4))")
println("Standard. deviation: $(round(stats_tire[2], digits=4))")
println("Minimum: $(stats_tire[3]) at $(temperatures[argmin(µ_tire)])°C")
println("Maximum: $(stats_tire[4]) at $(temperatures[argmax(µ_tire)])°C")
itp_ice = linear_interpolation(temperatures, μ_ice)
itp_tire = linear_interpolation(temperatures, μ_tire)
temp_smooth = range(minimum(temperatures), maximum(temperatures), length=200)
μ_ice_smooth = itp_ice.(temp_smooth)
μ_tire_smooth = itp_tire.(temp_smooth)
function find_critical_temp(temps, μ_vals, threshold)
for i in 1:length(μ_vals)-1
if (μ_vals[i] - threshold) * (μ_vals[i+1] - threshold) <= 0
t1, t2 = temps[i], temps[i+1]
μ1, μ2 = μ_vals[i], μ_vals[i+1]
return t1 + (threshold - μ1) * (t2 - t1) / (μ2 - μ1)
end
end
return NaN
end
crit_ped_high = find_critical_temp(temperatures, μ_ice, HIGH_RISK_PEDESTRIAN)
crit_ped_low = find_critical_temp(temperatures, μ_ice, LOW_RISK_PEDESTRIAN)
crit_drv_high = find_critical_temp(temperatures, μ_tire, HIGH_RISK_DRIVER)
crit_drv_low = find_critical_temp(temperatures, μ_tire, LOW_RISK_DRIVER)
println("\n" * "="^50)
println("CRITICAL SAFETY TEMPERATURES")
println("="^50)
println("Pedestrians:")
println(" High risk (<$HIGH_RISK_PEDESTRIAN): T < $(round(!isnan(crit_ped_high) ? crit_ped_high : minimum(temperatures), digits=1))°C")
println(" Low risk (>$LOW_RISK_PEDESTRIAN): T > $(round(!isnan(crit_ped_low) ? crit_ped_low : maximum(temperatures), digits=1))°C")
println("\nThe leaders:")
println(" High risk (<$HIGH_RISK_DRIVER): T < $(round(!isnan(crit_drv_high) ? crit_drv_high : minimum(temperatures), digits=1))°C")
println(" Low risk (>$LOW_RISK_DRIVER): T > $(round(!isnan(crit_drv_low) ? crit_drv_low : maximum(temperatures), digits=1))°C")
Graph 1 shows the dependence of the coefficient of friction of ice on ice on temperature. The diagram shows the experimental points in the form of circles and the linear interpolation drawn through them in the form of a dotted curve. The horizontal lines in red and green show the thresholds for high and low risk, respectively, and the vertical lines mark the critical temperatures at which the coefficient of friction crosses these thresholds. The grid on the background makes it easier to read the values.
p1 = plot(size=(800, 500), dpi=150, grid=true, gridalpha=0.3)
scatter!(p1, temperatures, μ_ice,
label="Experimental data",
markersize=8, markercolor=:blue, markerstrokewidth=2,
marker=:circle)
plot!(p1, temp_smooth, μ_ice_smooth,
label="Interpolation (linear)",
linewidth=3, linecolor=:blue, alpha=0.7, linestyle=:dash)
hline!(p1, [HIGH_RISK_PEDESTRIAN, LOW_RISK_PEDESTRIAN],
label=["High risk (μ <$HIGH_RISK_PEDESTRIAN)" "Low risk (μ > $LOW_RISK_PEDESTRIAN)"],
linestyle=:dot, linewidth=2, linecolor=[:red :green])
if !isnan(crit_ped_high)
vline!(p1, [crit_ped_high],
label="High-risk boundary: $(round(crit_ped_high, digits=1))°C",
linestyle=:dashdot, linewidth=2, linecolor=:red, alpha=0.7)
end
if !isnan(crit_ped_low)
vline!(p1, [crit_ped_low],
label="Low risk limit: $(round(crit_ped_low, digits=1))°C",
linestyle=:dashdot, linewidth=2, linecolor=:green, alpha=0.7)
end
title!(p1, "Graph 1: Pedestrians - coefficient of friction of ice")
xlabel!(p1, "Temperature, °C")
ylabel!(p1, L"\mu_{ice-ice}")
display(p1)
Analyzing the graph allows us to draw important conclusions about pedestrian safety. There is a clear tendency for the coefficient of friction to increase with decreasing temperature. At temperatures above about -5°C, the coefficient of friction drops below the high-risk threshold, creating dangerous conditions for movement. Safe conditions (low risk) are achieved only with significant cooling below -30°C, which indicates the significant vulnerability of pedestrians in typical winter conditions.
Graph 2 shows the behavior of the coefficient of friction of a car tire on an icy surface as a function of temperature. The experimental data are shown by square markers through which a smooth interpolating curve is drawn. As in the previous graph, the horizontal lines indicate the high and low risk zones for drivers, and the vertical lines correspond to the critical transition temperatures between these zones.
p2 = plot(size=(800, 500), dpi=150, grid=true, gridalpha=0.3)
scatter!(p2, temperatures, μ_tire,
label="Experimental data",
markersize=8, markercolor=:orange, markerstrokewidth=2,
marker=:square)
plot!(p2, temp_smooth, μ_tire_smooth,
label="Interpolation (linear)",
linewidth=3, linecolor=:orange, alpha=0.7, linestyle=:dash)
hline!(p2, [HIGH_RISK_DRIVER, LOW_RISK_DRIVER],
label=["High risk (μ <$HIGH_RISK_DRIVER)" "Low risk (μ > $LOW_RISK_DRIVER)"],
linestyle=:dot, linewidth=2, linecolor=[:red :green])
if !isnan(crit_drv_high)
vline!(p2, [crit_drv_high],
label="High-risk boundary: $(round(crit_drv_high, digits=1))°C",
linestyle=:dashdot, linewidth=2, linecolor=:red, alpha=0.7)
end
if !isnan(crit_drv_low)
vline!(p2, [crit_drv_low],
label="Low risk limit: $(round(crit_drv_low, digits=1))°C",
linestyle=:dashdot, linewidth=2, linecolor=:green, alpha=0.7)
end
title!(p2, "Graph 2: Drivers - coefficient of tire friction on ice")
xlabel!(p2, "Temperature, °C")
ylabel!(p2, L"\mu_{ice tire}")
display(p2)
It follows from the graph that car tires provide significantly better grip on ice compared to soles**.** Even in the most adverse conditions (at positive temperatures), the coefficient of friction of tires remains significantly higher than that of pedestrians. This indicates the relative safety of automobile traffic in moderate frosts, while pedestrians in the same conditions are at high risk.
Graph 3 provides a comparative visualization of the coefficients of friction for pedestrians and drivers in a single coordinate system. The blue line with circles shows the dependence of the coefficient of friction for hiking, the orange line with squares shows a similar dependence for tires on ice. Both curves are based on the same temperature values, which makes it possible to directly compare their behavior.
p3 = plot(size=(800, 500), dpi=150, grid=true, gridalpha=0.3)
plot!(p3, temperatures, μ_ice,
label="Pedestrians",
linewidth=3, color=:blue,
marker=:circle, markersize=6)
plot!(p3, temperatures, μ_tire,
label="Drivers",
linewidth=3, color=:orange,
marker=:square, markersize=6)
title!(p3, "Graph 3: Comparison of friction coefficients")
xlabel!(p3, "Temperature, °C")
ylabel!(p3, "Coefficient of friction, μ")
display(p3)
Graph 4 shows the ratio of the coefficient of friction of a tire on ice to the coefficient of friction of ice for hiking as a function of temperature. The purple line with diamond-shaped markers shows how many times the grip of car tires exceeds the grip of shoe soles at each specific temperature. The black dotted line at level 1.0 indicates a conditional boundary where both types of coupling would be equal.
p4 = plot(size=(800, 500), dpi=150, grid=true, gridalpha=0.3)
ratio = μ_tire ./ μ_ice
plot!(p4, temperatures, ratio,
label="The ratio of m_ leader/m_ pedestrian",
linewidth=3, color=:purple,
marker=:diamond, markersize=7)
hline!(p4, [1.0],
label="Equal coupling (ratio = 1)",
linestyle=:dash, linewidth=2, linecolor=:black, alpha=0.5)
mean_ratio = mean(ratio)
max_ratio = maximum(ratio)
min_ratio = minimum(ratio)
temp_max_ratio = temperatures[argmax(ratio)]
temp_min_ratio = temperatures[argmin(ratio)]
title!(p4, "Graph 4: The advantage of tires over soles")
xlabel!(p4, "Temperature, °C")
ylabel!(p4, "Ratio of friction coefficients")
display(p4)
The analysis of the ratio of friction coefficients reveals an interesting nonlinear relationship. The maximum advantage of tires is observed at temperatures around 5 ° C, where they exceed the sole by more than 15 times. As the temperature decreases further, this advantage gradually decreases, but still remains significant (about 3 times at -80°C). This indicates that car tires not only have the best absolute grip, but also exhibit different temperature sensitivity compared to the sole.
Graph 5 shows the rate of change of the coefficient of friction with respect to temperature, which is the first derivative of the dependence μ(T). The blue and orange lines show how quickly the coefficient of friction changes for pedestrians and drivers, respectively, when the temperature changes by one degree. The values are multiplied by 100 to improve the readability of the graph. The zero horizontal line helps to visually identify the areas of growth and decline of the derivative.
p5 = plot(size=(800, 500), dpi=150, grid=true, gridalpha=0.3)
derivative_ice = diff(μ_ice_smooth) ./ diff(temp_smooth)
derivative_tire = diff(μ_tire_smooth) ./ diff(temp_smooth)
temp_mid = (temp_smooth[1:end-1] .+ temp_smooth[2:end]) ./ 2
plot!(p5, temp_mid, derivative_ice * 100,
label="Pedestrians (ice) ×100",
linewidth=2, color=:blue)
plot!(p5, temp_mid, derivative_tire * 100,
label="Drivers (tire-ice) ×100",
linewidth=2, color=:orange)
hline!(p5, [0.0],
label="Zero change",
linestyle=:dash, linewidth=1, linecolor=:black, alpha=0.3)
max_rate_ice = maximum(derivative_ice) * 100
max_rate_tire = maximum(derivative_tire) * 100
temp_max_rate_ice = temp_mid[argmax(derivative_ice)]
temp_max_rate_tire = temp_mid[argmax(derivative_tire)]
title!(p5, "Graph 5: Rate of change of the coefficient of friction")
xlabel!(p5, "Temperature, °C")
ylabel!(p5, "Rate of change (dm/dT × 100)")
display(p5)
Additional statistics provide a quantitative assessment of the dynamics and relationships in the data. The percentage change in friction coefficients over the entire temperature range is calculated, the correlation between indicators for pedestrians and drivers is calculated, safe temperature ranges are determined, and average values in warm and cold conditions are compared. These metrics complement the visual analysis with numerical characteristics.
println("\n" * "="^50)
println("ADDITIONAL STATISTICS")
println("="^50)
ice_change_pct = (μ_ice[end] - μ_ice[1]) / μ_ice[1] * 100
tire_change_pct = (μ_tire[end] - μ_tire[1]) / μ_tire[1] * 100
println("Change from -80°C to 5°C:")
println(" Pedestrians: $(round(ice_change_pct, digits=1))% (from $(m_ice[1]) to $(m_ice[end]))")
println(" Drivers: $(round(tire_change_pct, digits=1))% (from $(µ_tire[1]) to $(µ_tire[end]))")
correlation = cor(μ_ice, μ_tire)
println("\Correlation between coefficients:")
println(" Pearson correlation coefficient: $(round(correlation, digits=4))")
println(" Interpretation: $(abs(correlation) > 0.8 ? "Очень сильная" :
abs(correlation) > 0.6 ? "Strong" :
abs(correlation) > 0.4 ? "Moderate" : "Weak") связь")
safe_temp_ped = temperatures[μ_ice .>= LOW_RISK_PEDESTRIAN]
safe_temp_drv = temperatures[μ_tire .>= LOW_RISK_DRIVER]
println("Safe temperature ranges:")
if !isempty(safe_temp_ped)
println(" Pedestrians (µ ≥ $LOW_RISK_PEDESTRIAN): from $(minimum(safe_temp_ped))°C to $(maximum(safe_temp_ped))°C")
else
println(" Pedestrians: there are no safe temperatures in the range")
end
if !isempty(safe_temp_drv)
println(" Drivers (µ ≥ $LOW_RISK_DRIVER): from $(minimum(safe_temp_drv))°C to $(maximum(safe_temp_drv))°C")
else
println(" Drivers: there are no safe temperatures in the range")
end
plots = [p1, p2, p3, p4, p5]
plot_names = [
"ice_friction_pedestrians.png",
"ice_friction_drivers.png",
"ice_friction_comparison.png",
"ice_friction_ratio.png",
"ice_friction_rate_of_change.png"
]
for (i, (plot_obj, name)) in enumerate(zip(plots, plot_names))
savefig(plot_obj, name)
end
Statistical calculations confirm and refine the conclusions drawn from the graphs.
Conclusion
The final conclusions of the work are based on a comprehensive analysis of experimental data on friction coefficients in the temperature range from +5°C to -80°C. It has been found that the adhesion to both the sole of a shoe and a car tire significantly improves with a decrease in temperature, however, this improvement occurs non-linearly and with varying intensity. Car tires demonstrate an absolute and relative advantage over the sole in the entire range studied. The greatest imbalance in safety is observed in the zone of near-zero and slightly negative temperatures, typical for many regions in winter.
Practical recommendations for pedestrians should take into account the extremely low coefficient of friction at temperatures above -5°C. In such conditions, it is necessary to use special shoes with anti-slip coating or ice shoes, as well as significantly reduce the speed of movement and avoid sudden movements. Special care should be taken on slopes and stairs.
Practical recommendations for drivers are based on the fact that although tires provide better grip, its absolute value remains insufficient for safe driving during the warm winter period. At temperatures from +5°C to -10 °C, it is necessary to increase the distance, reduce speed and avoid sudden maneuvers.