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

Can use Fixed Point, Newton(Secant), Muller, Bisection or Honor Methods Consider

ID: 3890426 • Letter: C

Question

Can use Fixed Point, Newton(Secant), Muller, Bisection or Honor Methods

Consider the quartic equation where a, b, and c are real input coefficients. Devel equation (1) using the methods discussed in class. Your program can not use the matlab built-in functions fzero, roots, eig, and eigs lop a matlab program to find all roots of 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 Your program will receive 0 points if the strings fzero, roots or eig (all lower case) show up most 10-5, as compared to the roots function in matlab) receive additional credit anywhere in your .m file

Explanation / Answer

We can calculate the quadratic roots using fixed-point iteration method as shown below:

% The Simple Fixed-Point Iteration method

% This function is to find the
% nontrivial root of the equation
% f(x) = x^4 + a*x^3 + b*x^2 + c*x - 1
% considering f(x) = 0
% x^4 + a*x^3 + b*x^2 + c*x - 1 = 0
% c*x = 1 - x^4 - a*x^3 - b*x^2
% x = (1 - x^4 - a*x^3 - b*x^2) / c
% x = g(x)
% Iterating till roots get converged
function rts = quarticxxx(a,b,c)
x = 1.0; %initial guess
tol = 0.1; %tolerance
abserr = 1000; %randomly large approx error
relerr = abserr;
xold = x;   
n = 0; %iteration counter

% if errors are less than tolerance then stop
% otherwise calculate next root value
while (abserr > tol) & (relerr > tol)
x = (1 - x^4 - a*x^3 - b*x^2)/c;
abserr = abs(x-xold);
relerr = abserr/( abs(x)+eps );
x
xold = x;
n = n + 1;
end

x %the root
n %number of iterations
rts = x;
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