rgssparky
Automotive
- Aug 10, 2007
- 2
Hello,
I am trying to run a theoreical driveline modelling program. I'm not the best at Matlab, which you may see with my program, if any help could be thrown my way to aid in actually making the program able to run would be greatly appreciated.
Mark
--------------------------
function ydot = bm(t,y)
global A B C D E J T ydot y Jw m r i1 i2 Je Te Tfric cair A p Td t
J = Jw + m*r^2 + i1^2 *i2^2 * Je;
T = Te - Tfric;
A = -m * r^2;
B = -0.5 * cair * A * p * r^3;
C = -r * m;
D = [T]*[i1*i2];
E = [A B C]*[y;y^2;1];
ydot = (D + E)/J;
Td=Te*i1;
---------------------------------
global A B C D E J T ydot y t Jw m r i1 i2 Je Te Tfric cair A p
t=[0:1:10];
y = 2 * pi / 60 * (7000 + 5000 * sin[t/1.5]);
r = 0.1625;
m = 500;
i1 = 1.086;
i2 = 3;
Jw = 25 * r^2;
Je = 0.1;
Te = Je * ydot;
Tfric = 0.1 * Te * ( 1 + cos[t/1.5] * sin [t/1.5]);
cair = 0.8;
A = 1.7;
p = 1.2;
[t,y] = ode23('basicmodel', [0, 10], [0, 250]);
subplot(2,2,1)
plot(t,y),xlabel('time'), ylabel('rad/s'), gtext('wheel Speeds');
subplot(2,2,2)
plot(t,ydot), xlabel('time'), ylabel('rad/s^2'), gtext('wheel Accn');
subplot(2,2,3)
plot(y,Td), xlabel('rpm'), ylabel('Nm'), gtext('Driveshaft Torque');
-----------------------------------------
Thanks for looking,
Mark
I am trying to run a theoreical driveline modelling program. I'm not the best at Matlab, which you may see with my program, if any help could be thrown my way to aid in actually making the program able to run would be greatly appreciated.
Mark
--------------------------
function ydot = bm(t,y)
global A B C D E J T ydot y Jw m r i1 i2 Je Te Tfric cair A p Td t
J = Jw + m*r^2 + i1^2 *i2^2 * Je;
T = Te - Tfric;
A = -m * r^2;
B = -0.5 * cair * A * p * r^3;
C = -r * m;
D = [T]*[i1*i2];
E = [A B C]*[y;y^2;1];
ydot = (D + E)/J;
Td=Te*i1;
---------------------------------
global A B C D E J T ydot y t Jw m r i1 i2 Je Te Tfric cair A p
t=[0:1:10];
y = 2 * pi / 60 * (7000 + 5000 * sin[t/1.5]);
r = 0.1625;
m = 500;
i1 = 1.086;
i2 = 3;
Jw = 25 * r^2;
Je = 0.1;
Te = Je * ydot;
Tfric = 0.1 * Te * ( 1 + cos[t/1.5] * sin [t/1.5]);
cair = 0.8;
A = 1.7;
p = 1.2;
[t,y] = ode23('basicmodel', [0, 10], [0, 250]);
subplot(2,2,1)
plot(t,y),xlabel('time'), ylabel('rad/s'), gtext('wheel Speeds');
subplot(2,2,2)
plot(t,ydot), xlabel('time'), ylabel('rad/s^2'), gtext('wheel Accn');
subplot(2,2,3)
plot(y,Td), xlabel('rpm'), ylabel('Nm'), gtext('Driveshaft Torque');
-----------------------------------------
Thanks for looking,
Mark