Can you write a cod of three questions in matlab or Java ? a=1 b=6 A=0.16 B=0.48
ID: 3184915 • Letter: C
Question
Can you write a cod of three questions in matlab or Java ? a=1 b=6 A=0.16 B=0.48 Q1) Find a root of the equation with the termination criteria e = 10 s % applying the Newton-Raphson method. (If a for this question only) 0, then take a = 1 Q2) Solve the following system of algebraic equations by modified Gauss elimination method: uo +u - 18 ( u24 + u25 = 12, where ak = k * A, ck = 2 * k * A, bk = 3 * k * A, un knowns. =-4 * k* B, 1 k 24. As the output give the vector of Q3) Solve the system by the fixed-point and Seidel's iteration methods with the following termination criterias given in the table Moreover, write the number of iterations needed in the following table Fixed-point iteration method Seidel's iteration methodExplanation / Answer
matlab code
close all
clear
clc
% Question 1
syms x;
f(x) = [exp(2*x)+6*x-x^3];
ic = [0];
tol = 1e-8;
res = my_newton(f,ic,tol);
x = res
function res = my_newton(func,ic,tol)
res = ic;
h = 1e-6;
while true
x_ = res;
x = x_;
func_d = [2*exp(x)+6-3*x^2];
res = res - double(func(res))/func_d;
if abs(x_ - res) < tol
break;
end
end
end
output
x =
-0.1291
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.