Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Numerical Calculation of Jacobian MATLAB V5

446 views
Skip to first unread message

prit...@math.montana.edu

unread,
Dec 4, 1997, 3:00:00 AM12/4/97
to prit...@math.montana.edu

I am using ode23s to solve a system of non-linear ODEs. I would like to
calculate the Jacobian at a steady-state solution of this system.

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

Mark Reichelt

unread,
Dec 9, 1997, 3:00:00 AM12/9/97
to

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 =====================

0 new messages