Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a c program to use the finite difference approximations for the estimation of derivatives and submit screenshots of the output generated for all 6

write a c program to use the finite difference approximations for the estimation of derivatives and submit screenshots of the output generated for all 6 casesimage text in transcribed

The distance s traveled by a mobot (mobile robot) in a controlled experiment has been pre-programmed by its designers to be described by the following function s(t)-a , where ?-_ miles and to-1 min 18 where t denotes time, and to, ?, are constants. You are observing the mobot move without being privy to its particular programming. You measure the distance traveled by the mobot at preset time intervals and you are interested in computing its velocity Write a program that will allow you to estimate the mobot's velocity, when given only the time instance t at which the velocity needs to be estimated, the time interval ?? between measurements, and the actual distance measurements. Since there are at least three ways of estimating the velocity, based on backward, forward, and centered differences, respectively, your program should include formulae for all of them. You should also be reading a number (e.g. an integer) that will be indicative of the desired method of calculation (e.g., 1 for forward, 2 for backward, or 3 for centered). Your program should be able to compute and return the mobot's approximate and exact velocities, as well as the relative exact error (expressed in percent). Use functions to ds(t) dt implement the distance function s(t) and the exact velocity function v(t)- Using your code, calculate the velocity at t-0.5min using distance measurements at (i) s(0) and s(0.5) (ii) s(0.5) and s(1), (iii) s(0) and s(1), (iv) s(0.25) and s(0.5) (v) s(0.5) and s(0.75), and (vi) s(0.25) and s(0.75) The distance s traveled by a mobot (mobile robot) in a controlled experiment has been pre-programmed by its designers to be described by the following function s(t)-a , where ?-_ miles and to-1 min 18 where t denotes time, and to, ?, are constants. You are observing the mobot move without being privy to its particular programming. You measure the distance traveled by the mobot at preset time intervals and you are interested in computing its velocity Write a program that will allow you to estimate the mobot's velocity, when given only the time instance t at which the velocity needs to be estimated, the time interval ?? between measurements, and the actual distance measurements. Since there are at least three ways of estimating the velocity, based on backward, forward, and centered differences, respectively, your program should include formulae for all of them. You should also be reading a number (e.g. an integer) that will be indicative of the desired method of calculation (e.g., 1 for forward, 2 for backward, or 3 for centered). Your program should be able to compute and return the mobot's approximate and exact velocities, as well as the relative exact error (expressed in percent). Use functions to ds(t) dt implement the distance function s(t) and the exact velocity function v(t)- Using your code, calculate the velocity at t-0.5min using distance measurements at (i) s(0) and s(0.5) (ii) s(0.5) and s(1), (iii) s(0) and s(1), (iv) s(0.25) and s(0.5) (v) s(0.5) and s(0.75), and (vi) s(0.25) and s(0.75)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions