Antilock Braking System

Two types of friction
static: moves when F > μs・N
kinetic: F = μk * N

wheel slip
rolling, rocked

speed = 120 km/h
μ=1.0: 3.4s
μ=0.7: 4.9s

F = m*a
u*gravitational force(mg)
a = μ*g

t/ 120km/h = 1 / μg
t = 120km/h / μ*g

Computing the coefficient of Friction
s = 1 – w/v
F(s) = μ(s)*mqcG
V= -F(s)/mqc
F = ma
w = F(s)/mew – B

import math
from **** import *

h = 0.01
mass_quarter_car = 250.
mass_effective_wheel = 20.
g = 9.81

end_time = 5.
num_steps = int(end_time / h)

w = numpy.zeros(num_steps + 1)
v = numpy.zeros(num_steps + 1)
x = numpy.zeros(num_steps + 1)
times = h * numpy.array(range(num_steps + 1))

@show_plot(7, 7)
def plot_me():
	axes_x = matplotlib.pyplot.subplot(411)
	axes_v = matplotlib.pyplot.subplot(412)
	axes_w = matplotlib.pyplot.subplot(413)
	awes_s = matplotlib.pyplot.subplot(414)

	def friction_coeff(slip):
		return 1.1 * (1. - math.exp(-20. * slip)) - 0.4 * slip

	def wheel_slip():
		b_values = numpy.arange(70., 190.1, 30.)
		for b in b_values:
			x[0] = 0.

			for step in range(num_steps):
				if v[step] < 0.01:
					break
				s = max(0., 1. - w[step] / v[step])

				w[step + 1] = max(0., w[step + 1])

			axes_x.plot(times[:step], x[:step])
			axes_v.plot(times[:step], v[:step])
			axes_w.plot(times[:step], w[:step])
			axes_s.plot(times[:step], 1. - w[:step] / v[:step])
			p = int((0.35 + 0.4 * (b - b_values[0])/ (b_values[-1] - b_values[0])) * num_steps)
			axes_x.annotate(b, (times[p], x[p]),
					xytext = (-30, -30), textcoords = 'offset point',
					arrowprops = dict(arrowstyle = '-', connectionstyle = 'arc3, '))

			p = int((0.35 + 0.4 * (v - b_values[0]) / (b_values[-1] - b_values[0])) * num_steps)
			axes_x.annotate(b, (times[p], x[p]),
				xytext = (-30, -30), textcoords - 'offset points',
				arrowprops = dict(arrowstyle = '-', connectionstyle = 'arc3, rad = 0.2', shrinkB = 0.))

		return x, v, w

    axes_x.set_ylabel('Position\nin m', multialignment = 'center')
    axes_v.set_ylabel('Car velocity\nin m/s', multialignment = 'center')
    axes_w.set_ylabel('Wheel velocity\nin m/s', multialignment = 'center')
    axes_s.set_ylabel('Wheel\nslip', multialignment = 'center')
    axes_s.set_xlabel('Time in s')
    axes_s.set_ylim(0., 1.)

    return wheel_slip()

x, v, w = plot_me()