Fix Secant method bounds between two positive values
Ältere Kommentare anzeigen
Hi,
I am using Secant Mehtod to find roots of a system of nonlinear algebraic equations. all the x[i] varibales should be at specific range, for instance, [0 50]. My question is how to set the lower and upper bounds when we know x[i] is loacted between lower and upper values?
In Secant Method, after 4 iteration, the new x becomes negative. Is there any way to avoid the bounds?
It would be appreciated if you comment on these question.
Thank you.
2 Kommentare
Geoff Hayes
am 9 Jun. 2019
sina - you may need to show some of the code that you have written so that we can get an idea of how you have implemented this algorithm.
sina
am 9 Jun. 2019
Antworten (1)
Walter Roberson
am 9 Jun. 2019
lb = 0; ub = 50;
x(1) = lb;
x(2) = ub;
while ...
newx = ...
if newx < lb; newx = lb; end
if newx > ub; newx = ub; end
x(K) = newx;
end
1 Kommentar
sina
am 9 Jun. 2019
Kategorien
Mehr zu Dynamic System Models finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!