LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getJacobian.m
1function [J, rhs, vars, equilibria] = getJacobian(self, options)
2% [J, RHS, VARS, EQUILIBRIA] = GETJACOBIAN(OPTIONS)
3%
4% Jacobian of the mean-field ODE right-hand side, d f_i / d x_j, as a cell
5% matrix of expression strings, computed exactly by the computer algebra
6% backend (see SAGE.m).
7%
8% The Jacobian is what tells a fixed point apart from a limit cycle and gives
9% the local convergence rate of the fluid approximation, neither of which a
10% numerical integration reports. EQUILIBRIA, returned only when asked for as a
11% fourth output, are the solutions of f(x) = 0; they can be empty when the
12% system is beyond what the backend solves in closed form, which is a
13% limitation of the solve and not an assertion that none exist.
14%
15% Only smooth drifts have a Jacobian: see getSymbolicDrift, which refuses the
16% min-scaled methods by name rather than returning a one-sided derivative.
17%
18% @param options Solver options (optional, defaults to the solver's own)
19% @return J Cell matrix of expressions, J{i,j} = d f_i / d x_j
20% @return rhs The drift itself, one expression per state variable
21% @return vars The state variable names
22% @return equilibria Struct array of solutions of f(x) = 0 (optional)
23%
24% Copyright (c) 2012-2026, Imperial College London
25% All rights reserved.
26
27if nargin < 2 || isempty(options)
28 options = self.getOptions();
29end
30[rhs, vars] = self.getSymbolicDrift(options);
31
32backend = 'auto';
33if isfield(options, 'config') && isfield(options.config, 'symbolic')
34 backend = options.config.symbolic;
35end
36url = SAGE.resolve(backend);
37if isempty(url)
38 url = SAGE.require();
39end
40
41want = {'jacobian'};
42if nargout >= 4
43 want{end+1} = 'equilibria';
44end
45timeout = 300;
46if isfield(options, 'config') && isfield(options.config, 'symbolic_timeout')
47 timeout = options.config.symbolic_timeout;
48end
49[J, ~, equilibria] = SAGE.fluidODEs(rhs, vars, want, url, timeout);
50end