Rolling resistence
显示 更早的评论
Dear All, I have a Question about a Homework that was given from my professor, and I really hope that some of you can really help me.
I am a matlab dummy, and have little Idea to solve my Problem.
My Professor gave a Matlab Program about the Correlation between Velocity, Distance, Rolling Resistance, and last but not least, the Time of the Bike. The Bike starts from 30 km/h a will slow down until 0 km/H.
If you run the Program there will be two Diagram. the first Diagram shows you the Correlation between the Distance and the Velocity of the bicycle, the second Diagram shows you the Correlation between the Distance and the Force of the Bicycle.
I am now asked to also make a Diagram that shows the Correlation between the Distance and the cr (in this case, cr or known as Rolling Resistance will now varry from 0,04 and will increase until 0,12)
I have used two For end Loop, but still just cannot get it. The first For End Loop is just as shown in my Progam for the Time. The second that I know had given extra is for the rolling Resistance. Is it really right??
can anybody help me or maybe give me some clue how to make it?
I really need your Help :(
clear all,
close all,
%------ Inputfile --------------------------------
m=100; % Mass of the bicycle with rider in kg
g=9.81; % gravity m/s2
A=1.1; % Face area of the bike with rider in m2
cw=0.5; % Air resistance coefficient
rho=1.2; % Density of the air in kg/m3
cr=0.08; % Rolling Resistance
tmax=60; % maximum Computation time in s
dt=0.1; % Time Step to Compute in s
s0=0; % Startposition in m
v0=30; % Startvelocity in km/h
%------ Calculation ----------------------------------
Kw=cw/2*rho*A; % Air Resistance
Fr=cr*m*g; % Rolling Resistance Force in N
kmax=round(tmax/dt)+1; % Number of computation steps
s(1)=s0;
v(1)=v0/3.6;
F(1)=-Kw*v(1)^2-Fr;
t(1)=0;
for k=2:kmax,
s1=s(k-1);
v1=v(k-1);
F(k)=-Kw*v1^2-Fr; % Braking Force in N
t(k)=t(k-1)+dt;
if v1<=0, F(k)=0; end
v2=v1+dt*(F(k)/m); % New Velocity
if v2<0, v2=0; end
s2=s1+dt*(v2+v1)/2; % New Route
s(k)=s2;
v(k)=v2;
if v2==0, break, end % Abbort bei v=0
end
% kor=(v(k-1)-0)/(v(k-1)-v(k));%Correction of the last time step
% v(k)=v(k-1)+kor*(v(k)-v(k-1));
% s(k)=s(k-1)+kor*(s(k)-s(k-1));
% t(k)=t(k-1)+kor*(t(k)-t(k-1));
% F(k)=F(k-1)+kor*(F(k)-F(k-1));
%------ Output -------------------------------------
subplot(2,1,1),
plot(s,v*3.6,'r','linewidth',2),
grid on
title(['Distance of the Bicycle t = ' num2str(max(t)) ' s']),
xlabel('s in m'),
ylabel('v in km/h'),
subplot(2,1,2)
plot(s,F,'b','linewidth',2),
grid on
xlabel('s in m'),
ylabel('F in N'),
2 个评论
Walter Roberson
2011-10-7
Please give your question a more meaningful title.
bym
2011-10-8
a second loop would be one way of solving the problem, perhaps you can post the modifications to the code given to you and point out where you are having problems. I will refrain from commenting on the original code
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!