The roots of a cubic equation ax'+a,x² +ax +a, =0_can be calculated using the following procedure: Set: A=az /a3, B=a\/a3, and C = a, / a 3. Calculate: D=Q' +R° , where Q = (3B – A²)/9 and R=(9AB– 27C – 2.4°) / 54 . If D>0 the equation has complex roots. If D=0 all roots are real and at least two are equal. The roots are given by:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

use Matlab to solve this 

The roots of a cubic equation azx'+a,x² +ax +a, =0 _can be calculated
using the following procedure:
Set: A =az /a3, B=a¡/a3, and C =a,/az.
Calculate: D =Q³ +R° ,
where Q = (3B – A²)/9 and R=(9AB– 27C – 24°) / 54 .
If D>0 the equation has complex roots.
If D=0 all roots are real and at least two are equal. The roots are given by:
x = 2R – A / 3, xr, = -R-A/3, and x; = -R- AI3.
If D<0 all roots are real and are given by:
x1 = 21 -Q cos(0 / 3) – A / 3, x, = 2/ -Q cos(0 /3 + 120°) – A / 3, and
x3 = 2 -Q cos(0 / 3 +240°) – A / 3 , where cos 0 = R / -Q³.
Write a MATLAB program that determines the real roots of a cubic equa-
tion. As input the program asks the user to enter the values of a3, az, a1, and
a, as a vector. The program then calculates the value of D. If the equations
have complex roots, the message "The equation has complex roots" is dis-
played. Otherwise the real roots are calculated and displayed. Use the pro-
gram to solve the following equations:
5x + - 34.5x +36.9x +8.8 =0
(b) 2x + – 10x² +24x – 15 =0
(a)
2x + – 1.4x – 20.58x + 30.87 =0
(c)
Transcribed Image Text:The roots of a cubic equation azx'+a,x² +ax +a, =0 _can be calculated using the following procedure: Set: A =az /a3, B=a¡/a3, and C =a,/az. Calculate: D =Q³ +R° , where Q = (3B – A²)/9 and R=(9AB– 27C – 24°) / 54 . If D>0 the equation has complex roots. If D=0 all roots are real and at least two are equal. The roots are given by: x = 2R – A / 3, xr, = -R-A/3, and x; = -R- AI3. If D<0 all roots are real and are given by: x1 = 21 -Q cos(0 / 3) – A / 3, x, = 2/ -Q cos(0 /3 + 120°) – A / 3, and x3 = 2 -Q cos(0 / 3 +240°) – A / 3 , where cos 0 = R / -Q³. Write a MATLAB program that determines the real roots of a cubic equa- tion. As input the program asks the user to enter the values of a3, az, a1, and a, as a vector. The program then calculates the value of D. If the equations have complex roots, the message "The equation has complex roots" is dis- played. Otherwise the real roots are calculated and displayed. Use the pro- gram to solve the following equations: 5x + - 34.5x +36.9x +8.8 =0 (b) 2x + – 10x² +24x – 15 =0 (a) 2x + – 1.4x – 20.58x + 30.87 =0 (c)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY