Week 7 Challenge
Q1.
Aim: To create a vehicle model in MATLAB.
Below attached is the snip of the model

The Model consists of two subsystem i.e Driver and Vehicle model. Drive cycle is provided through a drive cycle source block, having input from excel.

The above image is a subsystem of Driver. It consists of PID control system.
Below attached is the actual velocity of vehicle.

Below image is the subsystem of a vehicle model.
At first the two forces are considered. Total resistance is subtracted from the traction force then divided by its weight, then is integrated w.r.t the difference of acceleration and velocity.
On the right side the three forces acting on the vehicle are calculated using function block and all three forces are added, its value is supplied from a goto block.

The output of the totalresistance is as shown:

Output of velocity is as shown:

Drive cycle is provided through excel:

Following formulas are loaded in the function block:
Rolling resistance:
Fr = M*g*vel_v*cos(u)
Aerodynamic drag:
Fa = 0.5*s*Af*Cd*u^2
Grade resistance:
Fg = M*g*sin(u)