Problem Set-1 c Week 11Challenge : Transient Handling
1 -
passenger car
Wn = 7.1912
Theta = 0.7245
Wd = 4.9564
tr = 0.1733
for f1 car
Wn = 13.308
Theta = 0.9837
Wd = 2.3934
tr = 0.1058
2,3,4 plots
Passenger car



F1 car



5-
on corelation between graphs
if we compare yaw gain at steady state and frequency response we see both have appx value around 30 for F1 and around 5 for passenger car
in both graph its around 30 indicating a coorelation between both graph

to compare response time , if we look at step responce and see the time required for signal to reach 90% of its peak value ( in yaw rate )
we can see the time from graph is equal to that of analytic calculation
eg in passenger car
response time by calculation is 0.177
and if we look at yaw rate step response , we can see time taken by graph to reach 90% from 10% of its value (27) is appx 0.17
same for F1 car
Passenger car
clear all;
clc;
l = 2.538984 ;
a = 0.890016;
b = l-a;
m = 907.18474;
iz = 1128 ;
caf = 61171.9437;
car = 50976.6191;
u = 100/3.6;
A=[-(caf+car)/(m*u),(((b*car)-(a*caf))/(m*u))-u
((b*car)-(a*caf))/(iz*u), -((((a^2)*caf)+((b^2)*car))/(iz*u))];
B=[caf/m;(a*caf)/iz];
C_lat=[1,0];
C_yaw=[0,1];
C_acc=A(1,:)+u*[0,1];
D_lat=0;
D_yaw=0;
D_acc=B(1);
C= [C_lat; C_yaw; C_acc];
D= [D_lat; D_yaw; D_acc];
t=[0:0.01:2];
st=(pi/180)*5*sin(2*pi*7*t);
sys=ss(A,B,C,D);
Y=lsim(sys,st,t);
sys.Inputname={'st'};
sys.Outputname={'lateral speed','yaw rate','lateral acceleration'};
[mag,w] = bodemag(sys({'yaw rate'},'st'));
loglog(w/6.28,[mag],'linewidth',3);
grid on;
set(gca,'fontsize',18);
title('yaw rate/steer angle freq response');
xlabel('freq (hz)');
ylabel('yaw rate (deg/sec)');
figure(2)
step(sys)
grid on
figure(3)
subplot(2,2,1)
plot(t,Y(:,1),'linewidth',2)
title('lateral speed','fontsize',18)
xlabel('time','fontsize',18)
ylabel('lateral speed','fontsize',18)
subplot(2,2,2)
plot(t,Y(:,2),'linewidth',2)
title('yaw rate','fontsize',18)
xlabel('time','fontsize',18)
ylabel('yaw rate','fontsize',18)
subplot(2,2,3)
plot(t,Y(:,3),'linewidth',2)
title('lateral acc','fontsize',18)
xlabel('time','fontsize',18)
ylabel('lateral acc','fontsize',18)
subplot(2,2,4)
grid on;
plot(t,st*180/pi,'linewidth',2);
title('steering angle', 'fontsize',18)
xlabel('time','fontsize',18)
ylabel('steering','fontsize',18)
caf = -61171.9437;
car = -50976.6191;
YB=caf+car
YR=(a*caf-b*car)/u
YS=-caf
NB=a*caf-b*car
NR=(((a^2)*caf)+((b^2)*car))/u
NS=-a*caf
Wn=sqrt(((YB*NR)+(NB*m*u)-(YR*NB))/(m*u*iz))
Theta=abs(-((NR/iz)+(YB/(m*u)))*(1/(2*Wn)))
Wd=Wn*sqrt(1-(Theta)^2)
tr=((m*u*NS)/((YS*NB)-(YB*NS)))
F1 CAR
clear all;
clc;
l = 2.901696 ; %
a =1.740408;%
b = l-a;
m = 779.725283; %
iz = 865 ; %
caf = 276803.931357;
car = 429733.788657;
u = 350/3.6;
A=[-(caf+car)/(m*u),(((b*car)-(a*caf))/(m*u))-u
((b*car)-(a*caf))/(iz*u), -((((a^2)*caf)+((b^2)*car))/(iz*u))];
B=[caf/m;(a*caf)/iz];
C_lat=[1,0];
C_yaw=[0,1];
C_acc=A(1,:)+u*[0,1];
D_lat=0;
D_yaw=0;
D_acc=B(1);
C= [C_lat; C_yaw; C_acc];
D= [D_lat; D_yaw; D_acc];
t=[0:0.01:2];
st=(pi/180)*5*sin(2*pi*7*t);
sys=ss(A,B,C,D);
Y=lsim(sys,st,t);
sys.Inputname={'st'};
sys.Outputname={'lateral speed','yaw rate','lateral acceleration'};
[mag,w] = bodemag(sys({'yaw rate'},'st'));
loglog(w/6.28,[mag],'linewidth',3);
grid on;
set(gca,'fontsize',18);
title('yaw rate/steer angle freq response');
xlabel('freq (hz)');
ylabel('yaw rate (deg/sec)');
figure(2)
step(sys)
grid on
figure(3)
subplot(2,2,1)
plot(t,Y(:,1),'linewidth',2)
title('lateral speed','fontsize',18)
xlabel('time','fontsize',18)
ylabel('lateral speed','fontsize',18)
subplot(2,2,2)
plot(t,Y(:,2),'linewidth',2)
title('yaw rate','fontsize',18)
xlabel('time','fontsize',18)
ylabel('yaw rate','fontsize',18)
subplot(2,2,3)
plot(t,Y(:,3),'linewidth',2)
title('lateral acc','fontsize',18)
xlabel('time','fontsize',18)
ylabel('lateral acc','fontsize',18)
subplot(2,2,4)
grid on;
plot(t,st*180/pi,'linewidth',2);
title('steering angle', 'fontsize',18)
xlabel('time','fontsize',18)
ylabel('steering','fontsize',18)
caf = -276803.931357;
car = -429733.788657;
YB=caf+car
YR=(a*caf-b*car)/u
YS=-caf
NB=a*caf-b*car
NR=(((a^2)*caf)+((b^2)*car))/u
NS=-a*caf
Wn=sqrt(((YB*NR)+(NB*m*u)-(YR*NB))/(m*u*iz))
Theta=abs(-((NR/iz)+(YB/(m*u)))*(1/(2*Wn)))
Wd=Wn*sqrt(1-(Theta)^2)
tr=((m*u*NS)/((YS*NB)-(YB*NS)))