Laplace Transform — Control Systems/Symbolic
Control_Systems/Symbolic/Laplace_Transform · 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.
Laplace Transform
Control Systems / Symbolic
Takes the Laplace transform of an expression symbolically and evaluates
the result on the input at every sample – MATLAB's laplace, or
ilaplace when Direction is Inverse:
F(s) = L{f(t)} · f(t) = L−1{F(s)}
The transform is done once, when the configuration loads, from the same table MATLAB uses. What runs per sample is the RESULT. ⚠ This block does not transform a SIGNAL – there is no integral and no quadrature anywhere in the emitted body. It answers F at this s, which is what lets a transfer function derived symbolically be evaluated on a wire.
The factory setting is t²e−3t, whose transform is 2/(s+3)³ – a worked example out of the library.
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. ⚠ The SOURCE variable's entry is not read by the result – the transform eliminated it. It is still declared, and still an entry, because the expression that goes IN is written over it.
- y – the transform, the same shape as the expression: [1,1] for a scalar, [r,c] for a matrix literal, which is transformed entry by entry as MATLAB's own does.
Parameters
- Expression – the expression to transform, 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 abs sign heaviside. A matrix is written[f1; f2]. - Variables – the names of the input's entries, in order:
t s. ⚠ BOTH the source and the target must be here, because the answer is an expression in the target and it is read back against this list. Each is a MATLAB identifier, none may repeat, and none may be a function name orpi,e,i,j,Inf,NaNoreps. At most 12. - Source Variable – the variable the expression is written over (t for a forward transform, s for an inverse one). It must be one of the declared Variables.
- Target Variable – the variable the answer is written over. It must be one of the declared Variables too, and different from the source. MATLAB picks these by a rule when they are omitted; here they are named, because a block cannot depend on what its neighbours happen to be called.
- Direction – Forward for
laplace, Inverse forilaplace. - 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 transform 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 transforms
nothing. 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.
⚠ An INVERSE transform often answers with a variable in the exponent
– ilaplace of a simple pole is an exponential, and
iztrans's is a power like 2n−1. A power whose
exponent is not a constant is printed as the target's general power
(pow, powf, EXPT, $pow), and
VHDL's ** is only defined for an INTEGER exponent, so an
expression of that shape does not analyze there. A forward transform, whose answer
is a rational function, has no such term.
Simulink bridge
None (Support::None). laplace 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
- ⚠ A term the table cannot do is REFUSED, not carried. MATLAB leaves
laplace(g(t), t, s)standing in its answer and so does the engine behind this block; the family's reader then refuses it by name, because an unevaluatedlaplaceis not something ten targets can print. The configuration reports which term it was. - ⚠ The transform is one-sided, from 0 to infinity, as MATLAB's is. An expression that is meant to be two-sided transforms to something else.
abs,signandheavisideare accepted here, as they are on Symbolic Matrix Inverse: nothing is differentiated. They will usually leave the transform unevaluated, and that is the refusal above rather than a silent answer.- Algebraic, with no state: the output depends only on the current input.
- Size limits are on the generated code: 144 entries, 4000 operations per entry.
- 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/Laplace_Transform |
| family | Control_Systems/Symbolic |
| solver environment class | ICoreBlock_0_Control_Systems_1_Symbolic_2_Laplace_Transform |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Symbolic/Laplace_Transform/ICoreBlock_0_Control_Systems_1_Symbolic_2_Laplace_Transform.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Symbolic/Laplace_Transform/ICoreBlock_0_Control_Systems_1_Symbolic_2_Laplace_Transform.h |
| default size on canvas | 132 × 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 | t^2*exp(-3*t) | — |
Variables | t s | — |
Source Variable | t | — |
Target Variable | s | — |
Direction | forwardOption() | — |
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): laplace 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 checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0every stimulus in the sample errored — cross-checks skipped
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).
Laplace Transform -- laplace / ilaplace, taken from a table at config load F(s) = L{f(t)} Forward f(t) = L^-1{F(s)} Inverse
The transform runs ONCE, when the configuration loads; what each of the ten targets carries is the RESULT, as one inline expression. There is no integral and no numerical quadrature anywhere in the emitted body -- the block answers "F at this s", not "transform this signal", and the description says so in as many words because the name invites the other reading.
The reading, the sizing contract, compute_h and all ten generators are ICoreSymbolicBlockBase's; the transform table is the console's own symbolic engine's, reached through ICoreSymbolicProgram. This file is what is genuinely this block's.
⚠ THE ANSWER IS OVER A DIFFERENT VARIABLE FROM THE ONE THAT WENT IN. Every other block in this family answers over the variables it was given; this one eliminates the source and introduces the target, so BOTH have to be declared in "Variables" -- the result is read back through the family's reader and it knows only the declared names. The source entry of the input is then not read by the result, which is the transform having removed it rather than an oversight.
⚠ AN UNTRANSFORMABLE TERM IS A REFUSAL HERE, NOT A PASSTHROUGH. MATLAB answers
laplace(g(t))withlaplace(g(t), t, s)left standing, and the engine follows it; the family's reader then refuses that by name, because an unevaluatedlaplace(...)is not something ten targets can print. The configuration says which term it could not do.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at Laplace Transform block: ICore Blocks/Home/Laplace Transform. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.
Category unsampled · sample time 0.1 · 60 steps · commit 47621bb5e · produced by docsSample --out <folder> --blocks Laplace_Transform Z_Transform Partial_Fraction_Expansion --steps 60
Sample data: docs/generated/samples/Control_Systems__Symbolic__Laplace_Transform.json