Question

Please show answer using MATLAB Time, t(s) 0 2 4 6 8 10 12 14 16...

Please show answer using MATLAB

Time, t(s)

0

2

4

6

8

10

12

14

16

Position, x(m)

0

0.7

1.8

3.4

5.1

6.3

7.3

8.0

8.4

  1. To find the velocity at all times using the two-point differencing formula (and where appropriate the three-point forward or backward differencing formulae), these should yield the results correct to O(h2)
  2. To find the acceleration at all times using the three-point central differencing formula (and where appropriate the four-point forward or backward differencing formulae), these should also yield the results correct to O(h2)
  3. Plot the position, velocity and acceleration with respect to time
0 0
Add a comment Improve this question Transcribed image text
Answer #1

t = 0:2:16;
pos = [0 0.7 1.8 3.4 5.1 6.3 7.3 8.0 8.4];
vel = [];
acc = [];

for i = 1:length(t)-1
   vel(i) = (pos(i+1) - pos(i))/(t(i+1) - t(i));
end

for i = 1:length(t)-2
   acc(i) = (pos(i+2) - pos(i))/(t(i+2) - t(i));
end

subplot 311
plot(t,pos);
title("Plot of Position with time");
xlabel("t");
ylabel("x(t)");
subplot 312
plot(t(1:length(vel)),vel);
title("Plot of Velocity with time");
xlabel("t");
ylabel("v(t)");
subplot 313
plot(t(1:length(acc)),acc);
title("Plot of Acceleration with time");
xlabel("t");
ylabel("a(t)");

Add a comment
Know the answer?
Add Answer to:
Please show answer using MATLAB Time, t(s) 0 2 4 6 8 10 12 14 16...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT