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,∞)
Draw a flowchart that will calculate the roots of a quadratic equation. (java) Can someone draw...
Draw a flowchart that will calculate the roots of a quadratic equation. (java) Can someone draw it for me? and at same time explain,
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
Find Roots of a Quadratic Equation Step 1: Analyze the Problem Accept three coefficients a, b,...
Find Roots of a Quadratic Equation Step 1: Analyze the Problem Accept three coefficients a, b, and c (all of data type double) of a quadratic equation: ax2+bx+c=0 Output real roots (double) of the equation Step 2: Develop a Solution Check for degenerate case (user enters 0 for both a and b), no solution Check if the equation is linear (user enters 0 for a), x = -c/b Calculate the discriminant = b2-4ac (obviously, the data type will be double)...
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT