Damped Gauss Newton iteration (how to extend a given matrix)

3 ビュー (過去 30 日間)
Christoffer Thornvall
Christoffer Thornvall 2015 年 11 月 6 日
コメント済み: Image Analyst 2015 年 11 月 6 日
Hi so I've ran in to a problem I was wondering if someone could help me resolve. This is my script:
tvec = [0 0.2 0.4 0.6 0.8]'; Pvec = [5.1 5.9 6.4 7.5 8.3]';
F =@(x) x(1)*(exp(x(2).*tvec)) - Pvec;
dFdP0 = @(x) exp(x(2).*tvec);
dFdr = @(x) x(1).*tvec*exp(x(2)).*exp(tvec);
J =@(x) [dFdP0(x), dFdr(x)]; % Jacobianen
x = [5.1 0.5274]'; %[P0. r]
tolerans = 1e-8; [xm,countm] = GaussNewton(F,J,x,tolerans)
And my function:
function [x,count] = GaussNewton1(F,J,x,tolerans)
hnorm = 1;
count = 0;
L = 10
L = L^0.5;
n = size(x)
m = zeros(n,1)
I = eye(n,n)
I = I*L
while (hnorm > tolerans && count<100)
h = J(x)\F(x);
hnorm = norm(h, inf);
x=x-h;
count = count+1;
end
What I wanna do is add write something that looks like (J(x);I)\(F(x);m) but I don't know how to do this in matlab code. Like I wanna extend my jacobian with the I and my F with a column vector of m zeros. Any ideas?
/// Christoffer

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

タグが未入力です。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by