Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I need help understanding this test file and how to use the modified secant method with it. Can someone explain what a(1) is referring to? and how can i use modified secant?

1 vue (au cours des 30 derniers jours)
Bryce
Bryce le 30 Sep 2024
Clôturé : John D'Errico le 30 Sep 2024
% This program is to test the Modified Secant for systems of equations
% section of your function.
h1 = @(a) a(1) + a(2) - 2;
h2 = @(a) a(1)*a(3) + a(2)*a(4);
h3 = @(a) a(1)*(a(3)^2) + a(2)*(a(4)^2) - 2/3;
h4 = @(a) a(1)*(a(3)^3) + a(2)*(a(4)^3);
handles = {h1, h2, h3, h4};
c_and_x_init = [0.5, -2, -0.25, 0.25];
% Should converge to
% c_and_x = [1, 1, 0.577350269189, -0.577350269189]
% or
% c_and_x = [1, 1, -0.577350269189, 0.577350269189]
c_and_x_final = KahunaB_Lab4(handles, c_and_x_init, 0.0000001)
  1 commentaire
John D'Errico
John D'Errico le 30 Sep 2024
You need to write the code to do modifed secant mathod. Surely that was discussed in class. So look in your notes. Or look online.
Surely you can find a link for pseudo-code for modified secant method. In fact, if you look, I'd bet you can find MATLAB code.
a is assumed to be a vector of length 4. a(1) refers to the FIRST element of a. If this is a surprise to you, then you strongly NEED to spend time doing the MATLAB Onramp tutorial.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by