Question

In: Computer Science

Plot the function y = 10 *(1 -exp(x/4)) over the interval 0 <x < xmax ,...

Plot the function y = 10 *(1 -exp(x/4)) over the interval 0 <x < xmax , using a for loop to determine the value of xmax such that y(xmax)=9.8. Properly label the plot. variable y is represents force in Newtons , and x represents time in second.

Solutions

Expert Solution

Matlab Code for the problem with plot obtained is provided below:

Code:

%set the initial x value
xval=0;

%the for loop to find the correct value of x
%that satisfies Y(x)= 9.8
%the loop iterate 200 times
for i= 1:1:200
%initialize the x vector with initial value of x
x(i)=xval;
  
%find the y value
%the y function should be y = 10 *(1 -exp(-x/4)) to get a
%positive x such that y(x)=9.8
yval= 10 *(1 - exp(-xval/4));
  
%add the y value to the y vector
y(i)=round(yval,1);
  
%if satisfied the requirement
if y(i)==9.8
%print the xmax and break
fprintf("The value of xmax = %f",xval)
break;
end
  
%update the x value
xval=xval+0.1;
end

%plot x,y
plot(x,y)
xlabel('Time (seconds)')
ylabel('Force (Newtons)')

Output:

Code screenshot:


Related Solutions

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.
Given Fxy(x,y)=u(x)u(y)[1-Exp(-x/2)-Exp(-y/2)+Exp(-(x+y)/2)]. Note: The step functions mean that Fxy(x,y)=0 for either or both x<0 and y<0....
Given Fxy(x,y)=u(x)u(y)[1-Exp(-x/2)-Exp(-y/2)+Exp(-(x+y)/2)]. Note: The step functions mean that Fxy(x,y)=0 for either or both x<0 and y<0. Any x or y argument range below zero must be truncated at zero. Determine: a) P{X<=1,Y<=2} Ans: 0.2487 b) P{0.5<X<1.5} Ans: 0.3064 c) P{-1.5<X<=2, 1<Y<=3} Ans: 0.2423
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 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.
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...
Expand the function, f(x) = x, defined over the interval 0 <x <2, in terms of:...
Expand the function, f(x) = x, defined over the interval 0 <x <2, in terms of: A Fourier sine series, using an odd extension of f(x) and A Fourier cosine series, using an even extension of f(x)
4. The joint density function of (X, Y ) is f(x,y)=2(x+y), 0≤y≤x≤1 . Find the correlation...
4. The joint density function of (X, Y ) is f(x,y)=2(x+y), 0≤y≤x≤1 . Find the correlation coefficient ρX,Y . 5. The height of female students in KU follows a normal distribution with mean 165.3 cm and s.d. 7.3cm. The height of male students in KU follows a normal distribution with mean 175.2 cm and s.d. 9.2cm. What is the probability that a random female student is taller than a male student in KU?
Find y as a function of x if y′′′−11y′′+30y′=0 y(0)=7,  y′(0)=9,  y′′(0)=4.
Find y as a function of x if y′′′−11y′′+30y′=0 y(0)=7,  y′(0)=9,  y′′(0)=4.
Find y as a function of x if y^(4)-6y'''+9y''=-200e^(-2x) y(0)=17 y'(0)=7 y''(0)=1 y'''(0)=16
Find y as a function of x if y^(4)-6y'''+9y''=-200e^(-2x) y(0)=17 y'(0)=7 y''(0)=1 y'''(0)=16
Find y as a function of x if y''''−4y'''+4y''=−128e^{-2x} y(0)=2,  y′(0)=9,  y″(0)=−4,  y‴(0)=16. y(x)=?
Find y as a function of x if y''''−4y'''+4y''=−128e^{-2x} y(0)=2,  y′(0)=9,  y″(0)=−4,  y‴(0)=16. y(x)=?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT