runmat 0.4.6 → 0.4.7-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=tf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tf.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/tf.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAmIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,136 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "tf",
5
+ "category": "control",
6
+ "keywords": [
7
+ "tf",
8
+ "transfer function",
9
+ "control system",
10
+ "coefficient vector"
11
+ ],
12
+ "summary": "Create a SISO transfer-function object from numerator and denominator coefficient vectors.",
13
+ "references": [
14
+ "title: \"MATLAB tf documentation\"",
15
+ "title: \"Octave control package tf documentation\""
16
+ ],
17
+ "gpu_support": {
18
+ "elementwise": false,
19
+ "reduction": false,
20
+ "precisions": [],
21
+ "broadcasting": "none",
22
+ "notes": "`tf` constructs host-side metadata. If coefficient inputs are gpuArray values, RunMat gathers them before creating the object."
23
+ },
24
+ "fusion": {
25
+ "elementwise": false,
26
+ "reduction": false,
27
+ "max_inputs": 0,
28
+ "constants": "inline",
29
+ "notes": "`tf` is not fused; it constructs a host-side object."
30
+ },
31
+ "requires_feature": null,
32
+ "tested": {
33
+ "unit": "builtins::control::tf::tests",
34
+ "integration": "crates/runmat-vm/tests/control.rs"
35
+ },
36
+ "description": "`tf(num, den)` creates a scalar-input scalar-output transfer-function object from numeric numerator and denominator coefficient vectors. Coefficients follow MATLAB's polynomial convention: the first entry is the highest-order term and the last entry is the constant term.",
37
+ "behaviors": [
38
+ "Accepts numeric scalar, row-vector, or column-vector numerator coefficients.",
39
+ "Accepts numeric scalar, row-vector, or column-vector denominator coefficients.",
40
+ "Normalizes stored numerator and denominator coefficients to row vectors on the returned `tf` object.",
41
+ "Returns a lightweight object whose class name is `tf`.",
42
+ "Stores `Numerator`, `Denominator`, `Variable`, `Ts`, `InputDelay`, and `OutputDelay` properties on the object.",
43
+ "Uses continuous-time defaults: `Variable` is `'s'` and `Ts` is `0`.",
44
+ "`tf(num, den, Ts)` stores a finite non-negative sample time and defaults `Variable` to `'z'`.",
45
+ "`tf(num, den, 'Variable', variable)` accepts `variable` values `'s'`, `'p'`, `'z'`, `'q'`, `'z^-1'`, and `'q^-1'`.",
46
+ "`tf(num, den, 'Ts', Ts)` or `tf(num, den, 'SampleTime', Ts)` stores a finite non-negative sample time.",
47
+ "Complex coefficients are accepted and stored as complex row vectors.",
48
+ "Logical and integer coefficients are promoted to double precision."
49
+ ],
50
+ "examples": [
51
+ {
52
+ "description": "Creating a first-order continuous-time transfer function",
53
+ "input": "H = tf(20, [1 5]);\nclass(H)",
54
+ "output": "ans = \"tf\""
55
+ },
56
+ {
57
+ "description": "Creating a second-order transfer function",
58
+ "input": "H = tf([1 2], [1 3 2]);\nH.Numerator\nH.Denominator",
59
+ "output": "H.Numerator = [1 2]\nH.Denominator = [1 3 2]"
60
+ },
61
+ {
62
+ "description": "Creating a discrete-time transfer function",
63
+ "input": "H = tf(1, [1 -0.5], 0.1);\nH.Variable\nH.Ts",
64
+ "output": "H.Variable = 'z'\nH.Ts = 0.1"
65
+ },
66
+ {
67
+ "description": "Selecting the polynomial variable",
68
+ "input": "H = tf([1 0], [1 2 1], 'Variable', 'p');\nH.Variable",
69
+ "output": "H.Variable = 'p'"
70
+ }
71
+ ],
72
+ "faqs": [
73
+ {
74
+ "question": "Does `tf` evaluate the transfer function at frequency points?",
75
+ "answer": "No. This implementation only constructs the transfer-function object. Frequency-response helpers such as `bode`, `freqresp`, and `evalfr` are separate Control System Toolbox functions."
76
+ },
77
+ {
78
+ "question": "Does `tf` support MIMO transfer functions?",
79
+ "answer": "Not yet. This implementation supports scalar-input scalar-output systems created from numeric coefficient vectors."
80
+ },
81
+ {
82
+ "question": "Does `tf` implement `step`, `impulse`, or `bode`?",
83
+ "answer": "No. Those functions are not part of this builtin."
84
+ },
85
+ {
86
+ "question": "Can I pass matrices of coefficients?",
87
+ "answer": "No. Numerator and denominator inputs must be scalars or vectors."
88
+ },
89
+ {
90
+ "question": "Can the denominator be all zeros?",
91
+ "answer": "No. The denominator coefficient vector must contain at least one non-zero value."
92
+ }
93
+ ],
94
+ "links": [
95
+ {
96
+ "label": "polyval",
97
+ "url": "./polyval"
98
+ },
99
+ {
100
+ "label": "roots",
101
+ "url": "./roots"
102
+ }
103
+ ],
104
+ "source": {
105
+ "label": "`crates/runmat-runtime/src/builtins/control/tf.rs`",
106
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/tf.rs"
107
+ },
108
+ "syntax": {
109
+ "example": {
110
+ "description": "Supported forms",
111
+ "input": "H = tf(num, den)\nH = tf(num, den, Ts)\nH = tf(num, den, 'Variable', variable)\nH = tf(num, den, 'Ts', Ts)",
112
+ "output": "H is a tf object."
113
+ },
114
+ "points": [
115
+ "`num` and `den` are numeric scalar, row-vector, or column-vector coefficient inputs. Coefficients are stored using MATLAB's highest-order-term-first polynomial convention.",
116
+ "`Ts` is an optional finite non-negative sample time. Positive sample times default the transfer-function variable to `'z'` unless `Variable` is provided explicitly.",
117
+ "`Variable` accepts `'s'`, `'p'`, `'z'`, `'q'`, `'z^-1'`, or `'q^-1'`. The denominator vector must contain at least one non-zero coefficient."
118
+ ]
119
+ },
120
+ "validation": {
121
+ "summary": "`tf` validates coefficient shapes, finite numeric values, supported variable names, and sample-time constraints before constructing the host-side transfer-function object. Unit and integration tests cover continuous and discrete constructors, row normalization, option parsing, and invalid denominator or matrix coefficient inputs.",
122
+ "implementation": {
123
+ "label": "`crates/runmat-runtime/src/builtins/control/tf.rs`",
124
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/control/tf.rs"
125
+ }
126
+ },
127
+ "gpu_residency": "`tf` is a host-side object constructor. gpuArray coefficient inputs are gathered before object construction, and the returned transfer-function object does not live on the GPU.",
128
+ "key": "tf",
129
+ "slug": "tf",
130
+ "aliases": [],
131
+ "categoryPath": [
132
+ "control"
133
+ ]
134
+ };
135
+ export default builtinDoc;
136
+ //# sourceMappingURL=tf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tf.js","sourceRoot":"","sources":["../../../src/generated/builtins/tf.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE;QACV,IAAI;QACJ,mBAAmB;QACnB,gBAAgB;QAChB,oBAAoB;KACrB;IACD,SAAS,EAAE,4FAA4F;IACvG,YAAY,EAAE;QACZ,oCAAoC;QACpC,oDAAoD;KACrD;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,gIAAgI;KAC1I;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;QACrB,OAAO,EAAE,sDAAsD;KAChE;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,8BAA8B;QACtC,aAAa,EAAE,mCAAmC;KACnD;IACD,aAAa,EAAE,iRAAiR;IAChS,WAAW,EAAE;QACX,8EAA8E;QAC9E,gFAAgF;QAChF,sGAAsG;QACtG,wDAAwD;QACxD,gHAAgH;QAChH,qEAAqE;QACrE,+FAA+F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,SAAS,EAAE,6UAA6U;QACxV,gBAAgB,EAAE;YAChB,OAAO,EAAE,oDAAoD;YAC7D,KAAK,EAAE,iGAAiG;SACzG;KACF;IACD,eAAe,EAAE,kLAAkL;IACnM,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,SAAS;KACV;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EAkyPjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA2Y9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
1
+ {"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EAozPjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA4Y9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
@@ -7352,6 +7352,24 @@ export const builtinManifest = [
7352
7352
  "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.",
7353
7353
  "exampleCount": 6
7354
7354
  },
7355
+ {
7356
+ "key": "tf",
7357
+ "title": "tf",
7358
+ "slug": "tf",
7359
+ "aliases": [],
7360
+ "category": "control",
7361
+ "categoryPath": [
7362
+ "control"
7363
+ ],
7364
+ "keywords": [
7365
+ "tf",
7366
+ "transfer function",
7367
+ "control system",
7368
+ "coefficient vector"
7369
+ ],
7370
+ "summary": "Create a SISO transfer-function object from numerator and denominator coefficient vectors.",
7371
+ "exampleCount": 4
7372
+ },
7355
7373
  {
7356
7374
  "key": "tic",
7357
7375
  "title": "tic",
@@ -8335,6 +8353,7 @@ export const builtinDocLoaders = {
8335
8353
  "tcpserver": () => import("./builtins/tcpserver.js").then((mod) => mod.default),
8336
8354
  "tempdir": () => import("./builtins/tempdir.js").then((mod) => mod.default),
8337
8355
  "tempname": () => import("./builtins/tempname.js").then((mod) => mod.default),
8356
+ "tf": () => import("./builtins/tf.js").then((mod) => mod.default),
8338
8357
  "tic": () => import("./builtins/tic.js").then((mod) => mod.default),
8339
8358
  "timeit": () => import("./builtins/timeit.js").then((mod) => mod.default),
8340
8359
  "times": () => import("./builtins/times.js").then((mod) => mod.default),