Question

In: Mechanical Engineering

a. Estimate the roots of the equation

a. Estimate the roots of the equation

TTX 2 - 3x + 5x sin 4 + 3 = 0 4

 

by plotting the equation.

b. Use the estimates found in part a to nd the roots more accurately with the fzero function.

Solutions

Expert Solution

Program plan:

a. To write a matlab code to find the roots of the equation by plotting the equation.

b. To find the roots with the help of ‘fzero’ function.

 

Program:

%**********************************************************

%A matlab code is written to find the roots of the given

%equation by plotting the equation. The roots are more

%accurately found with the help of ‘fzero’ function.

%**********************************************************

%Declaration of the array

x=-5:0.01:5;

%Anonymous function

f=@(x) x.^3-3.*x.^2+5.*x.*sin(pi.*x/4-5.*pi/4)+3;

%Function plot

plot(x,f(x));

%Command for creating array

grid on;

%Command for setting appropriate axes

axis([-2,5,-50,50])

%Displays text

disp(\'The roots are\');

%Finds the root near \'2\'

x1=fzero(f,2);

%Finds the root near \'0\'

x2=fzero(f,0);

%Finds the root near \'4\'

x3=fzero(f,4);

%Displays value

disp(x1);

%Displays value

disp(x2);

%Displays value

disp(x3);

 

Output (a):

 

Output (b):

>> untitled

The roots are

1.1346

-0.4795

3.8318


Output

>> untitled

The roots are

1.1346

-0.4795

3.8318

Related Solutions

Roots of a complex number Find all the solutions to the equation (a) z^ 4 −...
Roots of a complex number Find all the solutions to the equation (a) z^ 4 − 1 = 0 (b) z ^5 + 2^5 i = 0 (c) z^ 6 − 16z^ 3 + 128 = 0
Write a program to input the coefficients of a quadratic equation and solve roots for all...
Write a program to input the coefficients of a quadratic equation and solve roots for all cases (including complex roots). VBA. x=(b ^2) - (4ac) I have it for 2 complex and 2 real and repeated. Is that all cases?
Consider the the differential equation 2xy''+ 5y'+xy= 0 1) determine the indicial equation and its roots...
Consider the the differential equation 2xy''+ 5y'+xy= 0 1) determine the indicial equation and its roots 2) For each root of the indicial equation, determine the recurrence relation 3) Do the indicial roots differ by an integer? If yes, find the general solution on (0,∞). If not, find the series solution corresponding to the larger root on (0,∞)
Find the roots of the following equation in [−π, π] 2x 2 − 4 cos(5x) −...
Find the roots of the following equation in [−π, π] 2x 2 − 4 cos(5x) − 4x sin x + 1 = 0 by using the Newton’s method with accuracy 10^(−5) . how do I solve this using a computer
use Java The two roots of a quadratic equation ax^2 + bx + c = 0...
use Java The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula: r1 = (-b + sqrt(b^2 - 4ac)) / (2a) and r2 = (-b - sqrt(b^2 - 4ac)) / (2a) b^2 - 4ac is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no...
use muller's method to find the roots of the equation f(x) = sin x - x/2...
use muller's method to find the roots of the equation f(x) = sin x - x/2 =0 near x=2
Use Newton's method to find all real roots of the equation correct to six decimal places....
Use Newton's method to find all real roots of the equation correct to six decimal places. (Enter your answers as a comma-separated list.) 8/x = 1 + x^3
1. The equation 8?2 − 3?? = 0 has three roots. Find: (i) The first root,...
1. The equation 8?2 − 3?? = 0 has three roots. Find: (i) The first root, which is between -1 and 0, by the bisection method; (ii) The second root, which is between 1 and 2, by Newton’s method; (iii) The third root, which is between 3 and 4, by both the bisection method and Newton’s method. All the answers should be correct to 2 decimal places.
Study the roots of the nonlinear equation f(x) = cos(x) + (1 /(1 + e^2x)) both...
Study the roots of the nonlinear equation f(x) = cos(x) + (1 /(1 + e^2x)) both theoretically and numerically. (a) Plot f(x) on the interval x ∈ [−15, 15] and describe the overall behaviour of the function as well as the number and location of its roots. Use the “zoom” feature of Matlab’s plotting window (or change the axis limits) in order to ensure that you are identifying all roots – you may have to increase your plotting point density...
2. The Drake Equation: (a) What, exactly, does the Drake Equation estimate? (b) If you are...
2. The Drake Equation: (a) What, exactly, does the Drake Equation estimate? (b) If you are like Frank Drake or Carl Sagan, you are an optimist who believes that the development of life, intelligence, and technological civilizations are not "vanishingly small", but are typical. That is, that what happened on earth is not rare. Explain them why Drake and Sagan would say that "N=L" is a good approximation to the Drake Equation.  
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT