S C
3
F
2 4
322
4 2 3
ADGT
3 1
1
2 1 1
B E H I
332
Autonomous Vehicle and Modelling Assignment 2023
Problem 1. In Fig. 1 there is a weighted graph, circles represent vertces, links represent
edges, and numbers represent edge weights.
1
Figure 1: The graph.
1. Find a shortest path from vertex S to vertex T , i.e., a path of minimum weight between
S and T .
2. Find a minimum subgraph (set of edges) that connects all vertces in the graph and
has the smallest total weight (sum of edge weights).
Justfy your answers.
Problem 2.
1. Let E be a binary relaton symbol representng adjacency in graphs. (That is, E(x, y)
means in a graph that “the vertces x and y are adjacent”.) Write a formula ϕ(x, y) in
the frstorder logic over the language L = ⟨E⟩ with equality expressing that
“x and y have exactly two common neighbors.”
Note that except logical symbols you may use only E and =. (The phrases “x and y
are adjacent” and “x and y are neighbors” have the same meaning.)
2. Find a model and a nonmodel of a theory
T = {(∀x)¬E(x, x), (∀x)(∀y)(E(x, y) → E(y, x)), (∀x)(∃y)ϕ(x, y)}
over the language L. By a nonmodel of T we mean a structure of the same language
that is not a model of T .
3. Is the formula (∃x)( ∀y)ϕ(x, y) provable or refutable from T (in a sound and
complete proof system using the axioms of T )? Give an explanaton for your answer.
Problem 3. Consider fnite strings over the alphabet Σ = a{, b, c, d }. The power operaton
represents string repetton, for example a3b4c denotes the string aaabbbbc. Defne a contextfree grammar G generating the language L(G) = { w(∃i, j, k)w = aib(i+j+k)cjdk}, the
set of words where the number of b’s is the same as the number of all other leters together
and the leters are ordered alphabetcally. For example, the words ab, aaabbbbd, abbbcd
belong to the language, words abba, aabbbbbc, abc do not belong to the language. Justfy
your answers.
Problem 4. Consider the following C++ program, and one of the C# or Java programs:
C++:
1 2 3 4 5 6 7 8 9
10
11
12
C#:
1 using Syste m ;
2 3
class Progra m {
4 static void m < T >( T t) { Console . W rite Line ($” m < T >( T ={ typeof (T)})”); }
5 static void m ( int i) { Console . W rite Li ne (” m ( int)”); }
6 static void f < T >( T t) { m ( t); }
7 8
static void M ain ( string [] args) {
9 10 11 
f(” H ello “); f(123); f( 4000000000 ); 
12 13 } 
}
# include < iostream >
tem plate < typenam e T > void m ( T t) { std :: cout << ” m ( T=” <<
typeid (T). nam e () << “)” << std :: endl; }
void m ( int i) { std :: cout << ” m ( int) n”; }
tem plate < typenam e T > void f( T t) { m ( t); }
int m ain () {
f(” H ello “);
f(123);
f( 4000000000 );
}
Java:
1 2 3 4 5 6 7 8 9
10
11
For the chosen pair of the C++ and C# programs, or the C++ and Java programs, answer
the following:
1. What output will be printed by the C++ program, and what output by the second
language in the pair?
2. Explain why the C++ program behavior is diﬀerent (in terms of methods called) from
that of the C# or Java one. Why do diﬀerent methods get called?
3. In C++, C#, or Java, write a generic functon that takes 3 arguments of any suitable
type T and returns their maximum value.
Problem 5. Consider a transacton schedule S = R1(A), W2(B), R3(C), R3(B), W1(C),
W3(B), COMMIT3, ABORT2, COMMIT1.
The notaton uses Ri(X) and Wi(X), respectvely, for reading from and writng to the variable X in the ith transacton. COMMITi and ABORTi denote successful and unsuccessful
end of ith transacton, respectvely.
If operatons from individual transactons are writen separately while maintaining their
ordering, the schedule can be presented as follows:
Time (running top to botom) 
T1  T2  T3 
1  R1(A)  
2  W2(B)  
3  R3(C)  
4  R3(B)  
5  W1(C)  
6  W3(B)  
7  COMMIT3  
8  ABORT2  
9  COMMIT1 
public class Main {
static <T> void m ( T t) { System . out. println (” m (
T)”); } static void m ( int i) { System . out. println (” m
( int)”); } static <T> void f( T t) { m ( t); }
public static void m ain ( String [] args )
{ f(” H ello “);
f( 123);
f( 4000000000 L);
}
}
1. Find all conﬂictng pairs of operatons in the schedule S.
2. Is the schedule S conﬂictserializable? Justfy your answer.
3. Is the schedule S recoverable? Justfy your answer.
If the schedule S lacks a partcular property, correct it so that it satsfes the property
without changing the order of the read and write operatons.
If the schedule cannot be fxed, describe why not.
Tyre Force
4000
3000
2000 Y
max  
dY0  Y 
Fz=3200 N 
1000
0
1000
2000 3000
4000
40302010 0
X
10203040
TM_simple: A Simple to Use Tyre Model
MATLAB Version 4.0
Mar 16, 2007, W. Hirschberg
General Procedure
TM_simple is a very simple tyre model to compute the longitudinal and lateral tyre forces Fx, Fy
for a given nominal load Fz and the rolling resistance torque TyR under steady state conditions.
The road is defined to be even, camber influence is neglected. However, the nominal roadtyre
friction is able to be scaled in a realistic manner.
The horizontal forces Y which are acting on the tyre at the wheel bottom point W are calculated
by
Y K sin[B (1 e
X
A ) sign X ] , (1)
where X is the relating slip quantity. The coefficients K, B and A are given by
K Y max , B arcsin 
Y Y max , A 
(Y Ymax ) , 
1
K B
dY0
(2)
where Ymax is the peak value, Y the saturation value and dY0 the initial stiffness for a constant
tyre load Fz , cf. fig. 1.
Fig. 1: Force/slip relation for fixed load Fz nom
In order to consider the degressive influence of the load Fz, the polynomials
⎝
⎝ ⎝
⎠
⎠ ⎠
Tyre Force
5000
4000
3000
2000
1000
0 
1000
2000
3000
4000
5000
0,3
Fz=1500 N Fz=3000 N
Fz=4500 N
0,2 0,1 0
X
0,1 0,2 0,3
F ⎛ F ⎞2
Y
max ( Fz ) a1 z a2 ⎜z⎜ ,
Fz
nom
⎜ F
z nom
⎜
F ⎛ F ⎞2
dY0 (Fz ) b1 z
⎜  z 
Fz nom 
⎜ F z nom 
⎜  
F  ⎛ F ⎞ 2 
Y (Fz ) c1 z c2 ⎜z⎜ 

Fz nom 
⎜ F z nom 
b2 ⎜(3)
⎜
are used. For given values of Y1 for Fz nom and Y2 for 2*Fz nom , the coefficients a1 and a2 can be
easily determined by
a1 2 Y1 1 Y 2 2 and a2 
.  (4) 
1
2 Y
2
Y1
In the same manner, the coefficients b1 and b2, are calculated from given initial stiffness values
dY1 for Fz nom and dY2 for 2*Fz nom and c1 and c2 from given saturation values Y1 for Fz nom and Y2
for 2*Fz nom respectively. Hence, the degressive influence of the tyre load Fz is taken into account,
cf. fig. 2.
Fig. 2: Force/slip relations for 3 values of load Fz
y
The TM_simple Parameters
The following set of 18 parameters has to be provided for TM_simple:
% Tyre type: Radial 205/60 R15
t_par.fz_nom = 3000; % Nominal tyre load [N]
t_par.rs_nom = 0.290; % Static tyre radius at fz_nom [m]
t_par.reff = 0.300; % Effective tyre radius at fz_nom [m]
t_par.fxmx_fzn = 3000; % Fx_max at Fz_nom [N]
t_par.fxin_fzn = 2700; % Fx_inf at Fz_nom [N]
t_par.dfx0_fzn = 650; % dFx/dsl at Fz_nom [N/deg]
t_par.fxmx_2fzn = 5600; % Fx_max at 2*Fz_nom [N]
t_par.fxin_2fzn = 5000; % Fx_inf at 2*Fz_nom [N]
t_par.dfx0_2fzn = 1300; % dFx/dal at 2*Fz_nom [N/deg]
t_par.fymx_fzn = 2800; % Fy_max at Fz_nom [N]
t_par.fyin_fzn = 2700; % Fy_inf at Fz_nom [N]
t_par.dfy0_fzn = 600; % dFy/dal at Fz_nom [N/deg]
t_par.fymx_2fzn = 5200; % Fy_max at 2*Fz_nom [N]
t_par.fyin_2fzn = 5000; % Fy_inf at 2*Fz_nom [N]
t_par.dfy0_2fzn = 1200; % dFy/dal at 2*Fz_nom [N/deg]
t_par.rr = 0.012;
t_par.mu = 1;
%%
Rolling resistance coefficient []
Nominal road/tyre friction coeff []
Combined Tyre Forces
For the computation of the combined tyre forces, the following combination method is applied,
which is based on the similarity of longitudinal and lateral slip. In order to perform physical
similar slip quantities, here the slip angle is transformed to a lateral slip sly such that an
equivalent initial stiffness is reached.
F
F
x0(slx)
F
y0(sly)
F
y() sl
X = sl
sl
y = G
Fig. 3: Transformation of the lateral slip
The transformation of the slip angle to lateral slip is done by
sl :
(5)
G ( Fz )
under usage of the weighting function
G (F )
b
x
. (6)
z
y
Thus, the components of the slip vector s are defined, which is orientated in the direction to
s :
⎡ sl x ⎤
⎜ sl . (7)
y
⎜
⎣ ⎦
Fig. 4: Interpolation of the combined tyre forces
Under the condition that the resulting horizontal force is acting in opposite direction of the slip
vector, the following superposition can be applied. In particular, the magnitude of the resulting
force vector F = F can be received from the interpolation, c.f. fig. 4, where Fx’ and Fy’ denote
the related base values for the longitudinal and lateral force:
F
1
2 Fx Fy
Fx
F
y
cos 2 . (8)
Finally, the resulting 2×1vector of the horizontal tyre forces reads
⎡ Fx ⎤
⎜F
y
⎜ ⎡cos ⎤
.
⎜
sin ⎜
⎣ ⎦ ⎣ ⎦
Use Cases
For testing a set of TM_simple input parameters, the MATLAB utility program
b
TM_simple_test.m can be used. For predefined ranges of slip, slip angle and tyre load, the
graphics output of the resulting force characteristics is available. The function Veloc.m belongs
to that program.
For the application of TM_simple_x for pure longitudinal motion, the simplified version
TM_simple_x_test.m can be used.
Application of TM_simple (2D):
Call of the MATLAB interface X_tyre to TM_simple
[frc, trq] = X_tyre (idtyre, vx, vy, om, t_par, fz)
In this way, the variables vx, vy, om, fz can be passed over directly to TM_simple.
X_tyre is then calling TM_simple.
On input:
idtyre . . . Tyre instance counter (not yet active)
vx vy om fz On output: frc trq 
. . . Longitudinal tyre velocity [m/s] . . . Lateral tyre velocity [m/s] . . . Rotational wheel speed [rad/s] . . . Tyre load [N] 
. . . 31 vector of tyre forces Fx , Fy , Fz . . . 31 vector of tyre moments Mx , My , Mz , where the moment M y contains the rolling resistance torque. 
Application of TM_simple_x (1D):
For the computation of the pure longitudinal tyre force Fx und moment My , the more efficient
model version TM_simple_x can be used.
Call of the MATLAB interface X_tyre_x to TM_simple_x
[fx, my] = X_tyre_x (idtyre, vx, om, t_par, fz)
The arguments of that function are listed above.
On output:
fx my 
. . . Longitudinal tyre force . . . Tyre moment around spin axis 
Homework
Parametrization of truck tire model.
F
z,nom=35.000N (nominal vertical force)
LKW=0,8 (tire road friction coefficient )
F
y,max at 12% tire slip angle (maximum lateral force)
F
x,max at 15% longitudinal slip (maximum longitudinal force)
F
x,∞ at 80% of Fx,max (maximum sliding lateral force)
F
y,∞ bei 100% von Fx,max (maximum sliding longitudinal force)
Please program a simple tire model using the TM_Simple modelling approach. You can program
it in Excel or Matlab. Please print the longitudinal and lateral force characteristic as a function of
longitudinal and lateral tire slip (tire slip angle).
Part 1: Derive the equations for a twomass oscillator.
Derive the equations analogue to part 1.
Vehicle parameter (ficticous)
m
K  K  K 
mA=20.000kg  cA=50.000N/m  dA=3.000 Ns/m 
mR=100kg  cR=500.000N/m  dR=0 Ns/m 
=1.000kg c=20.000N/m d=2.000 Ns/m
Wanted:
1.) State space equation
2.) Systemmatrix A
Additional point: 3.) Eigenfrequency of cabin, vehicle chassis and wheel