I am completely lost on this.I am not very good at physics...Please help!!or get me started...
1 次查看(过去 30 天)
显示 更早的评论
You are driving a car along a straight road for t = 50s. Assume that friction is negligible but drag is not, where F_drag=.5b(v_n-1)^2 , b is a given constant, and v_n-1 is the velocity at the previous time step. For the duration of the trip as described below, calculate the position, velocity, and netacceleration of the car. Use one or more for loops to simulate the behavior of the car starting at t = 0 until t = 50s, with Δ t = 0.5s. Using subplot(), plot the position, velocity, and net acceleration as functions of time on a single figure with a 3x1 subplot and label the axes. a. Starting from rest, where initial position of x(0) = 0 and v(0) = 0, you apply an initial, constant acceleration of a = 3m/s , until you reach 65 mph. Upon 2 reaching 65 mph, you maintain a constant velocity. b. At x = 275 m, you pass a speed limit 50 mph sign. Instead of braking, you let the car coast (i.e. no applied acceleration) for the rest of the drive. c. At x = 1000 m, a police car is parked to the side of the road with a radar gun and needs to meet quota. Today, he is very strict about people not exceeding the speed limit and will pull you over if you do. If you continue to let the car coast, will you be able to slow down in time or will you get pulled over? Print the answer and the velocity just after you have passed the police car to the command window. m car = 1428.8kg (mass of car and you) b = 1.04N * s2/m2
2 个评论
John D'Errico
2015-2-22
Sorry, but people here tend not to do much for you if you do not at least make an effort. So just posting the text of your homework assignment is a poor way to get help.
I would suggest you find a friend that is willing to work with you. Often two or more people can share ideas to help you get past the points where you are stuck. This works as long as you contribute too.
per isakson
2015-2-22
编辑:per isakson
2015-2-22
This text is not easy to read. Try to recover the layout that was lost when you copy&pasted it.
Use
and
 
采纳的回答
Image Analyst
2015-2-22
Some hints:
a(1) = 3; % Acceleration
v(1) = 0;
x(1) = 0;
maxSpeed = 65 * 0.4474; % mph to meters per second
postedSpeed = 50 * 0.4474; % mph to meters per second
t = 0 : 0.5 : 50
for k = 2 : length(t)
v(k) = ..... % New speed
v(k) = min(v(k), maxSpeed); % Clip speed
x(k) = ..... % New x location
if x(k-1) > 275
% Code - acceleration = 0 now.
end
if x > 1000
% Police car seen.
if v(k) > postedSpeed
% Code ..........
end
end
end
subplot(1,3, 1);
plot(t, x);
grid on;
xlabel('t', 'FontSize', 25);
ylabel('x', 'FontSize', 25);
subplot(1,3, 2);
plot(t, v);
grid on;
xlabel('t', 'FontSize', 25);
ylabel('v', 'FontSize', 25);
subplot(1,3, 3);
plot(t, a);
grid on;
xlabel('t', 'FontSize', 25);
ylabel('a', 'FontSize', 25);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!