Question

In: Mechanical Engineering

1.Write down the fplot( ) command used to generate a straight line formed by two (x,...

1.Write down the fplot( ) command used to generate a straight line formed by two (x, y) points: (-3, 5) and (3, 8). Plot the line from -5 ≤ x ≤ 5. Show your derivation of the line equation.

2. [15pts] The position x as a function of time of a particle that moves along a straight line is given by

a. [3pts] Derive the expressions for the velocity and acceleration of the particle

Make plots of the position, velocity, and acceleration as a functions of time for 0 ≤ t ≤ 15 sec following the instructions below.

b. [6pts] Using plot( ), plot the position, velocity, and acceleration on a single plot window using black solid line, green dash line, and yellow dash-dot line, respectively. Show the plot in Figure 1. Use the line width of 2. Include the following title in bold face: “Motion profile of a particle between 0 ≤ t ≤ 15 sec”. Include proper legend and axis labels with units. Show grid lines. All formatting must be done inside your code and not from the Figure Editor.

c. [6pts] Using subplot, plot the position, velocity, and acceleration vs time in 3 separate plots arranged in a single column. Show the subplot in Figure 2. Include the following title in bold face above the top-most plot: “Position, velocity and acceleration profile of a particle”. Show grid lines and proper axis labels on all your plots. All formatting must be done inside your code and not from the Figure Editor.

Solutions

Expert Solution

The two points are given by (-3,5) and (3,8)

The equation of line joining two points is given by y-y1=(y2-y1)/(x2-x1)*(x-x1)

=> y-5=(8-5)/(3+3)*(x+3)

=> 2y-10=x+3

=> y=(x+13)/2 (Our Line Equation)

Using the command fplot(@(x) (x+13)/2), I got the following plot

Here suppose x is taken as time and y is taken as position of particle

rewriting this equation in terms of position and time, we get

x=(t+13)/2;

The velocity of a particle is the differentiation of position with respect to time

=> we get velocity v=dx/dt=1/2;

the acceleratio of a particle is the differentiatio of velocity with respect to time

=> we get acceleration a=dv/dt=0;

plotting position, velocity and acceleraton with respect to time in MATLAB, we get

and the Matlab code is

clc
clear
t = linspace(0,15);
x=(t+13)/2;
v=1/2+0*t;
a=0+0*t;
plot(t,x,'-k','LineWidth',2,'markerfacecolor','k');
    hold on
    plot(t,v,'--g','LineWidth',2,'markerfacecolor','g');
    hold on
    plot(t,a,'-.y','LineWidth',2,'markerfacecolor','y');
    axis on;
    grid on;
    title('\fontsize{16}\fontname{Times New Roman}Motion profile of a particle between 0<=t<=15 sec');
    xlabel('\fontsize{12}\fontname{Times New Roman}time(sec)');
    ylabel('\fontsize{12}\fontname{Times New Roman}position(m) velocity(m/s) acceleration(m/s^2)');
    legend('position','velocity', 'acceleration');
    axis([0 15 0 inf]);

Using subplot, I got the following figure

and the Matlab code is

clc
clear
title('Position, velocity and acceleration profile of a particle')
subplot(3,1,1)
t = linspace(0,15);
x=(t+13)/2;
plot(t,x,'-k','LineWidth',2,'markerfacecolor','k');
axis on;
grid on;
title('\fontsize{12}\fontname{Times New Roman}"Position, velocity and acceleration profile of a particle”');
xlabel('\fontsize{12}\fontname{Times New Roman}time(sec)');
ylabel('\fontsize{12}\fontname{Times New Roman}position(m)');

subplot(3,1,2)
t = linspace(0,15);
v=1/2+0*t;
plot(t,v,'--g','LineWidth',2,'markerfacecolor','g');
axis on;
grid on;
xlabel('\fontsize{12}\fontname{Times New Roman}time(sec)');
ylabel('\fontsize{12}\fontname{Times New Roman}velocity(m/s)');

subplot(3,1,3)
t = linspace(0,15);
a=0+0*t;
plot(t,a,'-.y','LineWidth',2,'markerfacecolor','y');
    axis on;
    grid on;
xlabel('\fontsize{12}\fontname{Times New Roman}time(sec)');
ylabel('\fontsize{12}\fontname{Times New Roman}acceleration(m/s^2)');


Related Solutions

Q1. Write down the equation of the regression straight line (the least-squares line)
  Q1. Write down the equation of the regression straight line (the least-squares line) Q2. For an increase of 1 mg of fertiliser applied, what is the average change in the wet weight of maize plants? Q3.​​​​​​ ​How are the two variables associated with each other? (Answer in 1 or 2 sentences)Q4. Determine the average weight of plants grown with 100mg of fertiliser applied. (round up your answer to 2 decimal places)Q5. Determine the average weight of plants grown with...
1. What command is used to change the current working directory at the command line?
1. What command is used to change the current working directory at the command line?
Write the line x = 0:2:20; in the Command Window of MATLAB and then create a...
Write the line x = 0:2:20; in the Command Window of MATLAB and then create a Simulink model that first loads x from the Workspace, then creates a vector y such that y = 2.5x + ex , and finally sends the vector y back to the Workspace. You will need a From Workspace block, a To Workspace block, two Constant blocks, a Product block, and a Sum block. Note that there is a sample time associated with the From...
A school bus drives in a straight line down a road. Its position x from a...
A school bus drives in a straight line down a road. Its position x from a stop sign is given as a function of time by the following equation: x(t)=At^2-Bt^3, where A = 2.50 m/s^2 and B = 0.0855 m/s^3 . Use this information to calculate: a. the bus’s average velocity from t = 0 to t = 2.00 s b. the bus’s instantaneous velocity at t = 0 and t = 2.00 s c. the bus’s average acceleration from...
**Need to use awk command in putty (should be a ONE LINE COMMAND) Write the command...
**Need to use awk command in putty (should be a ONE LINE COMMAND) Write the command that would find all lines that have an email address and place a label email = before the line in the file longfile output will multiple lines similar to this one : using a good awk command the output would be something like this email = From: "Linder, Jann/WDC" <[email protected]> email = To: Mr Arlington Hewes <[email protected]> email = > From: Mr Arlington Hewes...
Write a program that takes two command line arguments at the time the program is executed....
Write a program that takes two command line arguments at the time the program is executed. You may assume the user enters only decimal numeric characters. The input must be fully qualified, and the user should be notified of any value out of range for a 23-bit unsigned integer. The first argument is to be considered a data field. This data field is to be is operated upon by a mask defined by the second argument. The program should display...
Write a script named countmatches that expects at least two arguments on the command line. The...
Write a script named countmatches that expects at least two arguments on the command line. The first argument is the pathname of a dna file containing a valid DNA string with no newline characters or white space characters of any kind within it. (It will be terminated with a newline character.) This dna file contains nothing but a sequence of the bases a, c, g, and t in any order. The remaining arguments are strings containing only the bases a,...
Two different loads are fixed in a straight line on (or parallel to) the x axis,...
Two different loads are fixed in a straight line on (or parallel to) the x axis, and they are 39.1 m apart. The charge on the extreme right is Q2 = -16.2C, and the electric field at a distance 39.1 m to the right of Q2 is zero. What will be the magnitude of the charge Q1 (the one on the far left)? Select one: -3.24 C -32.40 C 64.80 C 08.10 C 32.40 C
Here are the tasks for this assignment: 1. Write a bash command line to determine if...
Here are the tasks for this assignment: 1. Write a bash command line to determine if the server 'syccuxfs01.pcc.edu' is reachable from the syccuxas01.pcc.edu server. 2. As you have read, TCP/IP messages are passed from one device to another until the message reaches its destination. Write a bash command line that will verify that no more than two (2) network devices are used to pass messages from the syccuxas01.pcc.edu server to the www.pcc.edu server. 3. Write a bash command line...
1). A car is moving along a straight line defined to be the positive x direction....
1). A car is moving along a straight line defined to be the positive x direction. Its velocity is measured and found to be a function of time given by Vx(t)=(alpha)t^2 , where alpha is a known constant. The car was at the point x = A at the time t = 2sec. Find the car's position as a function of time. How fast would the car be going just before it hits a wall located at x = L?...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT