I have been trying to use the 'numjac' command on simple non-linear
systems, and I am confused about the FAC argument in the command and
output.For example, I have in the m-file 'test.m'
function dy=test(t,y)
A(1,1)=y(1,1)*y(2,1);
A(2,1)=y(1,1)^2+y(2,1)^2;
dy=A;
when I set T=0, Y=[1;0] FTY=[0;1]] THRESH=[1e+2,1e+2] VECTORIZED=0 FAC=[]
and type in the command
[DFDY,FAC] = numjac('test',T,Y,FTY,THRESH,FAC,VECTORIZED)
I get the following output
DFDY =
0 1
2 0
FAC =
1.0e-09 *
0.1490
0.0062
What is FAC? And why should it be set to [] initially? Is it some kind of
error estimate?
L.A. Pritchett
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
The numjac code is a helper function used to generate Jacobians for
the stiff solvers of the MATLAB ODE Suite, and as such is tailored to
the ODE solving environment. When solving ODE's it is common to
evaluate the Jacobian repeatedly at operating points that don't vary
much. The fac array is an adaptive parameter that determines how much
of a perturbation is appropriate for each element.
When you call numjac the first time (with fac = []) this is a flag to
the code to reset to the default value. A new value of fac is passed
back by this call to numjac, and repeated calls may change it further.
For more information about the strategy you can look at D.E. Salane,
"Adaptive Routines for Forming Jacobians Numerically", SAND86-1319,
Sandia National Laboratories, 1986.
--
==== Mark Reichelt ========================= m...@mathworks.com ===
The MathWorks, Inc. in...@mathworks.com
24 Prime Park Way http://www.mathworks.com
Natick, MA 01760-1500 ftp.mathworks.com
==== Tel: 508-653-1415 === Fax: 508-653-2997 =====================