Hi everybody, I'm trying to figure out how to write the full jacobian subroutine for a simple ODE system so I can integrate it with DASSL. The ODE system is: f(1) = -0....2 where, f(1) is dy(1)/dt f(2) is dy(2)/dt f(3) is dy(3)/dt where the jacobian elements are ( df(i)/dy(i) ): dfdy(1,1) = -0.04d0 dfdy(1,2) = 1d4*y(3) ...
...  xx(j)=xx0+epsilon  call gradient(n,xx,f,df)  h(:,j)=(df-df0)/epsilon  xx(j)=xx0 enddo Even without "oups" your Hessian would still be a numerical disaster. Look at Jacobian for a system of mxn eqns in netlib/minpack to see why, viz.    eps = sqrt(epsilon(h))    do  j = 1, n      tmp = x(j)  ...
...xx(j)  xx(j)=xx0+epsilon  call gradient(n,xx,f,df)  h(:,j)=(df-df0)/epsilon  xx(j)=xx0 enddo Even without "oups" your Hessian would still be a numerical disaster. Look at Jacobian for a system of mxn eqns in netlib/minpack to see why, viz.    eps = sqrt(epsilon(h))    do  j = 1, n      tmp = x(j)      h  ...
...> xx(j)=xx0+epsilon call gradient(n,xx,f,df) h(:,j)=(df-df0)/epsilon xx(j)=xx0 enddo Even without "oups" your Hessian would still be a numerical disaster. Look at Jacobian for a system of mxn eqns in netlib/minpack to see why, viz. eps = sqrt(epsilon(h)) do j = 1, n tmp = x(j) h = eps*abs(tmp) if (h...
...xx0=xx(j) xx(j)=xx0+epsilon call gradient(n,xx,f,df) h(:,j)=(df-df0)/epsilon xx(j)=xx0 enddo Even without "oups" your Hessian would still be a numerical disaster. Look at Jacobian for a system of mxn eqns in netlib/minpack to see why, viz. eps = sqrt(epsilon(h)) do j = 1, n tmp = x(j) h = eps*abs(tmp) if (h .eq. zero) h ...
..., 0.001K ... (about 1.d-8 max(X(i)). But this is usually to evaluate a jacobian matrix from a vector function computed with a relative precision of about 1.E-12 (1.E-15 is the... relative double precision but rounding errors lead to loose 2 or 3 orders). So each term of my jacobian matrix has 4 significant digits (as difference of two values very close together). Now this is a...
...temperature, 0.001K ... (about 1.d-8 max(X(i)). But this is usually to evaluate a jacobian matrix from a vector function computed with a relative precision of about 1.E-12 (1.E-15 is... relative double precision but rounding errors lead to loose 2 or 3 orders). So each term of my jacobian matrix has 4 significant digits (as difference of two values very close together). Now this is a little ...
... ! Just another remark : as the Hessian matrix is symmetrical (d/dxi(df/ dxj)=d/dxj(df/dxi)) the previous algorithm is not optimal. But I often use it for computing numerically the Jacobian matrix of a vector function (the gradient is a kind of vector function) in order to verify that a more efficient (but also much more complicated) version using formal derivatives has no mistake. ...
... is: (K^T S^(-1) K) x = K^T S^(-1) y where K is the Jacobian matrix. My confusion is that lmstr (and most similar non-linear least squares routines) all expect you to ... guess (overwritten with solution) y = data to fit fcn = function to evaluate F(x) and Jacobian matrix (dF/dx) It isn't obvious to me how to weight the data or write the model function '...
...is: (K^T S^(-1) K) x = K^T S^(-1) y where K is the Jacobian matrix. My confusion is that lmstr (and most similar non-linear least squares routines) all expect you to provide:... guess (overwritten with solution) y = data to fit fcn = function to evaluate F(x) and Jacobian matrix (dF/dx) It isn't obvious to me how to weight the data or write the model function '...