Question

In: Mechanical Engineering

Plot the function y = 10(1 = e-x/4) over the interval 0 ≤ x ≤ xmax, using a while loop to

Plot the function y = 10(1 = e-x/4) over the interval 0 ≤ x ≤ xmax, using a while loop to determine the value of xmax such that y(xmax) = 9.8.

Properly label the plot. The variable y represents force in newtons, and the variable x represents time in seconds.

Solutions

Expert Solution

= 0;

x_max = 0;

% infinite loop

while true

   

    % calculate y

    y = 10 *\r\n( 1 - exp(\r\n-/ 4 )\r\n);

   

    % is the current value of x is the required xmax

    if y >= 9.8

       

        x_max = x;

        break;

       

    end

   

    x = x + 0.01;

   

end

% create a vector x

=\r\n[ 0 : 0.01 : x_max ];

% create a vector y

= 10 .*\r\n( 1 - exp(\r\n-./ 4 )\r\n);

% set the title of the axis

title(\'Plot y = 10( 1 - exp(-x / 4) )\');

% set the label of the axis

xlabel(\'x\');

ylabel(\'y\');

grid on

hold

% plot the graph

plot( x , y );

 

Output:-


= 0;

x_max = 0;

% infinite loop

while true

Related Solutions

Use a for loop to plot the function given in Problem 16 over the interval -2 ≤ x ≤ 6. Properly label
Use a for loop to plot the function given in Problem 16 over the interval -2 ≤ x ≤ 6. Properly label the plot. The variable y represents height in kilometers, and the variable x represents time in seconds.
Find y as a function of x if y(4)−12y‴+36y″=−512e-2x y(0)=−1,  y′(0)=10,  y″(0)=28,  y‴(0)=16 y(x)=
Find y as a function of x if y(4)−12y‴+36y″=−512e-2x y(0)=−1,  y′(0)=10,  y″(0)=28,  y‴(0)=16 y(x)=
Solve the IVP using Laplace transforms x' + y'=e^t -x''+3x' +y =0 x(0)=0, x'(0)=1, y(0)=0
Solve the IVP using Laplace transforms x' + y'=e^t -x''+3x' +y =0 x(0)=0, x'(0)=1, y(0)=0
use a matlab built-in function to numerically solve: dy/dx= -x^2+((x^3*e^-y)/4) for 1<=x<=5 with y(1)=1 plot the...
use a matlab built-in function to numerically solve: dy/dx= -x^2+((x^3*e^-y)/4) for 1<=x<=5 with y(1)=1 plot the solution
Solve the cauchy problem (x^2)*y''-9*x*y'+21*y=0, y'(1)=5 on the interval (1,3). Plot the graphs of y(x) and...
Solve the cauchy problem (x^2)*y''-9*x*y'+21*y=0, y'(1)=5 on the interval (1,3). Plot the graphs of y(x) and y'(x) Please Provide only MATLAB Code.
f(x,y)=30(1-y)^2*x*e^(-x/y). x>0. 0<y<1. a). show that f(y) the marginal density function of Y is a Beta...
f(x,y)=30(1-y)^2*x*e^(-x/y). x>0. 0<y<1. a). show that f(y) the marginal density function of Y is a Beta random variable with parameters alfa=3 and Beta=3. b). show that f(x|y) the conditional density function of X given Y=y is a Gamma random variable with parameters alfa=2 and beta=y. c). set up how would you find P(1<X<3|Y=.5). you do not have to do any calculations
Show that this function has a positive maximum on the interval 0<_x_<1: f(x)=x(x-1)e^x
Show that this function has a positive maximum on the interval 0<_x_<1: f(x)=x(x-1)e^x
For f(x,y)=cxy, ? ≥ 0, ? ≥ 0, ? + ? ≤ 1, Determine E(Y|x) and...
For f(x,y)=cxy, ? ≥ 0, ? ≥ 0, ? + ? ≤ 1, Determine E(Y|x) and E(X|y)
If X is uniformly distributed over (0, 1), find the fY (t) and E(Y ) of...
If X is uniformly distributed over (0, 1), find the fY (t) and E(Y ) of (a) Y = e X. (b)Y = − ln(X) (c) Y = cos(πX) (d)Y = sin(πX)
2. Let X be a uniform random variable over the interval (0, 1). Let Y =...
2. Let X be a uniform random variable over the interval (0, 1). Let Y = X(1-X). a. Derive the pdf for Y . b. Check the pdf you found in (a) is a pdf. c. Use the pdf you found in (a) to find the mean of Y . d. Compute the mean of Y by using the distribution for X. e. Use the pdf of Y to evaluate P(|x-1/2|<1/8). You cannot use the pdf for X. f. Use...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT