Jacobian — Control Systems/Symbolic
Control_Systems/Symbolic/Jacobian · 1 input / 1 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Jacobian
Control Systems / Symbolic
The Jacobian of a vector expression, evaluated at the input:
J(i,k) = ∂fi/∂xk, an m×n matrix for
m expression entries and n declared variables. This is MATLAB's
jacobian(f, v); a scalar expression gives the row [1,n], as it does
there.
It is the linearisation a hand-written plant model usually carries as hard-coded
entries: write the nonlinear state derivatives as [f1; f2; ...] and the block
derives the matrix, symbolically, once, when the configuration loads.
Ports
- x – the variables, a vector of n entries (a column [n,1] or a row [1,n]) where n is the number of names in Variables: entry k is the k-th name. A Mux in front builds it from scalar signals.
- y – the Jacobian, [m,n]: one row per expression entry and one column per declared variable.
Parameters
- Expression – the expression, in MATLAB syntax over the names in
Variables: numbers,
pi,+ - * / ^, parentheses and the functionssin cos tan sec csc cot asin acos atan acot sinh cosh tanh asinh acosh atanh exp log log2 log10 sqrt. A matrix is written[f1; f2], with semicolons between rows and commas between the entries of a row.abs,signandheavisideare refused here, unlike on Symbolic Expression: see Notes. - Variables – the names of the input's entries, in order, separated by
spaces or commas:
x y z. Each is a MATLAB identifier, none may repeat, and none may be a function name orpi,e,i,j,Inf,NaNoreps. At most 12. - Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
Code export
All ten targets: Python, MATLAB, Java, Rust, C,
C++, VHDL, Verilog, SystemVerilog and PLC Structured
Text. The calculus is done once, at configuration load; what each target carries is
the RESULT, printed as one inline expression per entry with its constants folded to 17
significant digits, so a generated core differentiates nothing and has no parameter to
tune. Where a target lacks a function it gets the identity – Java has no inverse
hyperbolic functions and PLC Structured Text no hyperbolic functions at all, so those are
written through log, exp and sqrt. The three
HDL targets are simulation-only real arithmetic, quantized to
Q16.16 only at the ports: a derivative of a transcendental expression is not a fixed-point
datapath.
Simulink bridge
None (Support::None). jacobian is a Symbolic Math Toolbox
function, and that toolbox ships no Simulink library at all, so there is no library path a
diagram could name; the bridge reports this block rather than dropping it, and it
therefore has no parity testbench. Code export verification covers it across all
ten languages. No configuration crosses, including "Sampling Time (s)".
Notes
- The expression must be a VECTOR –
[f1; f2; ...], a column or a row, or a scalar. A matrix expression has no Jacobian, and the block says so rather than flattening it. abs,signandheavisideare refused in the expression. The symbolic engine answersdiff(abs(x))only under an assumption that x is real – console state a block may not depend on – and the derivative ofsignorheavisideis an impulse no sample can carry. Symbolic Expression accepts all three, because it differentiates nothing.- Algebraic, with no state: the output depends only on the current input.
- The calculus is the console's own symbolic engine's (the engine behind
diffandjacobianon the command line), over exact rational arithmetic; constants are folded to doubles only after it. - Size limits are on the generated code: 144 entries, 4000 operations per entry. An expression whose derivatives grow past that is refused with that reason rather than truncated.
- No state space: the map is nonlinear in general, so model reduction correctly declines the block.
Code facts#
| Fact | Value |
|---|---|
| registered type | Control_Systems/Symbolic/Jacobian |
| family | Control_Systems/Symbolic |
| solver environment class | ICoreBlock_0_Control_Systems_1_Symbolic_2_Jacobian |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Symbolic/Jacobian/ICoreBlock_0_Control_Systems_1_Symbolic_2_Jacobian.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Symbolic/Jacobian/ICoreBlock_0_Control_Systems_1_Symbolic_2_Jacobian.h |
| default size on canvas | 120 × 70 px |
| ports at insert | 1 in, 1 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | x |
| 2 | out | ICoreDouble | y |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Expression | [x^2*y + sin(z); exp(x*z) - y^3] | — |
Variables | x y z | — |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::None |
| Simulink path | — |
| port-count rule | PortsParam::None |
SampleTime parameter | yes |
Caveat (shown to the user): jacobian is a Symbolic Math Toolbox function, and that toolbox ships no Simulink library at all, so there is no library path a diagram could name; the block is reported rather than dropped when a model crosses
Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The lists agree. check_block_descriptions.py finds no disagreement between the description's Ports, Parameters, Code export and Simulink bridge lists and the code's.
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
Jacobian -- jacobian on an expression compiled at config load J(i, k) = df_i / dx_k
The Jacobian of a VECTOR expression: the matrix a hand-linearised plant would otherwise carry as hard-coded entries, derived from the expression itself at configuration load.
The reading, the sizing contract, compute_h and all ten generators are ICoreSymbolicBlockBase's; the calculus is the console's symbolic engine's, reached through ICoreSymbolicProgram. This file is what is genuinely this block's: its operation, its ports, its configs, its description, its icon and its Simulink entry.
VERIFIED OUTSIDE ICORE, because code-export verification compares the block with itself: the block's own C++ evaluation of its rig configuration was compared with MATLAB R2026a's jacobian on the same expression at the same points. Max |difference| 4.44e-16 over the six entries, which is rounding on the last bit rather than a tolerance.
Sample results#
Plotted: vector — Sine Wave, [3,1]: amplitudes 1/2/3 at 2 rad/s (tried only because every scalar stimulus was refused)
Category dynamic · sample time 0.1 · 60 steps · commit 83b4036dc8d5efdf28a47c36be1e27203065c75b · produced by docsSample --out <folder> --blocks Symbolic_Expression Symbolic_Derivative Gradient Jacobian Hessian Divergence_And_Curl Laplacian Taylor_Approximation Linear_Program LTI_System Wind_Turbulence_Model --steps 60 · data docs/generated/samples/Control_Systems__Symbolic__Jacobian.json · the SVG is generated from those numbers by tools/docs/plot_svg.py, so it is a run and not a drawing (R-D10).