Week 7 Challenge
Load the vehicle parameters. Complete the vehicle model by modelling the remaining equations. Set simulation stop time to 598 sec.
The output should be the vehicle velocity.
Vehicle Model in MATLAB SIMULINK:-
Vehicle model here is nothing but the equation of forces which comes under velocity ie. when vehicle moves from its rest position for motorized vehicles such as automobiles aircraft and watercraft, vehicle dynamics is the study of vehicle motion. e.g. how a vehicle's forward movement changes in response to driver inputs, propulsion system outputs, ambient conditions air/surface/water conditions etc. Below image shows the force acting on a vehicle

Where
* Ftr= Tactive FOrce
* Fa= Aerodymanic drag resistant force
* Fg= Gradient Resistance force
* Fr= Rolling resistance force
* Fi= Inertial resistance force
Tractive force is the force applied/produced by the vehiclepoertrain we will now see the quations of three main forces and will implement this sing matlab Fcn block
Aerodynamic drag: Aserodyamic Drag is a force which the oncoming air applies on a moving body. its is the reistance offered by the air to the movement of the body. So when a car is moving it displaces the air However it affects the car's speed and performance Tehncially it is the aerodynamiv drag or the friction offered by the air to a vehicle
Aerodynamic Drag= 1/2*p*Cd*A*V2
Force of aceelration : The acceleration force refers to the vehicle resistance to speed varitaions This force holds you back when you increase your speed and also moves you forward when you slow down in other words it means that you consume energy to acclerate up to as certain speed but can recover part of that energy when you decelerate allowing you to drive a certain distance without consuming fuel in equations it is simply written as
F=m*a ( m is mass and a is acceleration)
VEHICLE MODEL
The model shown above shows driver block too but our focust is on vehicle block only, Driver block is used here because we need accleration value to overcome the integral windup happeneing while converting tractive force into velocity Hence only vehicle block system and its explanation is done here
Inside View of vehicle block is shown below:

Drag force gradient force and rolling resistance force implemented using Fcb block


We will understand Rest all thing about model while explaining its working
Working of MOdel:
The input to the vehicle block is tractive force this tractive force is teh force which is applied by the powertrain to the vehicle body we have given tractive force directly as a input its values are in newton its plot (of values) is shown below.

2. Now comes directly the main part ie. to find velocity we know the sume of all the forces acting on vehicle is force of traction which is given as
F_trac= Force of acceleration+ Rolling Resistance Foce+ Gradient Force+ Aerodynamic Force
The term force of acceleration will help us to find the velcoity we will first seperate the acceleration term and resistive force terms.
F_trac-Fr-Fg-Fd=Fa
F_trac-Fr-Fg-Fd= m*a
F_trac-Fr-Fg-Fd/m=a
So we now have accleration with us
.3. The forces other than F_trac in model is calculated (of which formula implementation using Fcn block is already shown) as shown below

* We have taken grade is zero hence there will be no gradient force acting on vehicle
* Fr is independent of velocity value but only acts on vehicle when its moving Hence switch is used to make sure the force is taken into account only when velcoity is of some value
* Aerodynamic force or drag force is purely a function of square of velocity Hence the Fcn block is given velocity square as its function
* Sum of these forces is then substracted with tractive force
4. Then after this the result of above pocedure is divided bu mass to get the acceleration value

5. Now we have acceleration with us we know that the accleration is the rate of change of velocity ie. the derivative of velocity Hence its anti derivation or integration will give us the velocity What been said theoritically is acytually implemented in simulink using required blocks

We have also taken here of integral windup integral windup particularly occurs as a limitation of physical system. compared with ideal system due to the ideal output being physically impossible For ex. the position of a valve cannot be any more open than fully open and also cannot be closed any more than fully closed in this case anti windup can actually involve the integrator being turned off for periods of time until the response falls back into an accpetable range as soon as the acc and velocity goes zero the reset button gets active
* The vehicle paramertes is loaded using mat files. The parameters value is shown below
Parameters value
Vehilce mass 1200kg
Gravitation force 9.81
RR coefficient 1.2
Drag Coff 2.5
Grade or angle 0.
RESULT SIMULATION:
OUPUT VELOCITY