Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the quartic equation x4 +ax3 +bx2 +cx1=0, (1) where a, b, and c are rea

ID: 3795846 • Letter: C

Question

Consider the quartic equation x4 +ax3 +bx2 +cx1=0, (1)

where a, b, and c are real input coefficients. Develop a matlab program to find all roots of equation (1) using the methods discussed in class. for example: Bisection method, Newton Method or Hornor's method Your program can not use the matlab built-in functions fzero, roots, eig, and eigs.

You should turn in a .m file quarticxxx.m which contains a matlab function of the form function [rts] = quarticxxx(C)

where xxx is your student id, C = (a, b, c) is the input vector of coefficients, and rts is the vector of roots;

Your program will be stress-tested against typical and pathological quartic equations:

1. (40 points) equations with random C;

2. (30 points) equations with very large C; or

3. (30 points) equations with double roots or nearly double roots; or

You will receive partial credit for each correct root (accurate to within a relative error of at most 105, as compared to the roots function in matlab) receive additional credit. Your program will receive 0 points if the strings fzero, roots or eig (all lower case) show up anywhere in your .m file.

Explanation / Answer

function [ rts ] = quarticxxx( C)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here

a = C(1);
b= C(2);
c=C(3);
p1 = 2*b^3 -9*a*b*c +27*c^2 -27*a^2 +72*b ;
p2 = p1 + sqrt(-4*(b^2-3*a*c-12)^3+p1^2);
p3 = (b^2-3*a*c-12)/(3*nthroot(p2/2,3)) +nthroot(p2/2,3)/3;
p4 = sqrt((a^2)/4 - 2*b/3 +p3);
p5 = (a^2)/2 -4*b/3 -p3;
p6 = (-(a^3)+4*a*b-8*c)/(4*p4);

x1 = -a/4 -p4/2 -(sqrt(p5-p6))/2;
x2 = -a/4 -p4/2 +(sqrt(p5-p6))/2;
x3 = -a/4 +p4/2 -sqrt(p5+p6)/2;
x4 = -a/4 +p4/2 + sqrt(p5+p6)/2;
rts = [x1, x2, x3,x4];


end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote