i need the answer to be on a MatLab window
A)
PLEASE REFER BELOW CODE
close all
clear all
clc
%given expression
%A)
t = 0:0.1:2; %taking range of t from 0 to 2 with increment of
0.1
c = 3 . t . exp(-0.4 * t); %given expression
plot(t,c);
title('t vs c');
xlabel('time(t)');
ylabel('concentration(c)');
index = find((c-2) <= 0.00);
fprintf('Number of times concentration is 2 mg/ml = %d\n',
length(index));
PLEASE REFER BELOW OUTPUT
Number of times concentration is 2 mg/ml = 10
>>
B) PLEASE REFER BELOW CODE:
close all
clear all
clc
%2) Secant method
%a=input('Input expression : ','s');
%f=inline(a);
f = @(t) ( 3 t exp(-0.4 * t))
%at t = 0;
t(1)= 3 0 exp(-0.4 * 0);
%at t = 2;
t(2)=3 2 exp(-0.4 * 2);
n = 10^-3;
iteration=0;
for i=3:1000
t(i) = t(i-1) - (f(t(i-1)))*((t(i-1) - t(i-2)) ./(f(t(i-1)) -
f(t(i-2))));
iteration=iteration+1;
if abs((t(i)-t(i-1))./t(i)) < n
root=t(i)
iteration=iteration
break
end
end
f =
function_handle with value:
@(t)(3*t*exp(-0.4*t))
>>
.....................................................................THE END.......................................................................
i need the answer to be on a MatLab window 1. Consider the following equation, which...
1. This question concerns finding the roots of the scalar non-linear function f(x) = r2-1-sinx (1 mark) (b) Apply two iterations of the bisection method to f(x) 0 to find the positive root. (3 marks) (c) Apply two iterations of the Newton-Raphson method to find the positive root. Choose (3 marks) (d) Use the Newton-Raphson method and Matlab to find the positive root to 15 significant (3 marks) (a) Use Matlab to obtain a graph of the function that shows...
In MATLAB please
Consider the nonlinear function: y = f(x) = x3 cos x a. Plot y as a function of x as x is varied between -67 and 67. In this plot mark all the locations of x where y = 0. Make sure to get all the roots in this range. You may need to zoom in to some areas of the plot. These locations are some of the roots of the above equation. b. Use the fzero...
please show answer in full with explanation, also show
matlab
1. Consider the function f(x)2.753 +18r2 21 12 a) Plot the graph of f(x) in MATLAB and find all the roots of the function f(x) graphically. Provide the code and the plot you obtained. b) Compute by hand the first root of the function with the bisection method, on the interval -1; 0) for a stopping criterion of 1% c) How many iterations on the interval -1, 0 are needed...
using Matlab: A drug administered to a patient produces a concentration in the bloodstream given by c(t)=Ate^(-t/3) milligrams per milliliter, t hours after A units have been injected. The maximum safe concentration is 1.00 mg/mL. What amount should be injected to reach this maximum safe concentration, and when does this maximum occur? (Use calculus to find the time when a maximum occurs. Then set c(tmax) = 1 to solve for A.) An additional amount of this drug is to be...
question 3 please
The first 5 questions refer to finding solutions to the equation exp(w) = 3.8 ln(1+x). You will need to write it in the form f(x)-0, and use various root finding methods. 1. (10 pts) Plot the curves y- exp(Vx), and y 3.8 ln(1+x) on the same graph in the range 0 x 6. Read off intervals in which there are roots of the equation exp(k)- 3.8 In(1+x) Now find the roots to 6 decimal places using the...
Questions: 1. Write a MATLAB program to find all the roots of a given, twice continuously differentiable, function f E C2[a, b]. Your program should first probe the function f(x) on the given interval to find out where it changes sign. (Thus, the program has, in addition to f itself, four other input arguments: a, b, the number nprobe of equidistant values between a and b at which f is probed, and a tolerance tol.) For each subinterval [ai,b] over...
Write a Matlab function for: 1. Root Finding: Calculate the root of the equation f(x)=x^3 −5x^2 +3x−7 Calculate the accuracy of the solution to 1 × 10−10. Find the number of iterations required to achieve this accuracy. Compute the root of the equation with the bisection method. Your program should output the following lines: • Bisection Method: Method converged to root X after Y iterations with a relative error of Z.
[MATLAB Coding] A four-bar linkage system is shown above. The
first link, a, is an input link (crank) of length 1. The second
link, b, is a coupler link of length 2. The third link, c, is an
output link of length 4. The forth link, d, is the fixed link
(ground) of length 5. All lengths are provided in metres. Please
answer the whole question in MATLAB coding.
4 A four-bar linkage system is shown above. The first link,...
13. Write a MATLAB program to find all the roots of a given, twice continuously differentiable, function f e C2la,b]. on the given interval to find out where it Your program should first probe the function f(x) changes sign. (Thus, the program has, in addition to f itself, four other input arguments: a, b, the number nprobe of equidistant values between a and b at which f is probed, and a tolerance tol.) For each subinterval [a,b;] over which the...
DO THIS IN MATLAB PLEASE
DO THIS IN MATLAB
Create a script file that performs the following calculations. Your script will use the functions you create. Label all graphs appropriately. For this project, do not have your homemade functions fprintf anything, instead have all your fprintf commands within your script. Attach your published script file along with .m files for your functions. Exercise 1. A fundamental iterative method for finding the roots of equations of one-variable is known as Newton's...