Available under Creative Commons-ShareAlike 4.0 International License.
A body moves from rest under the action of a direct force given by where x is the distance in meters from the starting point. Write a script to compute the total work done in moving a distance 10 m. 1
Recall that the general definition of mechanical work is given by the following integral, see Wikipedia2:
Therefore we can write:
Applying the steps we followed in the previous examples, we write:
clc disp('A body moves from rest under the action of a direct force given') disp('by F=15/(x+3) where x is the distance in meters') disp('From the starting point.') disp('Compute the total work done in moving a distance 10 m.') disp(' ') % Display blank line x=0:.001:10; % Creating a row vector for distance, x F=15./(x+3); % Computing Force for x WorkDone=trapz(x,F) % Integrating F*dx over 0 to 10 meters.
The output of the above code is:
A body moves from rest under the action of a direct force given by F=15/(x+3) where x is the distance in meters From the starting point. Compute the total work done in moving a distance 10 m. WorkDone = 21.9951
- 瀏覽次數:1273