Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with this question by using matlab to successfully run it as a different coding method than what I post it.Add the comment

Please help me with this question by using matlab to successfully run it as a different coding method than what I post it.Add the comment thank you for your help

image text in transcribed

image text in transcribed

4. 25 Points) Solve a system of nonlinear equations using Newton's method. y - cosh(x) = 0 and rFy- 2 = 0 Plot the x - y curves for each equation. Filename - newton_nonlinear.m function (root) = newton_nonlinear(F. dF, XO) % F - List of Functions % dF - List of First Derivatives % X - Initial Guess thresh - 1e-6; % Error Threshold k= length(F); % Number of Variables/Functions error = sum(abs(FIXO)); % Error calculated as sum of both the functions (ideally should be ) X = XO: i = 1; while error > thresh fprintf("Iteration %d : 1); dX = -dF(X) F(X); X=X+ DX; i=i+1; error = sum(abs(F(X))); end root = X; end Here is the script to run the code- XO = (0.5 0.5): % (x,y) F= @(x)[X(2)-cosh(x(1)); x(1).^2 + x(2).^2 - 2]; dF = @(x)[-sinh(x(1)) 1: 2*x(1) 2*x(2)]; root = newton_nonlinear(F. dF, XO); fprintf("Root = (%f, %f) In" root(1), root(2)); ezplot('y-cosh(x)=0'); hold on: ezplot('x^2 + y^2-2=0'); Comment >

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions