Newton-Raphson method with linear constraints

버전 1.1 (13 KB) 작성자: Michael Mauersberger
Implementation of the Newton-Raphson method with linear constraints, increment damping and additional sweep points
다운로드 수: 31
업데이트 날짜: 2023/12/19

newtRaph.m

A Matlab implementation of the Newton-Raphson method with linear constraints

(c) Michael Mauersberger 2021 (v0.1), 2023 (v1.0, v1.1), LGPL License v2.1

Newton-Raphson method with constraints for finding function roots. Damping coefficient helps to find a feasible solution. Number of sweep points help to set a new initial searching point on the axis between the minimum and maximum of the domain. Search ends if function tolerance or argument tolerance has been reached. Linear constraints are applied in the form A*x <= b via writing back the arguments to the constraint (done by means of QR decomposition and a pseudo-inverse).

References:

Wikipedia - "Newtonverfahren" (German), "Newton's method" (English)

View NewtRaphConMatlab on File Exchange

Examples

Damping coefficient

[xVal,fVal,it,ex] = newtRaph(@(x)(x.^3-2*x+2),0,[],[],[],[],1e-10,1e-10,100,.0,'cent',1e-10,2)
xVal = 8.2740e-08
fVal = 2.0000
it = 100
ex = -2

[xVal,fVal,it,ex] = newtRaph(@(x)(x.^3-2*x+2),0,[],[],[],[],1e-10,1e-10,100,.2,'cent',1e-10,2)
xVal = -1.7693
fVal = 7.6439e-11
it = 24
ex = 0

Linear constraint

[xVal,fVal,it,ex] = newtRaph(@(x)(5*(x(1)+1)^2+x(2)^2-2*x(2)),[0 1],[],[],[],[],1e-10,1e-10,100,.2,'forw',1e-10,2)
xVal = [-0.5528  1.0000]
fVal = 8.3129e-11
it = 16
ex = 0

[xVal,fVal,it,ex] = newtRaph(@(x)(5*(x(1)+1)^2+x(2)^2-2*x(2)),[0 1],[],[],[-1 -1],[-.8],1e-8,1e-10,100,.2,'forw',1e-10,2)
xVal = [-0.5878  1.3878]
fVal = 8.1014e-09
it = 64
ex = 0

Number of sweep points

[xVal,fVal,it,ex] = newtRaph(@(x)((x.^2-3)*(x-1)-5*exp(-100*(x+.5)^2)),0,-1,0,[],[],1e-8,1e-10,100,.2,'cent',1e-10,2)
xVal = -2.6000
fVal = 4.0000
it = 3
ex = -2

[xVal,fVal,it,ex] = newtRaph(@(x)((x.^2-3)*(x-1)-5*exp(-100*(x+.5)^2)),0,-1,0,[],[],1e-8,1e-10,100,.2,'cent',1e-10,4)
xVal = -0.4544
fVal = 7.1891e-09
it = 20
ex = 0

인용 양식

Michael Mauersberger (2026). Newton-Raphson method with linear constraints (https://github.com/m-mauersberger/NewtRaphConMatlab/releases/tag/v1.1), GitHub. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2022a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
버전 게시됨 릴리스 정보
1.1

See release notes for this release on GitHub: https://github.com/m-mauersberger/NewtRaphConMatlab/releases/tag/v1.1

1.0

See release notes for this release on GitHub: https://github.com/m-mauersberger/NewtRaphConMatlab/releases/tag/v1.0

0.9

이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.