机动车刹车制动距离问题
速度km/h | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120 | 130 | 140 | 150 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
速度m/s | 5.6 | 8.3 | 11.1 | 13.9 | 16.6 | 19.4 | 22.2 | 25 | 27.8 | 30.6 | 33.3 | 36.1 | 38.9 | 41.7 |
制动距离 | 3.15 | 7.08 | 12.59 | 19.68 | 28.34 | 38.57 | 50.4 | 63.75 | 78.71 | 95.22 | 113.29 | 132.93 | 154.12 | 176.87 |
假设驾驶员的反应时间为10s,安全距离为10 m。请问:
1.根据某驾驶员的实际视力和视觉习惯,其驾驶时的有效视距为120 m,则其在该路面行车时,时速最高不能超过多少(结果取整)?
2.若以表中数据为参考,设计一条最高时速为125 km/h的高速公路则设计人员应该保证驾驶者在公路上任一点的可视距离为多少米?
用matlab实现
% 已知数据
speed = [20 30 40 50 60 70 80 90 100 110 120 130 140 150]; % km/h
distance = [3.15 7.08 12.59 19.68 28.34 38.57 50.4 63.75 78.71 95.22 113.29 132.93 154.12 176.87]; % m
time = 10; % s
safedistance = 10; % m
% 将速度转换为m/s
speed = speed * 1000 / 3600;
% 计算总停车距离
alldistance = speed * time + distance + safedistance;
% 问题1: 在有效视距120m内的最高速度
topspeedindex = find(alldistance <= 120, 1, 'last');
topspeed = speed(topspeedindex) * 3600 / 1000; % 转换回km/h
fprintf('在有效视距120m内的最高速度为: %.2f km/h\n', topspeed);
% 问题2: 在125km/h时需要的可视距离
% 插值找到125km/h时的制动距离
distance_125 = interp1(speed, distance, 125*1000/3600, 'linear', 'extrap');
% 计算总停车距离
alldistance_125 = 125 * 1000 / 3600 * time + distance_125 + safedistance;
fprintf('在125km/h时需要的可视距离为: %.2f m\n', alldistance_125);
在有效视距120m内的最高速度为: 30.00 km/h
在125km/h时需要的可视距离为: 480.33 m
用java实现
public class DrivingDistanceCalculator {
private static final double[] speeds = {20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150};
private static final double[] brakingDistances = {3.15, 7.08, 12.59, 19.68, 28.34, 38.57, 50.4, 63.75, 78.71, 95.22, 113.29, 132.93, 154.12, 176.87};
private static final double reactionTime = 10; // in seconds
private static final double safetyDistance = 10; // in meters
public static void main(String[] args) {
double effectiveVisionDistance = 120; // in meters
System.out.println("1. 在有效视距120m内的最高速度为: " + getMaxSpeed(effectiveVisionDistance) + " km/h.");
double maxHighwaySpeed = 125; // in km/h
System.out.println("2. 在125km/h时需要的可视距离为: " + getVisibilityDistance(maxHighwaySpeed) + " meters.");
}
public static int getMaxSpeed(double visionDistance) {
for (int i = speeds.length - 1; i >= 0; i--) {
double totalDistance = safetyDistance + brakingDistances[i] + speeds[i] * reactionTime / 3.6; // converting speed from km/h to m/s
if (totalDistance <= visionDistance) {
return (int) speeds[i];
}
}
return 0; // If the speed that meets the criteria is not found, return 0.
}
public static double getVisibilityDistance(double maxHighwaySpeed) {
double brakingDistance = interp1(speeds, brakingDistances, maxHighwaySpeed, true);
return safetyDistance + brakingDistance + maxHighwaySpeed * reactionTime / 3.6;
}
public static Double interp1(double[] X, double[] V, double Xq, boolean extrap) {
for (int i = 0; i < X.length - 1; i++) {
if ((Xq >= X[i] && Xq <= X[i + 1]) || (extrap && i == X.length - 2)) {
return V[i] + (Xq - X[i]) * (V[i + 1] - V[i]) / (X[i + 1] - X[i]);
}
}
return extrap ? V[V.length - 1] + (Xq - X[X.length - 1]) * (V[V.length - 1] - V[V.length - 2]) / (X[X.length - 1] - X[X.length - 2]) : null;
}
}