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

Can you write for question 3 matlab code? Can you write for question 3 matlab co

ID: 3184900 • Letter: C

Question

Can you write for question 3 matlab code? Can you write for question 3 matlab code? 4. You shall give a numerical analysis. Namely, for the first and third questions take at least two different initial values and compare the results. Assume that your student ID number is ". . . . . . "ab", then set the numbers A = 0.ab and B = 3* (0.ab). For example, if your ID number is 15", then set the numbers A 0.15 and B 0.45 You are supposed to bring the file that contains solutions, the implementation and its output to my office. Also submit your implementations to ausazaklioglu@thk.edu.tr by writing your name and student ID as the topic of the message Instructor: Lect. Ali Ugur Sazakholu Q1) Find a root of the equation with the termination criteria = 10-8 % applying the Newton-Raphson method. (If a = 0, then take a = 1 for this question only.) Q2) Solve the following system of algebraic equations by modified Gauss climination method: uo + t 11 18, 2124 + u25 = 12, where ak = k * A, ck =2*k*A,bk unknowns. 3*k*A,pk =-4 * k * B, 1

Explanation / Answer

matlab code

close all
clear
clc

% ID = 15

% Question 1
syms x;
f(x) = [exp(2*x)+5*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)+5-3*x^2];
res = res - double(func(res))/func_d;
if abs(x_ - res) < tol
break;
end
end
end

output

x =
-0.1491

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